<?
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); // always modified
header( "Cache-Control: no-store, no-cache, must-revalidate" );
header( "Cache-Control: post-check=0, pre-check=0", false );
header( "Pragma: no-cache" );
include("./cfg/connect.inc.php");
include("./includes/database/".DBMS.".php");
include("./core_functions/category_functions.php");
include("./core_functions/product_functions.php");
include("./core_functions/picture_functions.php");
include("./core_functions/configurator_functions.php");
include("./core_functions/datetime_functions.php");
include("./core_functions/tax_function.php");
include("./core_functions/setting_functions.php" );
include( "./core_functions/functions.php" );
//authorized access check
session_start();
@set_time_limit(0);
MagicQuotesRuntimeSetting();
//connect 2 database
db_connect(DB_HOST,DB_USER,DB_PASS) or die (db_error());
db_select_db(DB_NAME) or die (db_error());
echo ('<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">');
echo "<!-- Debug: Start events -->";
$q = db_query("SELECT productID,name,brief_description,Price,categoryID FROM ".PRODUCTS_TABLE." WHERE enabled=1" ) or die (db_error());
while($row=db_fetch_row($q))
{
echo ("<url>
<loc>http://site.ru/index.php?productID=".$row['0']."</loc>
<lastmod>".date("Y-m-d")."</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>\n");
}
echo "\n<!-- Debug: End events -->";
echo "<!-- Debug: Start category -->";
$q = db_query("SELECT categoryID FROM ".CATEGORIES_TABLE." WHERE categoryID!=1" ) or die (db_error());
while($row=db_fetch_row($q))
{
echo ("<url>
<loc>http://site.ru/index.php?categoryID=".$row['0']."</loc>
<lastmod>".date("Y-m-d")."</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
</url>\n");
}
echo "\n<!-- Debug: End category -->";
echo "\n</urlset>";
?>