Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Google XML Sitemap Feed - by Chemo


Guest

Recommended Posts

i tried your script (GoogleXMLSitemapv1.3) in local, and functioned well. but when i upload it to the server i get the following error

 

ERROR: Google Product Sitemap Generation FAILED!

 

ERROR: Google Category Sitemap Generation FAILED!

 

ERROR: Google Sitemap Index Generation FAILED!

 

Array

(

[QUERY] => Array

(

[PRODUCTS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 33

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 6

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => /hsphere/local/home/xxxx/xxxxxxx/sitemapproducts.xml

[status] => failure

[file_exists] => false

)

 

[1] => Array

(

[file] => /hsphere/local/home/xxxx/xxxxxxx/sitemapcategories.xml

[status] => failure

[file_exists] => false

)

 

[2] => Array

(

[file] => /hsphere/local/home/xxxx/xxxxxxx/sitemapindex.xml

[status] => failure

[file_exists] => false

)

 

)

 

)

 

any idea???

 

i have installed the "Ultimate_SEO_URLs_v2[1].1d_1" too.

Link to comment
Share on other sites

Hi all,

was wondering if anyone ever saw this happening? Note the slash missing after public_html... needless to say nothing is working yet! I have changed the permissions to the three dummy xml files to 777. How can I fix this? I am using Chemo's - Google XML sitemap feed v.1.3

 

Warning: fopen(/home/kindredh/public_htmlsitemapproducts.xml): failed to open stream: Permission denied in /home/kindredh/public_html/googlesitemap/sitemap.class.php on line 581

 

ERROR: Google Product Sitemap Generation FAILED!

 

Warning: fopen(/home/kindredh/public_htmlsitemapcategories.xml): failed to open stream: Permission denied in /home/kindredh/public_html/googlesitemap/sitemap.class.php on line 581

 

ERROR: Google Category Sitemap Generation FAILED!

 

Warning: fopen(/home/kindredh/public_htmlsitemapindex.xml): failed to open stream: Permission denied in /home/kindredh/public_html/googlesitemap/sitemap.class.php on line 581

 

ERROR: Google Sitemap Index Generation FAILED!

 

Can anyone help me?

Thanks in advance

Link to comment
Share on other sites

Hi there

 

I received the following error message in my CRON e-mail, please can someone point me in the right direction.

 

PHP Warning: main(includes/configure.php): failed to open stream: No such file or directory in /home/******/public_html/shop/googlesitemap/index.php on line 38

 

Warning: main(includes/configure.php): failed to open stream: No such file or directory in /home/******/public_html/shop/googlesitemap/index.php on line 38 PHP Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/******/public_html/shop/googlesitemap/index.php on line 38

 

Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/******/public_html/shop/googlesitemap/index.php on line 38

Link to comment
Share on other sites

Hi - can anyone give me any tips on what could be done to solve this issue in my earlier post?

 

thanks

 

Hi all

 

I am trying to install v.1.3 on my site which has UltimateSEO installed already. I am doing this so I can get it to output the *.html url instead of the standard Oscommerce product.php?id=xxx urls.

 

Doing the install but am now stuck at an error which says

"Parse error: parse error, unexpected T_STRING in /usr/local/home/httpd/vhtdocs/domain-name/googlesitemap/sitemap.class.php on line 273

 

Line 273 in the sitemap.class.php is -

 

$compress = defined('GOOGLE_SITEMAP_COMPRESS') ? GOOGLE_SITEMAP_COMPRESS : 'false';

I am not a coder and I know I m making a basic mistake somewhere so would appreciate any help to sort this one out.

 

thanks for all help ain adance

Link to comment
Share on other sites

Hi,

 

i install this contrib and what could i say...it rocks :)

 

But now i want to integrate the enable/disable categories contrib to work well in this contrib.

 

I change the function GenerateCategorySitemap from

		$sql = "SELECT categories_id as cID, date_added, last_modified as last_mod 
			FROM " . TABLE_CATEGORIES . " 
			ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

to

		$sql = "SELECT categories_id as cID, date_added, last_modified as last_mod 
			FROM " . TABLE_CATEGORIES . " where categories_status = '1'
			ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

and it worked well.

 

But now i want to make changes to the function GenerateProductSitemap, not to display products from disabled categories.

I change from

		$sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered 
			FROM " . TABLE_PRODUCTS . " 
			WHERE products_status='1' 
			ORDER BY products_ordered DESC";

to

		$sql = "SELECT p.products_id as pID, p.products_date_added as date_added, p.products_last_modified as last_mod, p.products_ordered 
			FROM " . TABLE_PRODUCTS . " p,  " . TABLE_CATEGORIES . " cd where p.products_status='1' 
			and cd.categories_status = '1'
			ORDER BY p.products_ordered DESC";

but it doesnt work in anyway.

 

Anyone an idea?

lg pordoeb

 

 

Hi,

 

Did you find a solution for your problem? If so would you mind share it as i'm trying to get it to work with enable/disable categories also. And i cant seem to get it working...

Link to comment
Share on other sites

I added the categories_status ='1' and products_status ='1' to each of the queries and tested both products and categories disabled functions and they worked for me.

 

I think your problem lies elsewhere and not with the Google Mod itself.

Link to comment
Share on other sites

  • 2 weeks later...

Hey Everyone,

 

I have just uploaded into the Contributions area Chemo's NEW version of the XML Sitemap.

 

This version is a MUCH MUCH improved version. He has done a BRILLIANT job with this.

 

This is a one script solution and eliminates the need for CRON jobs, file permissions, and other problems that plague other scripts. All data is generated on the fly...truly a set and forget solution for osC stores.

 

The attached file is for the product sitemap. I have another for the categories but you should be able to use the very simple product one as a template...simply change the SQL a bit and you off and running.

 

Get it here: http://www.oscommerce.com/community/contributions,3233

 

Cheers,

Chris :)

Link to comment
Share on other sites

Hey Everyone,

 

I have just uploaded into the Contributions area Chemo's NEW version of the XML Sitemap.

 

This version is a MUCH MUCH improved version. He has done a BRILLIANT job with this.

 

This is a one script solution and eliminates the need for CRON jobs, file permissions, and other problems that plague other scripts. All data is generated on the fly...truly a set and forget solution for osC stores.

 

The attached file is for the product sitemap. I have another for the categories but you should be able to use the very simple product one as a template...simply change the SQL a bit and you off and running.

 

Get it here: http://www.oscommerce.com/community/contributions,3233

 

Cheers,

Chris :)

 

 

Hey, I just uploaded the new version with BOTH the products and categories Sitemaps.

Both of them were written by Chemo, and are great.

 

Simply copy them both into your catalog directory and tell Google where they are, and away you go. No need to change anything in them.

 

Here it is: http://www.oscommerce.com/community/contributions,3233

 

Cheers,

Chris :)

Link to comment
Share on other sites

Guys,

 

When I run the new scripts (googleSitemapCategories.php or googleSitemapProducts.php) I get the following error:

 

 

- <url>

<loc>http://www.orlysbookstore.com/catalog/bjewish-holidaysb-purim-c-39_49.html</loc>

<lastmod>2006-06-02</lastmod>

<changefreq>weekly</changefreq>

<priority>0.5</priority>

</url>

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

 

 

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

 

Only one top level element is allowed in an XML document. Error processing resource 'http://www.orlysbookstore.com/catalog/...

 

</urlset><div align="center"><span class="smallText">Current Parse Time: <b>0.229 s</b> with &...

urn false" onfocus="h()" class="b">- <url>

<loc>http://www.orlysbookstore.com/catalog/bjewish-holidaysb-hannukah-c-39_54.html</loc>

<lastmod>2006-06-02</lastmod>

<changefreq>weekly</changefreq>

<priority>0.4</priority>

</url>

- <url>

<DIV

 

Any ideas?

 

Shlomi

Link to comment
Share on other sites

Guys,

 

When I run the new scripts (googleSitemapCategories.php or googleSitemapProducts.php) I get the following error:

- <url>

<loc>http://www.orlysbookstore.com/catalog/bjewish-holidaysb-purim-c-39_49.html</loc>

<lastmod>2006-06-02</lastmod>

<changefreq>weekly</changefreq>

<priority>0.5</priority>

</url>

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

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

 

Only one top level element is allowed in an XML document. Error processing resource 'http://www.orlysbookstore.com/catalog/...

 

</urlset><div align="center"><span class="smallText">Current Parse Time: <b>0.229 s</b> with &...

urn false" onfocus="h()" class="b">- <url>

<loc>http://www.orlysbookstore.com/catalog/bjewish-holidaysb-hannukah-c-39_54.html</loc>

<lastmod>2006-06-02</lastmod>

<changefreq>weekly</changefreq>

<priority>0.4</priority>

</url>

- <url>

<DIV

 

Any ideas?

 

Shlomi

 

Hey,

 

From a brief look, are you sending other data through your application_top and application_bottom. You cannot do that with this script.

 

The problem could also be because you have HTML tags in your product description.

 

What this line doing there: <div align="center"><span class="smallText">Current Parse Time: <b>0.229 s</b> with &...

urn false" onfocus="h()" class="b">

 

The output in this file should ONLY be your products, and nothing else. You cannot add any other data to it.

 

Maybe try commenting out the bit where it includes application_bottom and seeing how it goes??

 

Cheers,

Chris

Link to comment
Share on other sites

I commented out "includes application_bottom" and it works.

 

Thanks

 

Hey,

 

From a brief look, are you sending other data through your application_top and application_bottom. You cannot do that with this script.

 

The problem could also be because you have HTML tags in your product description.

 

What this line doing there: <div align="center"><span class="smallText">Current Parse Time: <b>0.229 s</b> with &...

urn false" onfocus="h()" class="b">

 

The output in this file should ONLY be your products, and nothing else. You cannot add any other data to it.

 

Maybe try commenting out the bit where it includes application_bottom and seeing how it goes??

 

Cheers,

Chris

Link to comment
Share on other sites

Hello, I'm getting the following error when trying to run this script: I have the script installed at

 

/catalog/googleSitemapCategories.php

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Any help would be appreciated.

Thanks

Link to comment
Share on other sites

First thanks for your updates, stonebridgecomputing, and thanks to Chemo for his scripts.

 

@stonebridgecomputing

 

I see that your googleSitemapCategories.php does not index all categories but just the subcategories containing the products. Is there a reason for this or is it a bug?

 

Example:

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

test_cat1

test_sub_cat1

test_prod1

test_cat2

test_sub_cat2

test_prod2

test_cat3

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

googleSitemapProducts.php shows the products correctly.

 

googleSitemapCategories.php shows only test_sub_cat1 and test_sub_cat2, but it doesn't show test_cat1, test_cat2 and test_cat3.

 

For those that want to have all categories replace the $sql variable in googleSitemapCategories.php line 50 from:

$sql = "SELECT 
				c.categories_id as cID, 
				c.date_added as category_date_added, 
				c.last_modified as category_last_mod,
				MAX(p.products_date_added) as products_date_added, 
				MAX(p.products_last_modified) as products_last_mod   
		FROM " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c 
			LEFT JOIN " . TABLE_PRODUCTS . " p 
				ON (p2c.products_id = p.products_id) 
		WHERE c.categories_id = p2c.categories_id 
		GROUP BY cID  
		ORDER BY 
			category_date_added ASC, 
			category_last_mod ASC, 
			products_date_added ASC, 
			products_last_mod ASC";

to:

$sql = "SELECT categories_id as cID, date_added as category_date_added, last_modified as category_last_mod 
			FROM " . TABLE_CATEGORIES . " 
				ORDER BY parent_id ASC, sort_order ASC, categories_id ASC";

(preferably just comment the code to replace by using /* and */ and add the new code below it)

Link to comment
Share on other sites

First thanks for your updates, stonebridgecomputing, and thanks to Chemo for his scripts.

 

@stonebridgecomputing

 

I see that your googleSitemapCategories.php does not index all categories but just the subcategories containing the products. Is there a reason for this or is it a bug?

 

Example:

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

test_cat1

test_sub_cat1

test_prod1

test_cat2

test_sub_cat2

test_prod2

test_cat3

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

googleSitemapProducts.php shows the products correctly.

 

googleSitemapCategories.php shows only test_sub_cat1 and test_sub_cat2, but it doesn't show test_cat1, test_cat2 and test_cat3.

 

Hey,

 

The category code was Chemo's too, and I dont know why he did it.

 

If people find your changed code better, then please feel free to put it in the contribs area.

 

Cheers,

Chris :)

Link to comment
Share on other sites

I am not real sure where to look. I just installed Google XML Sitemap Admin and am receiving errors on the products file. Here is what it says when I create/update my sitemap.

 

ERROR: Google Product Sitemap Generation FAILED!

 

Generated Google Category Sitemap Successfully

 

Generated Google Sitemap Index Successfully

 

Array

(

[QUERY] => Array

(

[PRODUCTS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 1

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 6

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => /home/content/g/l/o/xxxxxxx/html/catalog/sitemapcategories.xml

[status] => success

[file_exists] => true

)

 

[1] => Array

(

[file] => /home/content/g/l/o/xxxxxxx/html/catalog/sitemapindex.xml

[status] => success

[file_exists] => true

)

 

)

 

)

Link to comment
Share on other sites

Hi,

 

Please forgive if I sound stupid in asking this as I am still pretty new to all this php stuff... I went to add the On the fly Google XML from June 20.

 

There were no real instructions in this and basically if I understand it correctly all I had to do is just put those two files in my catalog directory and submit to Google and I am done???

 

While this sounds way to easy - I see in the support many questions about other stuff - so I guess I am wondering do I need to install anything else with this or is it stand alone?

 

Also once I do just add these files where do I go from there... is there anything I need to do to run scripts or does it do it by itself when called on? I did go to the google sitemaps and tried to get to index but just got 404 error.

 

Any help for a beginner like me really would be so kindly appreciated.

 

Lexi-

Link to comment
Share on other sites

Hi,

 

Please forgive if I sound stupid in asking this as I am still pretty new to all this php stuff... I went to add the On the fly Google XML from June 20.

 

There were no real instructions in this and basically if I understand it correctly all I had to do is just put those two files in my catalog directory and submit to Google and I am done???

 

While this sounds way to easy - I see in the support many questions about other stuff - so I guess I am wondering do I need to install anything else with this or is it stand alone?

 

Also once I do just add these files where do I go from there... is there anything I need to do to run scripts or does it do it by itself when called on? I did go to the google sitemaps and tried to get to index but just got 404 error.

 

Any help for a beginner like me really would be so kindly appreciated.

 

Lexi-

 

 

Hi,

 

For anyone who isn't sure how to install the new On The Fly Google XML Sitemap by Chemo, all you need to do is to copy it into your catalog directory and then submit it to Google. You DO NOT need to change any files.

 

If it doesn't work and comes up with some error about there already being output, then open up the xml sitemap file and comment out the include application_bottom.php file and see how you go.

 

Regards,

Chris

Link to comment
Share on other sites

Hi Chris,

 

Thank you so much for your reply & I did go in and delete the include application_bottom.php & it worked like a charm!!!

 

Thank you so very very much!!

 

Lexi :D

Link to comment
Share on other sites

Hi,

 

I know the answer is simple & I will be embarressed - however here goes, I have installed the Google XML Sitemap, latest ver. wouldn't run so comment out 'app_bottom' and when you view it in a browser http://www.fieldsofblue.co.uk/store/google...pCategories.php it shows an XML file - perfect!

 

Here is the stupid bit - what happens next? - I know google sitemaps - have a few in there, I can add a given sitemap and submit it - but something needs to generate a file /storesitemap.xml or whatever....

 

OR Do I need to save these xml files myself? or am I missing something (apart from a brain!)

 

have found most things in here and it has been VERY helpful

 

appreciate any help

 

Thanks graham

Link to comment
Share on other sites

Hi,

 

I know the answer is simple & I will be embarressed - however here goes, I have installed the Google XML Sitemap, latest ver. wouldn't run so comment out 'app_bottom' and when you view it in a browser http://www.fieldsofblue.co.uk/store/google...pCategories.php it shows an XML file - perfect!

 

Here is the stupid bit - what happens next? - I know google sitemaps - have a few in there, I can add a given sitemap and submit it - but something needs to generate a file /storesitemap.xml or whatever....

 

OR Do I need to save these xml files myself? or am I missing something (apart from a brain!)

 

have found most things in here and it has been VERY helpful

 

appreciate any help

 

Thanks graham

 

Hey,

 

You do not need to save any files or create any other files. You simply sign up with Google Sitemaps, and then add the php file as the sitemap for Google. Google doesn't look whether it is an xml file or whatever; it simply looks at the content of the file and sees that it is in XML format, and uses it.

 

The point of this version of the XML sitemap feed was to get rid of the whole process of having to create separate XML files.

 

Hope this helps.

 

Cheers,

Chris

Link to comment
Share on other sites

Hey,

 

You do not need to save any files or create any other files. You simply sign up with Google Sitemaps, and then add the php file as the sitemap for Google. Google doesn't look whether it is an xml file or whatever; it simply looks at the content of the file and sees that it is in XML format, and uses it.

 

The point of this version of the XML sitemap feed was to get rid of the whole process of having to create separate XML files.

 

Hope this helps.

 

Cheers,

Chris

 

THANKS - I knew it would be simple!! All my other sitemap files have xml exts. that confused meThanxs again Graham

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...