Размер файла: 1.55Kb
<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: RSS Новости
=============================================
Official website: http://shcms.ru
=============================================
*/
define('SHCMS', true);
include_once '../system/inc/system_core.php';
header("Content-type: application/rss+xml");
echo <<<XML
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>RSS Новости от сайта {$_SERVER['HTTP_HOST']}</title>
<link>http://{$_SERVER['HTTP_HOST']}</link>
<description>Новости SHCMS Engine</description>
<language>ru-RU</language>
<generator>SHCMS Engine</generator>
XML;
$allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM uncos"),0);
$newlist = new Navigation($allfield, 10, true);
$news1 = mysql_query("SELECT * FROM `uncos` ORDER BY `id` DESC ". $newlist->limit());
while ($news = mysql_fetch_assoc($news1)) {
$news_users = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$news[user_id]'"));
echo '<item>' .
'<title>' . $news['title'] . '</title>' .
'<author>' . $news_users['login'] . '</author>' .
'<description>' . processing($news['text']) . '</description>' .
'<pubDate>' . date('r', $news['time']) .
'</pubDate>' .
'</item>';
}
echo '<div class="pages">';
echo $newlist->pagination();
echo '</div>';
echo "</channel>\n";
echo "</rss>\n";
?>