<?
error_reporting(E_ALL);
ini_set('display_errors', 0);
$mainpath=dirname(__FILE__);
include("./cfg/prop.php");
include("./cfg/lib.php");

echo("<?xml version=\"1.0\" encoding=\"WINDOWS-1251\"?>\r\n");
echo("<rss version=\"2.0\">\r\n");
echo("<channel>\r\n");
echo("<description>".prop_sel("slogansite","0")."</description>\r\n");
echo("<title>".prop_sel("namesite","0")."</title>\r\n");
echo("<generator>http://".$prop[rsait]."</generator>\r\n");
echo("<link>http://".$prop[rsait]."</link>\r\n");


$mass_post=get_arr_post(0,10,time());
reset($mass_post);
while (list($key, $val) = each($mass_post))
{
	$v_id=$val;
	$title = htmlspecialchars(get_title_post($val));
	$teg=get_teg_post($val);
	$descr =stripslashes(get_post_post($val)."<br /><a href=\"http://".$prop[rsait]."/".$prop['fpost'].$v_id."/\" title=\"".$title."\">Подробнее...</a>");

	echo("<item>\r\n");
	echo("<title>".$title."</title>\r\n");
	echo("<description>".htmlspecialchars($descr)."</description>\r\n");
	echo("<link>http://".$prop[rsait]."/".$prop['fpost'].$v_id."/</link>\r\n");
	echo("<guid>http://".$prop[rsait]."/".$prop['fpost'].$v_id."/</guid>\r\n");
	echo("<pubDate>".date('D, d M Y H:i:00',get_tdf_post($val))." -0400</pubDate>\r\n");
	echo("<category>".$teg."</category>\r\n");
	echo("</item>\r\n");
}

echo("</channel>\r\n");
echo("</rss>\r\n");
?>
