<?php
header("Content-Type:text/xml; charset=UTF-8");
if ($site->rss_url == null OR $site->rss_url == ""){
	$r_url = 'http://'.$site->domain.'/';
} else {
	$r_url = 'http://'.$site->rss_url;
}
?>
<?xml version="1.0"?><rss version="2.0">
<channel>
<title><?=$site->rss_name?></title>
<link><?=$r_url?></link>
<description><?=$site->rss_desc?></description>
<?php
if ($site->module_rss_enable == 1){
$news = $db->Query("SELECT * FROM `news` WHERE `sid` = '".$site->id."' ORDER BY `nid` DESC LIMIT 25"); 
	while ($ns = mysqli_fetch_assoc($news)){
		echo '<item>';
			echo '<title>'.$ns["ntitle"].'</title>';
			echo '<link>'.$r_url.'news.lm?id='.$ns["nid"].'</link>';
			echo '<description>'.$ns["ntext"].'</description>';
			echo '<author>'.$site->rss_author.'</author>';
			echo '<pubDate>'.date("D, j M Y G:i:s",$ns["ntime"]).' GMT</pubDate>';
			echo '<guid>http://url.site/news.lm?id='.$ns["nid"].'</guid>';
		echo '</item>';
	}
}
echo '</channel></rss>';
?>