изменённый GetSiteMap() для redButton

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
// Обновление 30.06.2009
function GetSiteMap(){
global $keys, $urls, $way;
$head='<?xml version="1.0" encoding="UTF-8"?>'."\n\t".'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
$shab='<url>'."\n\t".'<loc>[SITE]</loc>'."\n\t".'<lastmod>[DATE]</lastmod>'."\n\t".'<changefreq>monthly</changefreq>'."\n\t".'<priority>0.5</priority>'."\n\t".'</url>';
$bottom='</urlset> ';
//$date=date("Y\-m\-d"); // @inlanger 27.06.2009
function getNormalDate($num){if ($num<10){return "0".$num;}else{return $num;}} // @inlanger 27.06.2009
$le=sizeof($keys);
for ($m=0; $m<$le; $m++){
$tt=str_replace("[SITE]", $way.str_replace("&", "&amp;", $urls[$m][1]), $shab);
$date = date("Y").'-'.getNormalDate(mt_rand(1,date("m"))).'-'.getNormalDate(mt_rand(1,30)); // @inlanger 30.06.2009
$tt=str_replace("[DATE]", $date, $tt);
@$itog.=$tt;
}
$itog=$head.$itog.$bottom;
return $itog;
}