-
Posts
108 -
Joined
Profile Information
-
Interests
Logic games, computer programming.
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
eaglehopes's Achievements
-
Google search console(GSC) tool does not say anything about which page is duplicate of the other explicity, but you can learn it by inspecting the problematic page. I did this inspection and saw that it says : "http://enginery.freecluster.eu/index.php?page=about" page is duplicate of "http://enginery.freecluster.eu/index.php" and GSC tool select the "http://enginery.freecluster.eu/index.php" as "http://enginery.freecluster.eu/index.php?page=about"'s canonical. I am thinking that, GSC look a resemblence ratio for its test. When a two page's content resemblence is higher than predefined ratio, then it sticks immediately "duplicate" mark. Also my about.html page content is so little regarding the rest of the page (i.e. header+footer) then, it could not pass the "duplicate test". So, I am externally give each page's canonical to GSC, which is the same in my sitemap, to overcome this issue.
-
Thanks requinix for answer. But I do not have any duplicate pages. Because there is no duplicate of my "about.html" in any of my website folder(htdocs or subfolders)! So, I have already started coding to solve it by using setting each external page's canonicals into index.php by using this function : <?php // use this code in index.php or in another page $page = isset($_GET['page']) ? $_GET['page'] : 'default'; // create URL $canonicalUrl = 'https://www.example.com/' . $page . '.php'; ?> <link rel="canonical" href="<?php echo $canonicalUrl; ?>" /> <!-- write canonical, both can be inside php code or outside of it, it does not matter--> So, I think this will add each page's canonical when sended into index.php, then it will stop giving this error. I also started to code changing the title, keywords and description etc. in meta tags when a new page sended to "index.php" . If this will help solving google search console's errors, I will be post again here and in my web blog as "one of the solutions" of this problem(not error according to google).
-
Hi, I am using a SQL and php code in my website. Every link in my site redirects to the main page with some variable. Such as, for "about me" link is like that : http://enginery.freecluster.eu/index.php?page=about.html then, I used "require" function to include the file content of "about.html". My "require()" code is inside index.php(main page of hy site) page. So I put all my external pages into my main page between region "header.php" and "footer.php". So, my index.php file hase these sections : 1) html, head , body tag 2) require(header.php) file (page including main menus of the website) // to use it once and every time 3) inlcuded external page content is here 4) require(footer.php) file // to use it once and every time 5) closing of body and html tags So, when user click to the page link from the main menu, every pages has a content "header.php" and "footer.php". My whole website has similar structure. Today I used google search console to apply SEO into my website. However, it gives : "Duplicate without user-selected canonical". I searched the reasons and found that "The most common trigger is having identical or very similar content that exists on multiple pages of your site." in https://seosly.com/blog/duplicate-without-user-selected-canonical/ So, I am suspecting that, google search engine looks the page, and see that header and footer parts are the same, then it marks all pages as "Duplicate without user-selected canonical" since content is very similar to the index.php page. I checked one of the errorenous pages and see that, google selected and external page's canonical as "index.php"! So, I can verify that above structure is my problem. How can I solve such interwined problems? How can I achieve "click and get" type website content other than this method? Is there any guide or tutorial you know? Thanks. (my website is http://enginery.freecluster.eu and its site map is in http://enginery.freecluster.eu/sitemap.xml)
-
Hi all, I adapted a "javascript game code" from tutorial https://spicyyoghurt.com/tutorials/html5-javascript-game-development/create-a-smooth-canvas-animation in my codepen : https://codepen.io/eaglehopes/pen/MWMgvjm My problem was I could not properly restart the animation(i.e. gameloop) where it begins! I am using "R" key from keyboard to restart the amination, but every time I restart, not the positions but the initial velocities of the objects changes so code become undeterministic - changine each time with the same input. Can anybody say that where am I doing wrong again? Thanks.
-
How to get where is the old row in new query?
eaglehopes replied to eaglehopes's topic in MySQL Help
Thanks kicken! So, I learned that "ordering" its importance in such situations. Without it, I am working on this solution: 1. a loop on the first query results and start a counter 2. match the path of the filename with the filename(or path) in the row 3. get the counter and find the page number by dividing counter to the result per page variable But, your solution is much more simple and elegant. Mehcanics always said that "less number or parts cause less errors and provide higher reliability". Less code does the same. That will solve my problem and I can find that my file is on which page by COUNT(*). -
My question is about how to get where is the old row in new query. Let me explain in detail. I have a categorized blog pages such under "computer programming". Computer programming has its own sub categories too. One is "Linux" for instance. And when I did "pagination" to show all blogs under "computer programming"\"Linux" such as, list of id and link were in table by sql query SELECT id,path, subCategoryId FROM `files` WHERE categoryId=5 AND subCategoryId=15 result table was : id path subCategoryId 297 /pages/blog/PH/GT/10.html 15 298 /pages/blog/PH/GT/11.html 15 299 /pages/blog/PH/GT/12.html 15 300 /pages/blog/PH/GT/1.html 15 301 /pages/blog/PH/GT/2.html 15 302 /pages/blog/PH/GT/3.html 15 303 /pages/blog/PH/GT/4.html 15 304 /pages/blog/PH/GT/5.html 15 305 /pages/blog/PH/GT/6.html 15 306 /pages/blog/PH/GT/7.html 15 307 /pages/blog/PH/GT/8.html 15 308 /pages/blog/PH/GT/9.html 15 333 /pages/blog/PH/GT/13.html 15 There are some missing files(htmls), so their id numbers did not match with the neither id number nor their filename. PH -philosophy is the category name, GT - general topics is subcategory name. In my home page, I listed the most current ones according to their edit dates and when user clicked the link of one of the latest blogs, link directed page to the according category page. There is a pagination at each category and I am showing three records per page. So when I clicked the for instance the link of the file "8.html", I knew that I will be in number 4 in the result of the first query and know that it will be shown in the page #4(since three records was shown in each page). The point I stucked is that : 1. I did the first query and get the results (table above) 2. How can I find the position of the page 8.html in the query I did in above using sql ? So my question is simply : how can I get an queried item's order/position? What I want to achieve is that, in my webpage's home, I show latest blogs. When user clicked one of them, I want to go to the related category and subcategory page and correct pagination link that include the blog will be back-colored with green. (one can get/test the question idea in my web page by clicking the latest blog in my home page and see the result : http://enginery.freecluster.eu/index.php?page=blog&subblog=CP&fin=WEB&blogPage=./pages/blog/CP/WEB/14.html. It opens the correct category and pagination is working, but I could not find the position of blog, where it was under the correct pagination. I want to color the correct link of the page number when I got there.) I hope, I could explain my question clearly. Thanks for any help.
-
Why my web page cause crash in Chrome and slow in Firefox?
eaglehopes replied to eaglehopes's topic in Other
I finally learned a bit of SQL and transferred the main part of my webpage content to MySQL database. Now my website became much faster! Just a few lines of SQL code solved lots of problems and opened a new vision, i.e. TODO list 😮 . -
Why did not element.getAttribute() work?
eaglehopes replied to eaglehopes's topic in Javascript Help
I wanted to record the code below that worked to extract CSS attributes : 1. In CSS file get :root { --width: 300px; --height: 300px; --innerPadding : 3px; --radius : 4px; --borderThickness : 1px; --diameter : calc(2*(var(--radius) +var(--borderThickness)) ); } #innerDiv { width : var(--width); height : var(--height); ... } 2. in javascript file : innerDiv = document.getElementById("innerDiv"); const elementStyleValues = getComputedStyle(innerDiv); // to extract CSS attributes innerDiv.style.width=( (width - 2*diameter) - 2*innerDiv.style.borderWidth.replace("px","") )+"px"; innerDiv.style.height=( (height - 2*diameter) - 2*innerDiv.style.borderWidth.replace("px","") )+"px" ; // get and write CSS attribute height of innerDiv element : errorLine.innerHTML= elementStyleValues.getPropertyValue('height'); // worked! So, using CSS attributes, kind of automation for dimensioning and sizing can be done by using javascript's getComputedStyle() function. -
Why did not element.getAttribute() work?
eaglehopes replied to eaglehopes's topic in Javascript Help
Ok requinix, then can I say that CSS could not change any of the attributes of any objects in HTML? If so, then I put some width for div element in CSS, then I can not get it as attribute. But how can I see it has some width then? Is CSS cause some kind of mask? How is this possible, does browser cause this? I think I found to how to get the "CSS attribute" of element from javascript code : using getComputedStyle() function! So I learned that: 1. I can not change any HTML attribute directly by using CSS, 2. to get changed CSS attribute of HTML element in javascript, I should use getComputedStyle() function ! Thanks requinix for guide. -
Why did not element.getAttribute() work?
eaglehopes replied to eaglehopes's topic in Javascript Help
Actually, I noticed that, when I explicitly define width and height attributes in HTML (not from CSS), they worked. It looks like a "hard-coded" vs. "soft coded" or something like that... I do not know : what worked was : <svg id="dotBorder" width="300" height="300" class="borderedSVG" > ... </svg> When I define width and height in CSS by var(--width) or var(--height), javascript does not understood it. Why? -
Why did not element.getAttribute() work?
eaglehopes replied to eaglehopes's topic in Javascript Help
Thanks requinix, 1. What I am actually trying to do is that creating a custom div element having a border with my drawn SVG. I will try to get svg's width and height but not worked too? 2. parentOfSVG has the same dimension, I put it as a wrapper, but now worked like mine 3. If so, I could get svg's width and height, but I could not? 4. there are very good illustrations in the link ! I am looking them ! -
Hi, I am trying to get the element's width and height by using element.getAttribute() function, but not worked. Not worked function was : function loading() { svg = document.getElementById("dotBorder"); errorLine = document.getElementById("error"); innerDiv = document.getElementById("innerDiv"); parentOfSvg = document.getElementById("parentOfSVG"); console.log(" svg : " + svg + " errorLine :"+errorLine+ " innerDiv :"+innerDiv+ " parentOfSvg:"+parentOfSvg); width = parentOfSvg.getAttribute('width') ; height = parentOfSvg.getAttribute('height'); console.log(" w1 : " + width + ", h1 :" + height ); } since error saying that "parentOfSvg" element is "undefined", width and height variables gave error. My code was available in https://codepen.io/eaglehopes/pen/MWZOEgg . Can anybody says that what is wrong? Thanks.