Contributions

Features (Category Index)
Search: 

New Google Sitemap Generator

Not sure if these are allowed on here (Chemo made them!) but attached are two php files that generate xml files on the fly. Create a Google Sitemaps account and Google will crawl the page regularly without the need for Cron jobs or any file tweaks. This also works with Chemo's SEO contribution.

No work at all done by myself; all credit to Chemo.

Support thread: http://forums.oscommerce.com/index.php?showtopic=282968

Again all thanks to Chemo.

Expand All / Collapse All

update 18 Dec 2008

added one for reviews.

not the best coder though

basically added a new query and edit the loop

$sql2 = "SELECT products_id as pID,
products_id as products_id
FROM " . TABLE_REVIEWS . "";

/*
* Execute the query
*/
$query = tep_db_query($sql);
$query2 = tep_db_query($sql2);

/*
* If there are returned rows...
* Basic sanity check
*/
if ( tep_db_num_rows($query) > 0 ){

/*
* Initialize the variable containers
*/
$container = array();
$number = 0;
$top = 0;

/*
* Loop the query result set
*/
while( $result = tep_db_fetch_array($query)){
$pID = tep_db_fetch_array($query2);
$top = max($top, $pID['products_id'], $result['date_added']);
$location = tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $pID['pID'] . '&'. 'reviews_id=' . $result['rID'], 'NONSSL', false);
if ( tep_not_null($result['last_mod']) ){
$lastmod = $result['last_mod'];
} else {
$lastmod = $result['date_added'];
}
$changefreq = 'weekly';
$ratio = ($top > 0) ? ($result['date_added']/$top) : 0;
$priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', '');

/*
* Initialize the content container array
*/
$container = array('loc' => htmlspecialchars(utf8_encode($location)),
'lastmod' => date ("Y-m-d", strtotime($lastmod)),
'changefreq' => $changefreq,
'priority' => $priority
);


THANKS to who created this and the others!

Fix for minor errors 1 Dec 2008
(Added Parent categories XML) 10 Nov 2008
NGS 1.2 (Added Manufacturers XML) 22 Sep 2008
NGS XML 1.1 (Changed new xml header) 21 Feb 2008
New Google Sitemap Generator 11 Nov 2007

Note: Contributions are used at own risk.