<?
header ("Content-Type: text/xml; charset=utf-8"); 
include 'config.php';
$hostname 				= DBHOST;
$username 				= DBUSER;
$password 				= DBPASSWORD;
$dbName 				= DBNAME;
mysql_connect($hostname,$username,$password) OR DIE("Не могу создать соединение ");
mysql_select_db($dbName) or die(mysql_error());
mysql_query('set names utf8');
$cfg_url = 'www.ec-light.ru';

echo"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";


echo"
<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n";




$page = "SELECT *  FROM `v_data` WHERE `enabled` = 1 AND `show_in_map` = 1";
$res_page = mysql_query($page) or die(mysql_error());

while ($row_tovar  = mysql_fetch_assoc($res_page)) {
$url = 'http://' . $cfg_url . '' . lnk($row_tovar['id']);

echo"\n<url>\n";
	echo"<loc>$url</loc>\n";
	echo"<changefreq>always</changefreq>\n";
	echo"<priority>1.0</priority>\n";
echo"</url>\n";

}
echo"</urlset>";

?>