Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Google XML Sitemap Feed - by Chemo


Guest

Recommended Posts

shopping

 

OK. I have seen that before...

 

Then replace with these instead:

 

$location = $this->hrefLink('product' . $result['pID'] . '/product_info.html', 'source=google', 'NONSSL', false);

 

$location = $this->hrefLink('category' . $this->GetFullcPath($result['cID']) . '/index.html', 'source=google', 'NONSSL', false);

· willross

··········

Link to comment
Share on other sites

Bump ...

 

Hi,

 

I have installed this contrib and if it does what I think it does then it will be great. The only thing is that after setting up the cron I keep getting emails which contain the following ...

 

 

PHP Notice: Constant FILENAME_FEATURED already defined in /home/httpd/vhosts/cablesandkits.com/httpdocs/includes/filenames.php on line 248

PHP Notice: Constant FILENAME_FEATURED_PRODUCTS already defined in /home/httpd/vhosts/cablesandkits.com/httpdocs/includes/filenames.php on line 249

PHP Notice: Constant FILENAME_PRODUCT_LISTING_COL already defined in /home/httpd/vhosts/cablesandkits.com/httpdocs/includes/filenames.php on line 301

PHP Notice: Constant MODULE_SHIPPING_FEDEX1_LIST_RATES already defined in /home/httpd/vhosts/cablesandkits.com/httpdocs/googlesitemap/index.php on line 60

Content-type: text/html

 

X-Powered-By: PHP/4.3.10

 

 

 

<pre>Generated Google Product Sitemap Successfully

 

Generated Google Category Sitemap Successfully

 

Generated Google Sitemap Index Successfully

 

CONGRATULATIONS! All files generated successfully.

 

 

 

What does all that mean? I looked in the files and didnt really find anything that looked like it was trying to redefine those things. What could this be?

 

Any help is appreciated!

 

Craig

Edited by zboyblue
Link to comment
Share on other sites

shopping

 

OK. I have seen that before...

 

Then replace with these instead:

 

$location = $this->hrefLink('product' . $result['pID'] . '/product_info.html', 'source=google', 'NONSSL', false);

 

$location = $this->hrefLink('category' . $this->GetFullcPath($result['cID']) . '/index.html', 'source=google', 'NONSSL', false);

 

Thank you Willross,

 

I have made the replacements you advised, but unfortunaletly the same result :

 

Line 400 - 410

while( $result = $this->DB->FetchArray($products_query) ){

$top = max($top, $result['products_ordered']);

$location = $this->hrefLink('product' . $result['pID'] . '/product_info.html', 'source=google', 'NONSSL', false);

$lastmod = $this->NotNull($result['last_mod']) ? $result['last_mod'] : $result['date_added'];

$changefreq = GOOGLE_SITEMAP_PROD_CHANGE_FREQ;

$ratio = $top > 0 ? $result['products_ordered']/$top : 0;

$priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', '');

 

$container[] = array('loc' => htmlspecialchars(utf8_encode($location)),

'lastmod' => date ("Y-m-d", strtotime($lastmod)),

'changefreq' => $changefreq,

 

 

Line 440-450

ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

if ( $categories_query = $this->DB->Query($sql) ){

$this->debug['QUERY']['CATEOGRY']['STATUS'] = 'success';

$this->debug['QUERY']['CATEOGRY']['NUM_ROWS'] = $this->DB->NumRows($categories_query);

$container = array();

$number = 0;

while( $result = $this->DB->FetchArray($categories_query) ){

$location = $this->hrefLink('category' . $this->GetFullcPath($result['cID']) . '/index.html', 'source=google', 'NONSSL', false);

$lastmod = $this->NotNull($result['last_mod']) ? $result['last_mod'] : $result['date_added'];

$changefreq = GOOGLE_SITEMAP_CAT_CHANGE_FREQ;

$priority = .5;

 

 

http://www.solera.nl/sitemapproducts.xml

 

?xml version="1.0" encoding="UTF-8" ?>

- <urlset xmlns="http://www.google.com/schemas/sitemap/0.84">

- <url>

<loc>http://www.solera.nl/product45product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>1.0</priority>

</url>

- <url>

<loc>http://www.solera.nl/product52product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

- <url>

<loc>http://www.solera.nl/product53product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

- <url>

<loc>http://www.solera.nl/product58product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

- <url>

<loc>http://www.solera.nl/product51product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

- <url>

<loc>http://www.solera.nl/product55product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

</urlset>

 

 

 

I just wonder: Should not the lost month date change to 2005-10-16

 

Thanks

Rene

Link to comment
Share on other sites

shopping

 

That result cannot be possible. osC will NOT rewrite "/index.html" or "/product_info.html" to "index.php" and "product_info.php" as well as drop the "/". If anything, there would be errors. Please make sure the files you are looking at are the latest and not cached ones.

 

I will probably release my version of "sitemap.class.php" when I release SEF-X. SEF-X is my take on SEF. You can see it in action here: http://shoptoo.palaia.us/

· willross

··········

Link to comment
Share on other sites

shopping

 

That result cannot be possible. osC will NOT rewrite "/index.html" or "/product_info.html" to "index.php" and "product_info.php" as well as drop the "/". If anything, there would be errors. Please make sure the files you are looking at are the latest and not cached ones.

 

I will probably release my version of "sitemap.class.php" when I release SEF-X. SEF-X is my take on SEF. You can see it in action here: http://shoptoo.palaia.us/

 

 

Hello Willross,

 

You are probably right. I just have to wait for google to become re-indexed.

I understand that this could take some time.

Do you know when your SEF-X contrib will be released?

 

Thanks

 

Rene

Link to comment
Share on other sites

shopping

 

The sitemap that is created should have the correct URL's. To check, you could even use the shop's file manager to look at the .xml files. This would avoid any browser caching.

 

I would advise you not to allow Google access of your sitemap until it is correct. Otherwise, from the looks of the code above, Google will attempt to validate them and get 404's.

 

As far as SEF-X, I am still testing it and writing instructions. It should be released this year. I may even offer a whole modified shop. If you still get errors, I will put up my version.

· willross

··········

Link to comment
Share on other sites

To anyone using Chemo's XML Sitemap and having CRON problems . . .

 

The generic command output with the googlesitemap/index.php file is incorrect for some servers. :angry: If you use a server where the PHP API was installed as an Apache module and not a CGI module, you must use a different command. The "php" or "/usr/local/bin/php" command prefix will not work!

 

I have used the following command and it runs my job successfully:

 

lynx -dump http://mydomainname/googlesitemap/index.php

 

After many hours of searching the forum I found a good explanation on the forum at CRON Explanation.

 

Cheers! :)

Link to comment
Share on other sites

Thanks for this tip! I have changed it and will see what it does tonight.

 

Is there a way to run it now?

Sure, just change the time to run on the server CRON Tab. You should be able to set any time such as 5 minutes ahead, then submit job to server, then wait for your email.

 

Also, make sure you set the time based on the server's time frame. I am in Eastern time and my server is in Central. I didn't realize this until my email came back an hour later.

 

Don't forget to set your schedule time back to what you normally want after you see that it is working.

 

Wish you success.

Dennis

Link to comment
Share on other sites

I tried running it and got the following:

 

/bin/sh: line 1: lynx: command not found

 

What should I do?

That means that your server doesn't use the Lynx program . . . or possibly your syntax is wrong.

 

If you haven't already, look in your Admin Tools/Server Info on line 4, "Server API" . . . it should either be CGI or Apache. Both of them have different commands, and even variations within the 2 types. Then look at http://www.oscommerce.com/forums/index.php?act=ST&f=12&t=104175

 

There are a lot of variables that can cause the problem. The best thing I can suggest is to do what I did . . . try every few minutes with different commands until I hit upon the right one with the right syntax. It can be something as simple as a "period" or "slash" in the wrong place.

 

Good luck!

Dennis

Link to comment
Share on other sites

Hi Chemo,

Installed your contrib. and works all fine. Thanks

 

The only issue I have got is that when I try to submit it to google through their pages (submit your first sitemap), it gives me the following error:

 

We were unable to access the URL you provided due to a restriction in robots.txt. Please make sure the robots.txt file and the Sitemap URL are correct and resubmit your Sitemap.

 

My robots text does not say more than:

 

User-agent: *

Disallow: /images/

Disallow: /cgi-bin/

 

Can you give me some advice on this please?

Link to comment
Share on other sites

Hi Chemo,

Installed your contrib. and works all fine. Thanks

 

The only issue I have got is that when I try to submit it to google through their pages (submit your first sitemap), it gives me the following error:

 

We were unable to access the URL you provided due to a restriction in robots.txt. Please make sure the robots.txt file and the Sitemap URL are correct and resubmit your Sitemap.

 

My robots text does not say more than:

 

User-agent: *

Disallow: /images/

Disallow: /cgi-bin/

 

Can you give me some advice on this please?

Chemo can't post a reply. I just tried to submit a URL for a new site and got the same error. I have others working fine with the same setup. The robots.txt is also fine. Has anyone else run into this lately? I've verified that the robots.txt is reachable. Thanks.

 

David

Link to comment
Share on other sites

Not really a bug, but I just wanted to let you know.

I am setting up a test shop, that currently has a single product, I am getting the "Google Product Sitemap" generation to fail.

 

This is related to line #421 in the script sitemap.class.php

In the function GenerateProductSitemap(){

It should read

"if ( sizeof($container) >= 1 ) {"

 

instead of

 

"if ( sizeof($container) > 1 ) {"

 

 

/JS

Link to comment
Share on other sites

shopping

 

The sitemap that is created should have the correct URL's. To check, you could even use the shop's file manager to look at the .xml files. This would avoid any browser caching.

 

I would advise you not to allow Google access of your sitemap until it is correct. Otherwise, from the looks of the code above, Google will attempt to validate them and get 404's.

 

As far as SEF-X, I am still testing it and writing instructions. It should be released this year. I may even offer a whole modified shop. If you still get errors, I will put up my version.

 

 

 

Hello Willross,

 

Thank you for your suggestion to check the shop's file manager.

Please see the result as under.

As you can see it is the copy of the cached file dated 2005-10-01 ( which is the same file you can find through the internet).

21005-10-01 could well be the date that I installed the google sitemap program - I am not sure.

 

 

 

Should not the file be indexed automatically to a more recent date every time I open it????

Or do I have to re-install the google sitemap program each time after I have made changes to the web shop?????

What would have happened if I first installed Sef Lite and then google sitemap?????

 

Thanks in advance

Rene

-------------------------------------------------------------------------

 

File manager: sitemapproducts.xml

 

 

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">

<url>

<loc>http://www.solera.nl/product45product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>1.0</priority>

</url>

<url>

<loc>http://www.solera.nl/product52product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

<url>

<loc>http://www.solera.nl/product53product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

<url>

<loc>http://www.solera.nl/product58product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

<url>

<loc>http://www.solera.nl/product51product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

<url>

<loc>http://www.solera.nl/product55product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

</urlset>

Link to comment
Share on other sites

I'm getting the following error despite the fact that the three .xml files are in the catalogue folder and are all chomodded to 777... did anyone find the fix for this?

 

Oh yeah, it was also dropping the / infront of the .xml filenames (EG googlesitemapsitemapproducts.xml), but I managed to get it to insert that back on with some fiddling.

 

Warning:  fopen(/home/XXXX/public_html/catalogue/googlesitemap/sitemapproducts.xml): failed to open stream: Permission denied in /home/rawplea/public_html/raw-food-diet/googlesitemap/sitemap.class.php on line 291

ERROR: Google Product Sitemap Generation FAILED!



Warning:  fopen(/home/XXXX/public_html/catalogue/googlesitemap/sitemapcategories.xml): failed to open stream: Permission denied in /home/rawplea/public_html/raw-food-diet/googlesitemap/sitemap.class.php on line 291

ERROR: Google Category Sitemap Generation FAILED!



Warning:  fopen(/home/XXXX/public_html/catalogue/googlesitemap/sitemapindex.xml): failed to open stream: Permission denied in /home/rawplea/public_html/raw-food-diet/googlesitemap/sitemap.class.php on line 291

ERROR: Google Sitemap Index Generation FAILED!

Edited by silentz
Link to comment
Share on other sites

Is there any way to set the minimum priority in:

 

<url>

<loc>http://www.test.com/product55product_info.php?source=google</loc>

<lastmod>2005-10-01</lastmod>

<changefreq>weekly</changefreq>

<priority>0.1</priority>

</url>

 

from 0.1 to something else like 2.0?

Laser labels, barcode labels, custom labels

Link to comment
Share on other sites

I'm getting the following error despite the fact that the three .xml files are in the catalogue folder and are all chomodded to 777... did anyone find the fix for this?

 

Oh yeah, it was also dropping the / infront of the .xml filenames (EG googlesitemapsitemapproducts.xml), but I managed to get it to insert that back on with some fiddling.

 

Warning:  fopen(/home/XXXX/public_html/catalogue/googlesitemap/sitemapproducts.xml): failed to open stream: Permission denied in /home/rawplea/public_html/raw-food-diet/googlesitemap/sitemap.class.php on line 291

ERROR: Google Product Sitemap Generation FAILED!
Warning:  fopen(/home/XXXX/public_html/catalogue/googlesitemap/sitemapcategories.xml): failed to open stream: Permission denied in /home/rawplea/public_html/raw-food-diet/googlesitemap/sitemap.class.php on line 291

ERROR: Google Category Sitemap Generation FAILED!
Warning:  fopen(/home/XXXX/public_html/catalogue/googlesitemap/sitemapindex.xml): failed to open stream: Permission denied in /home/rawplea/public_html/raw-food-diet/googlesitemap/sitemap.class.php on line 291

ERROR: Google Sitemap Index Generation FAILED!

 

Did you get an answer to this one as I am stuck on this also??

Link to comment
Share on other sites

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /hsphere/local/home/kmberly3/diviningyourlife.com/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

i know the "sql problem/line 19" has come up a few times. i did read through all 18 pages :blink: , but either i missed the solution, or the solution missed me. please help...someone! :(

i'm very noobish as well. so as simple as possible too.

 

thanx in advance.

kim

Link to comment
Share on other sites

i know the "sql problem/line 19" has come up a few times. i did read through all 18 pages :blink: , but either i missed the solution, or the solution missed me. please help...someone! :(

i'm very noobish as well. so as simple as possible too.

 

thanx in advance.

kim

 

 

Just installed the new version of the contibution and I am getting the same error.

 

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /hsphere/local/home/rlawrenc/dreamtimebooks.co.uk/includes/functions/database.php on line 19

Unable to connect to database server!

 

I have also read through all the forum topics and can see that the new release already has all the bug fixes that resolved this same error in the first version. Any Ideas?

Link to comment
Share on other sites

Hi all.

 

I've installed Header Tag Controller and Ultimate SEO URL's contribs previous to this.

 

Now, I'm trying to get this contrib working. When I go to /catalog/googlesitemaps/index.php I either get a very long loading attempt or I usually get this:

 

Fatal error: Maximum execution time of 30 seconds exceeded in /home/emerging/public_html/catalog/includes/classes/seo.class.php on line 721

 

When I set it up as a cron, I got the no file exists (includes/configure.php) that many others have gotten (was there ever a fix for that? I couldn't find one). One strange thing is when I changed the path to configure.php to go from the root, I got the file doesn't exist error when calling googlesitemaps/index.php from a browser. But I don't get the error message the way it is set up out of the box - just either the endless loop or the error message above.

 

I have about 93000 products in my site. Will this contrib not work with a store that large?

 

I'd really like to get this working, so any help in the right direction would be greatly appreciated.

 

I've been really impressed with Chemo's contribs. Excellent stuff.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...