<? 
include("phpinc/connect.php");
include("varrus.php");

$_res=mysql_query("select `id_razd` from razds where `pub` >0");  
    if ($_res) 
    {   while($_row=mysql_fetch_array($_res))
        {   
            $_id_razd=$_row['id_razd'];
            
   $razd.="
   <url>
      <loc>".$urlsite."?id_razd=$_id_razd</loc>
      <lastmod>".date("Y-m-d")."</lastmod>
      <changefreq>weekly</changefreq>
    </url>";
            

        }
    } 
$_res=mysql_query("select `id_new` from news");  
    if ($_res) 
    {   while($_row=mysql_fetch_array($_res))
        {   
            $_id_razd=$_row['id_new'];
            
   $razd.="
   <url>
      <loc>".$urlsite."show_new.php?id_new=$_id_razd</loc>
      <lastmod>".date("Y-m-d")."</lastmod>
      <changefreq>weekly</changefreq>
    </url>";
            

        }
    } 	
$razd.="
   <url>
      <loc>".$urlsite."map.php/</loc>
      <lastmod>".date("Y-m-d")."</lastmod>
      <changefreq>weekly</changefreq>
   </url>
 <url>
      <loc>".$urlsite."remote.php/</loc>
      <lastmod>".date("Y-m-d")."</lastmod>
      <changefreq>weekly</changefreq>
   </url>   
   ";
header("Content-type: text/xml; charset=UTF-8");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo '
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
echo $razd ;
echo '
</urlset>'; ?>