Guest Posted June 5, 2005 Share Posted June 5, 2005 The experimental Google XML sitemap service was announced on 2 June 2005 and represents a huge development in terms of crawler technology. This contribution is designed to create the sitemap XML feed per the protocol specification delineated by Google. WHAT THIS CONTRIBUTION DOES This contribution creates a sitemap index file and also 2 additional sitemaps (products and categories). It is designed to be run via CRON (primary and preferred method) and also browser as needed. Once the XML feeds are created a store owner should only submit the sitemap index which points to the product and category sitemaps. WHY SHOULD A STORE INSTALL A GOOGLE XML SITEMAP? ...because Google wants to experiment with the service as a means to improve their search result quality. Any time Google wants to experiment I'm in... NOTES The code is THOROUGHLY documented so that other developers can jump on and help. I put a huge amount of time with the documentation on this one so hopefully I'll get some help with future development. ...besides, having quality code AND quality documentation is just sexy :) DOWNLOAD Google XML Sitemap Feed - by Chemo Enjoy! Bobby Quote Link to comment Share on other sites More sharing options...
kitchenniche Posted June 5, 2005 Share Posted June 5, 2005 Hi Bobby, This sounds pretty interesting, thanks for posting it in the forums. :thumbsup: Is this Google-Sitemap something to do with the "usual" sitemap? Would i have to replace the sitemap i currently have with the google-sitemap? Thanks, Sandra Quote HIM - Dark Light - Out on 26/09/05 Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 The Google sitemap is an XML feed that will be used by the Google spider to crawl your site. Read about it here: [RUL=https://www.google.com/webmasters/sitemaps/docs/en/about.html]About the Google XML Sitemap Feed[/url]. Also, there is a FAQ located here: Google XML Sitemap FAQ. In a nutshell, it's a Google experiment...the effect can only be positive and will NOT detract from normal spider activity. Per Google, "In most cases, webmasters will benefit from Sitemap submission, and in no case will you be penalized for it". Bobby Quote Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 hi chemo, tried installing this contrib and got the following error Fatal error: Call to a member function on a non-object in /*****/htdocs/*****/catalog/googlesitemap/index.php on line 66 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 Open the file and find this line of code on 66: $cache->get_cache('GLOBAL'); and change it to this: //$cache->get_cache('GLOBAL'); Save the file and try it again! :) Bobby Quote Link to comment Share on other sites More sharing options...
Wendy James Posted June 5, 2005 Share Posted June 5, 2005 (edited) I ran right away to give this a try and got Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/.asylum/cinnie/homeandgardengiftsandcollectibles/googlesitemap/sitemap.class.php on line 83 ERROR: Google Product Sitemap Generation FAILED! ERROR: Google Category Sitemap Generation FAILED! Generated Google Sitemap Index Successfully when running the googlesitemap/index.php Edited June 5, 2005 by wendyjames Quote Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 Open the file and find this line of code on 66: $cache->get_cache('GLOBAL'); and change it to this: //$cache->get_cache('GLOBAL'); Save the file and try it again! :) Bobby <{POST_SNAPBACK}> alright did that now get this ERROR: Google Product Sitemap Generation FAILED! ERROR: Google Category Sitemap Generation FAILED! ERROR: Google Sitemap Index Generation FAILED! Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 This is the code on line 83: function ConnectDB(){ $this->link_id = mysql_connect($this->$host, $this->user, $this->pass); } # end function Basically, it's the database connection...so, there is an error with the credentials being provided. This is puzzling as it is passing the same credentials to the class that are defined in the configure.php file. So, if it works on the store it should work for the class as well. The GoogleSitemap class is initialized with this code: $google = new GoogleSitemap(DB_SERVER, DB_SERVER_USERNAME, DB_DATABASE, DB_SERVER_PASSWORD); As you can see, it's using the defined constants from configure.php Are there any other errors generated? Maybe the actual problem is a bit higher but that is the script kill point? Bobby Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 alright did that now get this ERROR: Google Product Sitemap Generation FAILED! ERROR: Google Category Sitemap Generation FAILED! ERROR: Google Sitemap Index Generation FAILED! <{POST_SNAPBACK}> Did you upload the dummy XML files and change the permissions to 777 ??? Bobby Quote Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 Did you upload the dummy XML files and change the permissions to 777 ??? Bobby <{POST_SNAPBACK}> yup did it in my root Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 Tell me about your setup... Is your store installed in the root? Like domain.com/ or is it domain.com/directory/? Where did you upload the dummy files? Bobby Quote Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 Tell me about your setup... Is your store installed in the root? Like domain.com/ or is it domain.com/directory/? Where did you upload the dummy files? Bobby <{POST_SNAPBACK}> store is in domain.com/catalog/ dummyfiles are domain.com/ Quote Link to comment Share on other sites More sharing options...
Wendy James Posted June 5, 2005 Share Posted June 5, 2005 (edited) Not that I can see. I copy and pasted the whole page (error) Could I enter that information manually or does it have to be grabbed from the configure.php? I don't know a whole bunch about coding, but I looked at the sitemap.class.php and it even made sense to me. lol Not sure why it is happening though, and so you know my site is not having any problems right now. I checked, just to be sure. lol You are very busy so I can wait.. if you want to help one at a time. =) Edited June 5, 2005 by wendyjames Quote Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 Dummy files should be in the catalog directory like this: domain.com/catalog/sitemapindex.xml domain.com/catalog/sitemapproducts.xml domain.com/catalog/sitemapcategories.xml Move them to the catalog directory, set the permissions as 777, and give it one more try. :) Bobby Quote Link to comment Share on other sites More sharing options...
Tomcat Posted June 5, 2005 Share Posted June 5, 2005 and I get this error : Fatal error: Call to undefined function: tep_session_is_registered() in /home/i8carati/public_html/catalog/includes/functions/html_output.php on line 237 Dummy files are chmoded to 777 and stored on public_html ( root) sitemap directory is under mydomain.com/catalog/ Any idea ? Thanks Quote Outside links in signatures are not allowed! Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 (edited) wendy this might be the error..but chemo should double check.. This is the code on line 83: function ConnectDB(){ $this->link_id = mysql_connect($this->$host, $this->user, $this->pass); } # end function <{POST_SNAPBACK}> not sure if im right but looks like there is an errror on line 83 and should read $this->link_id = mysql_connect($this->host, $this->user, $this->pass); instead of $this->link_id = mysql_connect($this->$host, $this->user, $this->pass); as there is an extra $ in this line Edited June 5, 2005 by theman Quote Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 Dummy files should be in the catalog directory like this: domain.com/catalog/sitemapindex.xml domain.com/catalog/sitemapproducts.xml domain.com/catalog/sitemapcategories.xml Move them to the catalog directory, set the permissions as 777, and give it one more try. :) Bobby <{POST_SNAPBACK}> same error once again Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 omg...you are absolutely correct. I'll upload another version...in the meantime everyone correct that. Good catch! Bobby Quote Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 (edited) omg...you are absolutely correct. I'll upload another version...in the meantime everyone correct that. Good catch! Bobby <{POST_SNAPBACK}> alright now that thats fixed i get another error :~ Fatal error: Call to undefined function: tep_session_is_registered() in /homepages/9/*********/htdocs/***/catalog/includes/functions/html_output.php on line 207 here are my lines 207 - 221 if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')) { $link .= $separator . '<osCsid>'; $seo_link .= $separator . '<osCsid>'; $seo_rewrite_link .= $separator . '<osCsid>'; } elseif (isset($_sid)) { $link .= $separator . $_sid; $seo_link .= $separator . $_sid; $seo_rewrite_link .= $separator . $_sid; } if ($seo == 'true') { return ($seo_rewrite_type == 'Rewrite' ? $seo_rewrite_link : $seo_link); } else { return $link; } Edited June 5, 2005 by theman Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 ...OK...try this: Somewhere near the top of googlesitemap/index.php paste this code: function tep_session_is_registered( $var ){ return false; } If it works for you I'll roll it into the next release immediately... The reason there is that error is because I had to eliminate the sessions all together...or it would not run under CRON properly. So, it looks like that is the last piece of the puzzle. I did not experience that problem since it was developed on a dev server with the new SEO URLs. Try it and let me know how it goes... Quote Link to comment Share on other sites More sharing options...
Wendy James Posted June 5, 2005 Share Posted June 5, 2005 I have exactly the same error now, but it says line 205. lol How do you guys do it? I would never ever have spotted an extra $. Guess that is why I am just a housewife. lol Quote Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 Wendy...I offered a quick bit of code in the previous post. Can you grab it and save it somewhere near the top of googlesitemap/index.php? Let me know if that works for you... Bobby Quote Link to comment Share on other sites More sharing options...
theman Posted June 5, 2005 Share Posted June 5, 2005 that tepsession error goes away but then i get the ERROR: Google Product Sitemap Generation FAILED! ERROR: Google Category Sitemap Generation FAILED! ERROR: Google Sitemap Index Generation FAILED! Quote Link to comment Share on other sites More sharing options...
Wendy James Posted June 5, 2005 Share Posted June 5, 2005 (edited) adding function tep_session_is_registered( $var ){ return false; } worked for me Chemo... atleast I think it did. I get this now Generated Google Product Sitemap Successfully Generated Google Category Sitemap Successfully Generated Google Sitemap Index Successfully All files generated successfully. If you have not already submitted the sitemap index to Google click the link below. http://www.google.com/webmasters/sitemaps/...itemapindex.xml oops, except that the link is not clickable and has extra vharacters in it... not sure why it pasted right says http%3A%2F%2F<snip on request>%2Fsitemapindex.xml Edited June 6, 2005 by mattice Quote Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep. Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2005 Share Posted June 5, 2005 that tepsession error goes away but then i get theERROR: Google Product Sitemap Generation FAILED! ERROR: Google Category Sitemap Generation FAILED! ERROR: Google Sitemap Index Generation FAILED! <{POST_SNAPBACK}> Great! That is progress! Now, let's work on those paths for the files. Maybe I didn't make it clear enough in the install file. The dummy files should be uploaded to the CATALOG directory wherever that may be...whether it is in the root or in a directory. Are the dummy files in the store root? adding function tep_session_is_registered( $var ){ return false; } worked for me Chemo... atleast I think it did. I get this now Generated Google Product Sitemap Successfully Generated Google Category Sitemap Successfully Generated Google Sitemap Index Successfully All files generated successfully. If you have not already submitted the sitemap index to Google click the link below. <{POST_SNAPBACK}> Congratulations! It is installed and ready to view! Take a look at the XML files and make sure the data is good... Bobby Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.