<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| RSS News
+----------------------------------------------------+
| PHP-Fusion SF Group
| Copyright © 2007 by SF
| http://www.rus-phpfusion.com/
+----------------------------------------------------*/
require_once "maincore.php";
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"".$locale['charset']."\"?>\n\n\n\n\n";
global $settings, $db_prefix;
$result = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC LIMIT 0, 10");
$numrows = dbrows($result);
echo "<rss version=\"2.0\">\n\n";
echo "<channel>\n";
echo "<title>".htmlspecialchars($settings['sitename']).". Новости</title>\n";
echo "<link>".$settings['siteurl']."</link>\n";
echo "<description>Новости</description>\n";
echo "<image>
        <title>".htmlspecialchars($settings['sitename'])."</title>
        <url>".$settings['sitebanner']."</url>
        <link>".$settings['siteurl']."</link>
    </image>";
echo "<language>ru-ru</language>\n\n";
for ($i=0;$i < $numrows;$i++)  {
$data = dbarray($result);
    if ($data['news_breaks'] == "y") { $data['news_news'] = nl2br($data['news_news']); }
    echo "<item>\n";
    echo "<title>".$data['news_subject']."</title>\n";
    echo "<link>".stripslashes(htmlspecialchars($settings['siteurl']."news.php?readmore=".$data['news_id']))."</link>\n";
    echo "<description>".stripslashes(htmlspecialchars($data['news_news']))."</description>\n";
    echo "<pubDate>".date("r",$data['news_datestamp'])."</pubDate>\n";
   echo "<guid>".stripslashes(htmlspecialchars($settings['siteurl']."news.php?readmore=".$data['news_id']))."</guid>\n";
    echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
?>