<?
require_once ('Settings.php');
mysql_connect($db_server,$db_user,$db_passwd);
mysql_select_db($db_name);
$query = mysql_query("SELECT t.ID_TOPIC, m.posterTime, m.modifiedTime FROM smf_topics AS t, smf_boards AS b, smf_messages AS m WHERE t.ID_BOARD=b.ID_BOARD AND t.ID_LAST_MSG=m.ID_MSG AND b.ID_BOARD NOT IN (13,14,26,39)") or die(mysql_error());
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<?
while($row = mysql_fetch_row($query)) {
	if (empty ($row[0])) continue;
	$ts = ($row[2] > $row[1]) ? date(DATE_W3C, $row[2]) : date(DATE_W3C, $row[1]);
?>
  <url>
    <loc>http://rock.ru/forum/index.php?topic=<?=$row[0]?></loc>
    <lastmod><?=$ts?></lastmod>
    <changefreq>hourly</changefreq>
</url>
<?
}
?>
</urlset>
