Jump to content
Chemo

[CONTRIBUTION] Google XML Sitemap Feed - by Chemo

Recommended Posts

Hi,

 

I'm trying to install the program and am getting this error:

 

Warning: main(includes/configure.php): failed to open stream: No such file or directory in /home/content/m/j/k/mjk234/html/googlesitemap/index.php on line 38

 

Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='.:/usr/local/lib/php') in /home/content/m/j/k/mjk234/html/googlesitemap/index.php on line 38

 

 

I'm no programmer, so I don't know what this means. Someone please help!

 

Matt

Share this post


Link to post
Share on other sites

I just discovered that my server no longer allows crons. Ain't that a ______ ! Does anyone have an alternative?


Anthony David

AllThingsTrendy.com

Share this post


Link to post
Share on other sites
I just discovered that my server no longer allows crons.  Ain't that a ______ !  Does anyone have an alternative?

That's a bummer. You'll just have to run the script and giving it to google manually.


Stress is a luxury afforded to those of us that need it least.

Where lipstick is concerned, the important thing is not color, but to accept God's final word on where your lips end. --Jerry Seinfeld

If you pick up a starving dog, and make him prosperous, he will not bite you. This is the principal difference between a man and a dog. --Mark Twain

Share this post


Link to post
Share on other sites

I want to implement a google sitemap but have a few questions.

1. I don't have the Ultimate SEO installed. Do I need that installed before implementation?

2. I have a main page in the root, and then I have the catalog. I want to place the sitemap in the root and index the main page and catalog categories and products,what should I do?

3. Are there any pitfalls I may get?

 

Thanks everyone.

Edited by supagene

Share this post


Link to post
Share on other sites
I want to implement a google sitemap but have a few questions.

1.  I don't have the Ultimate SEO installed.  Do I need that installed before implementation?

2.  I have a main page in the root, and then I have the catalog.  I want to place the sitemap in the root and index the main page and catalog categories and products,what should I do?

3.  Are there any pitfalls I may get?

 

Thanks everyone.

1. no, but it's a good idea

2. follow the instructions: put your dummy files in the root, and your googlesitemap folder in your catalog directory

3. Not really


Stress is a luxury afforded to those of us that need it least.

Where lipstick is concerned, the important thing is not color, but to accept God's final word on where your lips end. --Jerry Seinfeld

If you pick up a starving dog, and make him prosperous, he will not bite you. This is the principal difference between a man and a dog. --Mark Twain

Share this post


Link to post
Share on other sites

I have the articles contributions and the event manager installed on my site.

Will the site map automatically recognise things like that and index the content?

 

I also have plenty of other content on the site which is not fully interagated

into the oscommerce program but is indexed in google. Will there be any likely impact on the way google treats that. I mean it wouldn't get dropped of anything?

 

Thanks

Share this post


Link to post
Share on other sites
Hi,

With the above problem, I have submitted the googlesitemap/index.php to google, but Google shows the following error:

 

Parsing error

 

We were unable to read your Sitemap. It may contain an entry we are unable to recognize. Please validate your Sitemap before resubmitting.

 

Is there anyone who could help me with this?

 

Thanks

 

I got the same error-but when I was in google sitemap account setup and it asked for the url, I used the one listed on this page

http://store.mydomain.com/googlesitemap/index.php

 

which was:

 

http://www.google.com/webmasters/sitemaps/...itemapindex.xml

 

So I went back and just entered the actual URL to the xml page, without all the gibberish, waiting to see what happens now.

 

Let me know if you get your figured out, and i will do same.

 

 

(I am able to view the XML pages fine in browser) just getting the google parsing error

Share this post


Link to post
Share on other sites
I got the same error-but when I was in google sitemap account setup and it asked for the url, I used the one listed on this page

http://store.mydomain.com/googlesitemap/index.php

 

which was:

 

http://www.google.com/webmasters/sitemaps/...itemapindex.xml[/url]

 

So I went back and just entered the actual URL to the xml page, without all the gibberish, waiting to see what happens now.

 

Let me know if you get your figured out, and i will do same.

(I am able to view the XML pages fine in browser) just getting the google parsing error

 

Ok, that was my issue, my sitemap got approved in 38 minutes, I submitted the long URL that was in the index page which gave me the error.

 

I added just the short url and it worked.

Share this post


Link to post
Share on other sites
... I have changed the permission to 777, but the problem is with the file name.

I have to add "googlesitemap" before the name of the dummy xml files....

I have installed this contribution successfully on one server, now I am having the same problem as mentioned in an earlier post 263, /googlesitemap/index.php is prefixing the dummy file names with 'googlesitemap'.

Share this post


Link to post
Share on other sites

Looking in my /includes/configure.php I see I had:

define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

Once changed to define('DIR_FS_CATALOG', '/home/<my package name>/public_html/'); it worked fine.

Edited by rhubarb

Share this post


Link to post
Share on other sites

Chemo,

 

I added this contrib to my site containing SEO URL's Version 2 (Jan 05) and get this error when running googlesitemap:

 

Fatal error: Call to undefined function: tep_get_parent_categories() in /home2/ggbig/ggbig-www/CREw/includes/seo_cache.php on line 175

 

The tep_get_parent_categories() function is present but becomes undefined when running googlesitemap.

 

This is my seo_cache.php:

 

 

<?php
/*=======================================================================*\
|| #################### //-- SCRIPT INFO --// ########################## ||
|| #	Script name: includes/seo_cache.php
|| #	Contribution: Ultimate SEO URLs
|| #	Version: 2.0
|| #	Date: 30 January 2005
|| # ------------------------------------------------------------------ # ||
|| #################### //-- COPYRIGHT INFO --// ######################## ||
|| #	Copyright (C) 2005 Bobby Easland        # ||
|| #	Internet moniker: Chemo         	 # ||	
|| #	Contact: chemo@mesoimpact.com       	 # ||
|| #	Commercial Site: http://gigabyte-hosting.com/   	 # ||
|| #	GPL Dev Server: http://mesoimpact.com/     	 # ||
|| #               	 # ||
|| #	This script is free software; you can redistribute it and/or	# ||
|| #	modify it under the terms of the GNU General Public License  # ||
|| #	as published by the Free Software Foundation; either version 2	# ||
|| #	of the License, or (at your option) any later version. 	 # ||
|| #               	 # ||
|| #	This script is distributed in the hope that it will be useful,	# ||
|| #	but WITHOUT ANY WARRANTY; without even the implied warranty of	# ||
|| #	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the	# ||
|| #	GNU General Public License for more details.   	 # ||
|| #               	 # ||
|| #	Script is intended to be used with:        # ||
|| #	osCMax Power E-Commerce   	 # ||
|| #	http://oscdox.com          # ||
|| #	Copyright (c) 2003 osCommerce       	 # ||
|| ###################################################################### ||
\*========================================================================*/

# strip functon
# if anyone can help with international translations please correct the file and upload
 function strip($convert_me) {
$strip_array = array("'",chr(33),chr(34),chr(35),chr(36),chr(37),chr(38),chr(39),chr(40),chr(41),chr(42),chr(43),chr(44),chr(45),chr(46),chr(47),chr(58),chr(59),chr(60),chr(61),chr(62),chr(63),chr(91),chr(92),chr(93),chr(94),chr(95),chr(96),chr(123),chr(124),chr(125),chr(126) );  
$convert_me = str_replace($strip_array, '', $convert_me);
$convert_me = str_replace(array(' ', '  ', '__', '--'), '-', $convert_me);
$convert_me = strtolower($convert_me);
return $convert_me;
 }

# Set the cache name
$cache_file = $cache_dir . 'seo_urls_';	

# if the cache is not stored in the database
$cache->is_cached($cache_file . 'products', $is_cached, $is_expired); 	 
if ( !$is_cached || $is_expired ) { // it's not cached so create it
# Query for the products
$product_query = tep_db_query("select p.products_id, pd.products_name from products p left join products_description pd on p.products_id=pd.products_id and pd.language_id='".(int)$languages_id."' where p.products_status='1'");
# Initialize the product array
$prod_array = array();
# Loop the returned rows
while ($product = tep_db_fetch_array($product_query)) {
 $prod_array[$product['products_id']] = array('name' => strip($product['products_name']),
             'id' => $product['products_id']);
}
# Free the memory - could be large, clean as we go!
tep_db_free_result($product_query);
# Initialize the container used to check for duplicate names
$prod_container = array();
# Loop the product array
$prod_cache = '';
foreach($prod_array as $record){
 $id = $record['id'];
 # If the product name hasn't been set  
 if ( !isset($prod_container[ $record['name'] ]) ){
	 $name = $record['name'];
 } else { # This is a duplicate - get the counter and append
	 # Increase the counter
	 $prod_container[ $record['name'] ]['counter']++;
	 $prod_counter = $prod_container[ $record['name'] ]['counter'];
	 # Append the counter to the product name
	 $name = $record['name'] . '-' . $prod_counter;
 }
 # Add the defines to the output string  
 $prod_cache .= 'define(\'PRODUCT_NAME_' . $id . '\', \'' . $name . '\'); ' . "\n";
 $prod_cache .= 'define(\'' . $name  . '\', \'products_id=' . $id . '\'); ' . "\n";
 # Add the product name to the container array
 $prod_container[$name] = array('name' => $name, 'counter' => 1);
}
# Save the cached data to database
# Params: [ cache name, cache data, compressed, global ]
$cache->save_cache($cache_file . 'products', $prod_cache, 'EVAL', 1 , 1);
# Unset the variables used - could be large, clean as we go!
unset($prod_array, $prod_container, $prod_cache);
} # end if products is not cached

/************************************************************\
End of the product definitions - start of the manufacturers
\************************************************************/	

# if the cache is not stored in the database
$cache->is_cached($cache_file . 'manufacturers', $is_cached, $is_expired); 	 
if ( !$is_cached || $is_expired ) { // it's not cached so create it
# Query for the manufacturers
$manufacturers_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from manufacturers m left join manufacturers_info md on m.manufacturers_id=md.manufacturers_id and md.languages_id='".(int)$languages_id."'");
# Initialize the product array
$man_array = array();
# Loop the returned rows
while ($manufacturer = tep_db_fetch_array($manufacturers_query)) {
 $man_array[$manufacturer['manufacturers_id']] = array('name' => strip($manufacturer['manufacturers_name']),
             'id' => $manufacturer['manufacturers_id']);
}
# Free the memory - could be large, clean as we go!
tep_db_free_result($manufacturers_query);
# Initialize the container used to check for duplicate names
$man_container = array();
# Loop the product array
$man_cache = '';
foreach($man_array as $record){
 $id = $record['id'];
 # If the product name hasn't been set  
 if ( !isset($man_container[ $record['name'] ]) ){
	 $name = $record['name'];
 } else { # This is a duplicate - get the counter and append
	 # Increase the counter
	 $man_container[ $record['name'] ]['counter']++;
	 $man_counter = $man_container[ $record['name'] ]['counter'];
	 # Append the counter to the product name
	 $name = $record['name'] . '-' . $man_counter;
 }
 # Add the defines to the output string  
 $man_cache .= 'define(\'MANUFACTURER_NAME_' . $id . '\', \'' . $name . '\'); ' . "\n";
 $man_cache .= 'define(\'' . $name  . '\', \'manufacturers_id=' . $id . '\'); ' . "\n";
 # Add the manufacturer name to the container array
 $man_container[$name] = array('name' => $name, 'counter' => 1);
}
# Save the cached data to database
# Params: [ cache name, cache data, compressed, global ]
$cache->save_cache($cache_file . 'manufacturers', $man_cache, 'EVAL', 1 , 1);
# Unset the variables used - could be large, clean as we go!
unset($man_array, $man_container, $man_cache);
} # end if manufacturers is not cached

/************************************************************\
End of the manufacturers definitions - start of the categories
\************************************************************/	

# if the cache is not stored in the database
$cache->is_cached($cache_file . 'categories', $is_cached, $is_expired); 	 
if ( !$is_cached || $is_expired ) { // it's not cached so create it
# Query for the categories
$category_query = tep_db_query("select c.categories_id, c.parent_id, c.sort_order, cd.categories_name from categories c left join categories_description cd on c.categories_id=cd.categories_id and cd.language_id='".(int)$languages_id."' order by c.parent_id, c.sort_order ASC");
# Initialize the cat array
$cat_array = array();
# Loop the returned rows
while ($category = tep_db_fetch_array($category_query)) {	
 $cat_array[$category['categories_id']] = array('name' => strip($category['categories_name']),
             'id' => $category['categories_id'],
             'parent' => $category['parent_id']);
}
# Free the memory - could be large, clean as we go!
tep_db_free_result($category_query);
# Initialize the container used to check for duplicate names
$cat_container = array();
# Loop the cat array
$cat_cache = '';
foreach ($cat_array as $record){
 $name = $record['name'];
 $id = $record['id'];
 # If the category name hasn't been set
 if ( !isset($cat_container[ $cat_array[$record['parent']]['name'] .'-'.$name ]) ){
	 $parent_name = ($record['parent']=='0' ? '' : $cat_array[$record['parent']]['name'].'-');
 } else { # This is a duplicate category - get the counter and append
	 # Increase the counter
	 $cat_container[ $cat_array[$record['parent']]['name'] .'-'.$name ]['counter']++;
	 $parent_counter = $cat_container[ $cat_array[$record['parent']]['name'] .'-'.$name ]['counter'];
	 # Append the counter to the parent name
	 $parent_name = ($record['parent']=='0' ? '' : $cat_array[$record['parent']]['name'].'-'.$parent_counter.'-');
 }
 # Initialize the array to hold the category path
 $c = array();
 # Get the category path
 tep_get_parent_categories($c, $record['id']);
 # For some reason it seems to return in reverse order so reverse the array
 $c = array_reverse($c);
 # Implode the array to get the full category path
 $id = (implode('_', $c) ? implode('_', $c) . '_' . $record['id'] : $record['id']);
 # Add the defines to the output string  
 $cat_cache .= 'define(\'CATEGORY_NAME_' . $id . '\', \'' . $parent_name . $name . '\'); ' . "\n";
 $cat_cache .= 'define(\'' . $parent_name . $name . '\', \'cPath=' . $id . '\'); ' . "\n";  
 # Add the category name to the container array 
 $cat_container[$parent_name . $name] = array('id' => $id, 'counter' => 1);
}
# Save the cached data to the database
# Params: [ cache name, cache data, compressed, global ]
$cache->save_cache($cache_file . 'categories', $cat_cache, 'EVAL', 1 , 1);
# Unset the arrays used - could be large, clean as we go!
unset($cat_array, $cat_container, $cat_cache);
}# end if categories is not cached
?>

 

 

Any suggestions?

 

Thanks in advance for the help.

Share this post


Link to post
Share on other sites

Reinstalled Version 2.0b to use cName method and Google Sitemap now works ok. Must have been something I missed in the original install.

 

Thanks again for the help.

Share this post


Link to post
Share on other sites

Hello all,

 

Having another very weird problem. I got the 2 mods (SEO URL's 2.0b and GoogleSiteMap) to work well on a CRE 6.15 site.

 

However, when I installed the same on a default MS2 version (slightly modded - no page cache), the SEO URL's work ok until I run the GoogleSiteMap. I use the cName method (can't use mod_rewrite). When I run GoogleSiteMap, I get this error:

 

Fatal error: Call to undefined function: tep_get_parent_categories() in /home/cxdemo/cartxpress-demo-www/guk/includes/seo_cache.php on line 175

 

and then the configuration data for SEO URL's gets updated to 2.1 (which does not support cName) and SEO URL's are broken. I have to delete the SEO_ fields from the configuration tables and run install-cache.php / install-seo.php again to setup the database.

 

Why is GoogleSiteMap updating my SEO URL's configuration data? Is there any fix for this? I didn't have this problem when I installed both contribs on a CRE 6.15 site.

 

Any help is always appreciated.

Share this post


Link to post
Share on other sites

I downloaded the latest contribution (http://www.oscommerce.com/commuGoogle XML Sitemap Feed v1.3) and uploaded exactly as your instructions suggested.

 

My files are in the root not catalog

 

When I go to googlesitemaps

 

I get the following error. It is missing a / between the .com and filename.

 

See here --- comsitemapindex.xml

 

Any suggestions?

 

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] => 114824

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 1689

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => http://abcdefg.comsitemapproducts.xml

[status] => failure

[file_exists] => false

)

 

[1] => Array

(

[file] => http://abcdefg.comsitemapproducts1.xml

[status] => failure

[file_exists] => false

)

 

[2] => Array

(

[file] => http://abcdefg.comsitemapproducts2.xml

[status] => failure

[file_exists] => false

)

 

[3] => Array

(

[file] => http://abcdefg.comsitemapcategories.xml

[status] => failure

[file_exists] => false

)

 

[4] => Array

(

[file] => http://abcdefg.comsitemapindex.xml

[status] => failure

[file_exists] => false

)

 

)

 

)

 

 

Any suggestions as to where I should fix this problem?

Share this post


Link to post
Share on other sites

just uploaded the files and when i try to run http://www.cnt-gifts.com/shop/googlesitemap/index.php

 

i get this

 

Warning: fopen(/usr/home/chrisr/public_html/shop/googlesitemapsitemapproducts.xml): failed to open stream: Permission denied in /usr/home/chrisr/public_html/shop/googlesitemap/sitemap.class.php on line 291

ERROR: Google Product Sitemap Generation FAILED!

 

 

Warning: fopen(/usr/home/chrisr/public_html/shop/googlesitemapsitemapcategories.xml): failed to open stream: Permission denied in /usr/home/chrisr/public_html/shop/googlesitemap/sitemap.class.php on line 291

ERROR: Google Category Sitemap Generation FAILED!

 

 

Warning: fopen(/usr/home/chrisr/public_html/shop/googlesitemapsitemapindex.xml): failed to open stream: Permission denied in /usr/home/chrisr/public_html/shop/googlesitemap/sitemap.class.php on line 291

ERROR: Google Sitemap Index Generation FAILED!

 

Array

(

[QUERY] => Array

(

[PRODUCTS] => Array

(

[sTATUS] => success

[NUM_ROWS] => 107

)

 

[CATEOGRY] => Array

(

[sTATUS] => success

[NUM_ROWS] => 17

)

 

)

 

[sAVE_FILE_XML] => Array

(

[0] => Array

(

[file] => /usr/home/chrisr/public_html/shop/googlesitemapsitemapproducts.xml

[status] => failure

[file_exists] => false

)

 

[1] => Array

(

[file] => /usr/home/chrisr/public_html/shop/googlesitemapsitemapcategories.xml

[status] => failure

[file_exists] => false

)

 

[2] => Array

(

[file] => /usr/home/chrisr/public_html/shop/googlesitemapsitemapindex.xml

[status] => failure

[file_exists] => false

)

 

)

 

)

Share this post


Link to post
Share on other sites

Just installed and am getting the following error:

 

Generated Google Product Sitemap Successfully

 

Generated Google Category Sitemap Successfully

 

 

Fatal error: Call to undefined function: glob() in /home/hardware/web/Merchant2/catalog/googlesitemap/sitemap.class.php on line 743

 

 

Any ideas how to fix it?

 

Cheers

Share this post


Link to post
Share on other sites

Fatal error: main(): Failed opening required 'includes/filenames.php' (include_path='.::/usr/share/pear')

 

The filenames are in application_top.php

Is there a other Version of google sitemap?

Share this post


Link to post
Share on other sites

I see that there seems to be no more support for this. However, I have had success with it from day one. I use a mod_rewrite on one of my stores and modified the file(s) to support it. It looks like Chemo cannot support this because he was banned (I am sure he has more than one alias in this forum...many do). So, if everybody is having trouble, I will pull together my versions and post them. I must say that this contribution has made a huge impact in regards to my sites and Google, despite what they say. It is also a great way to get a new, unknown site on the map.

 

* I have also made a page and category in the admin that makes updating your Froogle and SiteMap feeds as easy as one click (I chose not to CRON for now).

 

 

manica

 

I need a little more info. What page are you attepting to access when you get this error?

 

 

seank123

 

Check and see if your system supports glob(). It is a way to get around the 255 character limit. I will look at "sitemap.class.php" and see what can be done...

 

 

CnTGifts

 

It looks like you need to set permissions for: /googlesitemap/

 

 

oscommercenewbie

 

If your store is in the root, then in "configure.php" you must make sure you have this setting:

 

define('DIR_WS_HTTP_CATALOG', '/');

 

Actually, all of these must be the same:

 

define('HTTP_COOKIE_PATH', '/');

define('HTTPS_COOKIE_PATH', '/');

define('DIR_WS_HTTP_CATALOG', '/');

define('DIR_WS_HTTPS_CATALOG', '/');

 

 

I hope this helps...


· willross

··········

Share this post


Link to post
Share on other sites

willross,

 

I also love this contrib and have had success with it. I did have a problem recently on one server. It did not have mod_rewrite for secure Apache installed. I was getting an Internal Server error when hitting checkout (ssl). It's installed now.

 

Now all works normal except for one glitch. I can go through the entire checkout process without errors until the very last stage. When you hit the "Confirm Order" button, it goes back to the Shopping Cart and says "your cart is empty". The order does go through and emails get sent but gets the wrong message at the end.

 

Any ideas?

 

Check out http://akcessories.net/shop/

 

Running CRE 6.15.

 

Any help is appreciated.

 

Sincerely,

 

Michael.

Edited by datazen

Share this post


Link to post
Share on other sites

Will

 

Thanks - looks like my server is running PHP v 4.2.2 - as far as I can tell, glob() is v 4.3 onwards??

 

I'll look into upgrading ASAP.

Share this post


Link to post
Share on other sites

datazen

 

I have not worked w/ "CRE 6.15", but have in a few older versions. Did it come with the mod_rewrite installed? The main reason I try to build from the default install is that I like to add features the are needed to run and manage the store. The "Loaded" versions tend to have as many installs as possible. I guess that they are trying to please everybody, but I would start with necessities first. Trying to turn features off in the "Loaded" shops do not always work as expected.

 

I would install a test version and try it w/ rewrite off and see if the problem persists.


· willross

··········

Share this post


Link to post
Share on other sites

oscommercenewbie

 

If your store is in the root, then in "configure.php" you must make sure you have this setting:

 

define('DIR_WS_HTTP_CATALOG', '/');

 

Actually, all of these must be the same:

 

define('HTTP_COOKIE_PATH', '/');

define('HTTPS_COOKIE_PATH', '/');

define('DIR_WS_HTTP_CATALOG', '/');

define('DIR_WS_HTTPS_CATALOG', '/');

I hope this helps...

 

'Thank you Will Ross - for your reply. Will check it out and see if it helps!

Share this post


Link to post
Share on other sites

oscommercenewbie

 

If your store is in the root, then in "configure.php" you must make sure you have this setting:

 

define('DIR_WS_HTTP_CATALOG', '/');

 

Actually, all of these must be the same:

 

define('HTTP_COOKIE_PATH', '/');

define('HTTPS_COOKIE_PATH', '/');

define('DIR_WS_HTTP_CATALOG', '/');

define('DIR_WS_HTTPS_CATALOG', '/');

I hope this helps...

 

'Thank you Will Ross - for your reply. Will check it out and see if it helps!

 

Changed the / issue.

 

Now I am getting the following error:

The XML page cannot be displayed

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

 

 

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

 

XML document must have a top level element. Error processing resource 'http://yaddayaddyadd.com/sitemapindex.xml'.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×