Google Sitemap Generator

[quote name=‘sculptingstudio’]Without an error, I can’t go any further.[/QUOTE]



OK, thanks

[quote name=‘sculptingstudio’]Without an error, I can’t go any further.[/QUOTE]



just for information, i’m using also “SOFTplus GSiteCrawler”, and them google sitemap works perfect!



You can see example:

[quote name=‘dominos_2004’]just for information, i’m using also “SOFTplus GSiteCrawler” (http://gsitecrawler.com/), and them google sitemap works perfect!



You can see example:



[url]http://www.indymart.net/sitemap.xml[/url][/QUOTE]Mine works perfect also and it is totally automated:



[url]High Speed Carvers, Burs, Sculpting Clays, Fa-Brick, Eggs

[quote name=‘sculptingstudio’]Mine works perfect also and it is totally automated:



[url]High Speed Carvers, Burs, Sculpting Clays, Fa-Brick, Eggs



Yes you are right but small different my urls all html files not php

Hi, great idea, I have been working on my site www.tapetechtools.com and love the cs-cart software. I set up everything and got this:



[quote name=‘flasher’]Hi, great idea, I have been working on my site www.tapetechtools.com and love the cs-cart software. This is a small part of the file produced. Is this the correct way? and or how does google read a product from this.[/QUOTE]Yes, your last tag shoudl be and the text should be UTF-8 encoded. You have to submit your feed to google and based on the setting, this will determine the approximate time google will read your feed again.

[quote name=‘dominos_2004’]just for information, i’m using also “SOFTplus GSiteCrawler”, and them google sitemap works perfect!



You can see example:



http://www.indymart.net[/QUOTE]









thanks for posting that site. i am using it now and its done. i have been playing with google for ever and couldnt get anything loaded up there. it took 10 minutes and VOILA!!



thanks a million!!

i have try to install google sitemap and i have the same error. i think this is in the code in box 3. I explain , when i put the code , i see that the php tags are closed bedore the end of the file :```php
//=======================================================================

// File: GOOGLE_SITEMAP.PHP

// Description: Google Sitemap Generator.

// Created: 2006-10-12

// Ver: $Id: google_sitemap.php 2 2006-10-12 00:0:00Z lsb $

//

// Copyright 2006 (c) RENS Management, LLC. All rights reserved.

//========================================================================



if ( !defined(‘IN_CSCART’) ) { die(‘Access denied’); }



$products=$categories=array();

$categories_all=db_get_array(“SELECT category_id FROM $db_tables[categories] WHERE membership_id=0 && avail=‘Y’”);

$products_all=db_get_array(“SELECT product_id FROM $db_tables[products] WHERE avail=‘Y’”);

while (list(, $cats) = each($categories_all)) $categories[]=$cats[‘category_id’];

while (list(, $items) = each($products_all)) $products[]=$items[‘product_id’];



header(“Content-Type: text/xml;charset=utf-8”);

$lastmod = date(“Y-m-d”, time());

$siteurl = utf8_encode(htmlentities(“$http_location”));

echo <<

[/COLOR]





$siteurl

```

so the end of the code doesn’t work, i try to change but i don’t find the good solution, if someone have an idea.

thanks.

[quote name=‘Alto’]i see that the php tags are closed bedore the end of the file.[/quote]Voulez-vous dire la pièce j’avoir accentué dans le rouge ?

```php echo <<

[/color] ```Ce n'est pas une étiquette de fermeture parce qu'il est contenu dans une corde. J'ai attaché le code dans un dossier de fermeture éclair.

google_sitemap.zip

has anyone implemented this in .4?



=)

[quote name=‘mpjbay’]has anyone implemented this in .4?



=)[/QUOTE]



Yes,

www.southeastauto.com.au/index.php?target=google_sitemap



although it doesn’t keep the appropriate formatting, and also requires the header from include/admin (line 19) to be removed prior to being displayed.

Buggy at best on 1.3.4 SP1 but google seems to like it so far



============GOOGLE ANAYLTICS=======================

Sitemap Type Submitted Last Downloaded Sitemap Status URLs submitted

index.php?target=google_sitemap Sitemap Web 20 hours ago 20 hours ago OK 76



============GOOGLE ANAYLTICS=======================

One thing I should mention is that MAKE SURE it’s in UTF-8,



notepad will let you choose between CTF-8, ANSI and UNICODE.

Save it as UTF-8!

I use google sitemap on my cs-cart 1.3.4, and it run perfectly, but i have activate the seo module and i would like to know if it is possible to have the link in google sitemap like the name of the page rewriting ?

To have [url]xxxxxx.com - xxx sex videos free hd porn Resources and Information. instead [url]xxxxxx.com - xxx sex videos free hd porn Resources and Information.

what exactly does a site map do?

[quote name=‘Alto’]I use google sitemap on my cs-cart 1.3.4, and it run perfectly, but i have activate the seo module and i would like to know if it is possible to have the link in google sitemap like the name of the page rewriting ?

To have [url]xxxxxx.com - xxx sex videos free hd porn Resources and Information. instead [url]xxxxxx.com - xxx sex videos free hd porn Resources and Information.



This would be cool, I’d like that aswell.

[quote name=‘mpjbay’]what exactly does a site map do?[/QUOTE]



When google analytics is used www.google.com/analytics/

It allows the ‘googlebot’ / bot to see the updated pages and will usually index pages based on the changes. Makes things more efficient.



This thread explains how to make an automatic one however xenu’s Link sleuth is a rather good product itself



Before

site.com/index.php

site.com/product123.php



After.

site.com/index.php

site.com/product123.php

site.com/products234.php

ah. thanks =)

I’m trying to get this to work, however I also get a blank page and it doesn’t seem to run the code for some reason.



The CS-Cart and apache errorlogs give no information.



Has anyone found this bug?



It wont even execute any output with “echo ‘foo’;” …



The admin.php?target=google_sitemap outputs correctly, however not index.php.





--------



Edit: Well this is strange, now it works. I will start working to see if I can get the urls in SEO version.

Ladies and gentlemen of the SEO crowd. Let me present to you the 2 line fix in order to get SEO urls in sitemaps. :smiley:



Thank god it was a simple fix! Here is the full google_sitemap.php code, replace it with your old:

```php

//=======================================================================
// File: GOOGLE_SITEMAP.PHP
// Description: Google Sitemap Generator.
// Created: 2006-10-12
// Ver: $Id: google_sitemap.php 2 2006-10-12 00:0:00Z lsb $
//
// Copyright 2006 (c) RENS Management, LLC. All rights reserved.
//========================================================================

if ( !defined('IN_CSCART') ) { die('Access denied'); }

$products=$categories=array();
$categories_all=db_get_array("SELECT category_id FROM $db_tables[categories] WHERE membership_id=0 && avail='Y'");
$products_all=db_get_array("SELECT product_id FROM $db_tables[products] WHERE avail='Y'");
while (list(, $cats) = each($categories_all)) $categories[]=$cats['category_id'];
while (list(, $items) = each($products_all)) $products[]=$items['product_id'];

header("Content-Type: text/xml;charset=utf-8");
$lastmod = date("Y-m-d", time());
$siteurl = utf8_encode(htmlentities("$http_location"));
echo <<





$siteurl

$lastmod

daily

1.0

\n

START;



// process categories

foreach ($categories as $category) {

$link = utf8_encode(htmlentities(“$http_location/$index_script?$target_name=categories&category_id=$category”));

fn_convert_php_urls($link);

echo <<


$link

$lastmod

daily

0.5

\n

LINKS;

}



// process products

foreach ($products as $product) {

$link = utf8_encode(htmlentities(“$http_location/$index_script?$target_name=products&product_id=$product”));

fn_convert_php_urls($link);

echo <<


$link

$lastmod

daily

0.5

\n

LINKS;

}



echo <<




END;

exit;

?>

```



The only thing I had to change was adding “fn_convert_php_urls($link);” at two locations.



Make sure you are running latest 1.3.4-SP2 and have SEO turned on, then try your output at index.php?target=google_sitemap to see if it rewrites the urls.



If you do not use SEO, do not run this code because I have made no checking if SEO is enabled or not.



Enjoy!

For those of you who wish to include manufacturer pages in your sitemap XML file with SEO urls I made some radical changes.



Edit: addons/seo/func.php



Find: “//Convert topics links”



Below this function you need to create a new function:

```php

//Convert manufacturer links

} elseif ($res[‘target’] == ‘manufacturers’ && !empty($res[‘manufacturer_id’])) {

$name = db_get_field(“SELECT manufacturer FROM $db_tables[manufacturer_descriptions] WHERE manufacturer_id=‘$res[manufacturer_id]’ AND lang_code=‘$cart_language’”);

$link = fn_generate_name($name, ‘m’, $res[‘manufacturer_id’]).‘.html’;

```



Then save your file. Next you need to edit your google_sitemap.php file again and replace all code with this:

```php

//=======================================================================
// File: GOOGLE_SITEMAP.PHP
// Description: Google Sitemap Generator.
// Created: 2006-10-12
// Ver: $Id: google_sitemap.php 2 2006-10-12 00:0:00Z lsb $
//
// SEO modifications by Zyles
//
// Copyright 2006 (c) RENS Management, LLC. All rights reserved.
//========================================================================

if ( !defined('IN_CSCART') ) { die('Access denied'); }

$products=$categories=array();
$categories_all=db_get_array("SELECT category_id FROM $db_tables[categories] WHERE membership_id=0 && avail='Y'");
$products_all=db_get_array("SELECT product_id FROM $db_tables[products] WHERE avail='Y'");
$manufacturers_all=db_get_array("SELECT manufacturer_id FROM $db_tables[manufacturers] WHERE avail='Y'");
while (list(, $cats) = each($categories_all)) $categories[]=$cats['category_id'];
while (list(, $items) = each($products_all)) $products[]=$items['product_id'];
while (list(, $manufacs) = each($manufacturers_all)) $manufacturers[]=$manufacs['manufacturer_id'];

header("Content-Type: text/xml;charset=utf-8");
$lastmod = date("Y-m-d", time());
$siteurl = utf8_encode(htmlentities("$http_location"));
echo <<





$siteurl

$lastmod

daily

1.0

\n

START;



// process categories

foreach ($categories as $category) {

$link = utf8_encode(htmlentities(“$http_location/$index_script?$target_name=categories&category_id=$category”));

fn_convert_php_urls($link);

echo <<


$link

$lastmod

daily

0.5

\n

LINKS;

}



// process products

foreach ($products as $product) {

$link = utf8_encode(htmlentities(“$http_location/$index_script?$target_name=products&product_id=$product”));

fn_convert_php_urls($link);

echo <<


$link

$lastmod

daily

0.5

\n

LINKS;

}



// process manufacturers

foreach ($manufacturers as $manufacturer) {

$link = utf8_encode(htmlentities(“$http_location/$index_script?$target_name=manufacturers&manufacturer_id=$manufacturer”));

fn_convert_php_urls($link);

echo <<


$link

$lastmod

daily

0.5

\n

LINKS;

}



echo <<




END;

exit;

?>

```



After this is done, check our sitemap out and look at the bottom. If all is well, you should see your manufacturer pages with rewritten urls.



Enjoy!