<?PHP
require_once("mainfile.php");
header('Content-type: application/xml; charset="utf-8"',true);
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<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\">
<url><loc>https://www.vistalis.bg/</loc><lastmod>2012-11-05T00:00:00+00:00</lastmod><changefreq>daily</changefreq><priority>1.00</priority></url>\n";

	$db->sql_query('SET NAMES utf8');
 $result = $db->sql_query("select * from ".$prefix."_sitemaper order by id DESC");
			while ($row = $db->sql_fetchrow($result)) {
				$extitle = $row['textual'];
				if($row['addtime'] == ""){$now=time();}else{$now=$row['addtime'];}
				$date = date('Y-m-d\TH:i:s',$now)."+00:00"; //1899-12-30T00:00:00+00:00
				echo "<url><loc>https://www.vistalis.bg/".$extitle."/</loc><lastmod>$date</lastmod><changefreq>daily</changefreq><priority>0.50</priority></url>\n";
			}

echo "</urlset>";
?>
