<?php 
include("components/connect_db.php");
echo('<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<url>
		<loc>http://www.stend.su</loc>
		<changefreq>monthly</changefreq>
	</url>
	<url>
		<loc>http://www.stend.su/photos</loc>
		<changefreq>weekly</changefreq>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://www.stend.su/payment.html</loc>
		<changefreq>yearly</changefreq>
		<priority>0.3</priority>
	</url>
	<url>
		<loc>http://www.stend.su/contact.html</loc>
		<changefreq>monthly</changefreq>
		<priority>0.3</priority>
	</url>
	<url>
		<loc>http://www.stend.su/production</loc>
		<changefreq>monthly</changefreq>
		<priority>0.8</priority>
	</url>
	<url>
		<loc>http://www.stend.su/news</loc>
		<changefreq>weekly</changefreq>
		<priority>0.3</priority>
	</url>
	<url>
		<loc>http://www.stend.su/articles</loc>
		<changefreq>monthly</changefreq>
	</url>');
	$result=mysql_query("SELECT * FROM article where public=1 order by sort, id DESC");
	while ($line = (mysql_fetch_array($result))){
	echo('
	<url>
		<loc>http://www.stend.su/articles/'.$line["article_url"].'.html</loc>
		<changefreq>yearly</changefreq>
	</url>
	');
	}
	$result=mysql_query("SELECT * FROM section where public=1 order by sort, id DESC");
	while ($line = (mysql_fetch_array($result))){
	echo('
	<url>
		<loc>http://www.stend.su/production/'.$line["section_url"].'</loc>
		<changefreq>monthly</changefreq>
	</url>
	');
	$result2=mysql_query("SELECT * FROM subsection where public=1 and section_id='".$line['id']."' order by sort, id DESC");
	while ($line2 = (mysql_fetch_array($result2))){
	echo('
	<url>
		<loc>http://www.stend.su/production/'.$line["section_url"].'/'.$line2["subsection_url"].'.html</loc>
		<changefreq>monthly</changefreq>
	</url>
	');
	}
	}
	echo('
</urlset>
');
?>