Quick google sitemap code for PT
<?php
require("includes/common.php");
require("includes/database.php");
require("includes/tapestry.php");
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">\n";
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` LIMIT 49999";
$date=date("Y-m-d");
if ($numRows = database_querySelect($sql,$rows))
{
$htaccessExists = file_exists(".htaccess");
foreach($rows as $product)
{
if ($htaccessExists)
{
$productHREF = $config_baseHREF."product/".str_replace(" ","-",$product["name"]).".html";
}
else
{
$productHREF = $config_baseHREF."product.php?q=".urlencode($product["name"]);
}
print "<url>\n<loc>".$productHREF."</loc>\n";
print "<lastmod>".$date."</lastmod>\n";
print "<changefreq>monthly</changefreq>\n";
print "<priority>0.8</priority>\n";
print "</url>\n";
}
print "</urlset>\n";
}
?>
It only lists the first 49999 products (google sets a maximium of 50000 URLS in one sitemap). If you want more then it should be possible to tweak the code to do multiple pages giving it a dynamic url.
Have fun
An example of output can be seen at (10 products)
http://now3k.co.uk/sitemap_example.php
no problem, feel free to include the script as a preliminary version in the distro if you want
Nice! Thanks for the contribution.
I've got sitemap support on the list to include in a later version...It should be reasonably straight forward to create a dynamic sitemap index per merchant; and have individual "virtual":
/merchant/merchant-name/sitemap.xml
..etc. documents generated on the fly...