Файл: core/modules/rss.php
Строк: 82
<?php
if (!defined('CMS')) { die('Access Denied!'); }
error_reporting(0);
$rss_date = date('r', time());
$rss_content = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>{$config['rss_title']}</title>
<link>{$config['site_url']}/</link>
<language>ru</language>
<description>{$config['rss_title']}</description>
<generator>{$config['site_name']}</generator>
XML;
if ( !$config['allow_rss'] ) {
$rss_content .= <<<XML
<item>
<title>RSS новости выключены</title>
<guid isPermaLink="true"></guid>
<link></link>
<description>RSS лента новостей выключена</description>
<category>undefined</category>
<dc:creator>{$config['site_name']}</dc:creator>
<pubDate>{$rss_date}</pubDate>
</item>
XML;
} else {
$onpage = !empty($config['rss_num']) ? (int) $config['rss_num'] : 25;
$rows = array();
$rows = $db->select("SELECT `p`.*, `c`.`cats_name`
FROM ?_blog_posts `p` LEFT JOIN ?_blog_category `c`
ON `p`.`blog_cats_id` = `c`.`cats_id`
WHERE `p`.`blog_moders` <> '1'
ORDER BY `p`.`blog_time` DESC
LIMIT ?d, ?d", 0, $onpage);
if (!empty($rows)) {
foreach ($rows as $numRow => $row) {
$row['blog_text'] = smiles(bb_code($row['blog_text']));
$row['blog_text'] = strip_str(htmlspecialchars(strip_tags($row['blog_text'], '<img>')),50);
$rss_link = $config['site_url'] . '/blog/' . gen_uri('post', $row['blog_id'], RND);
$rss_date = date('r', $row['blog_time']);
$rss_content .= <<<XML
<item>
<title>{$row['blog_title']}</title>
<guid isPermaLink="true">{$rss_link}</guid>
<link>{$rss_link}</link>
<description>{$row['blog_text']}</description>
<category>{$row['cats_name']}</category>
<dc:creator>{$row['blog_user']}</dc:creator>
<pubDate>{$rss_date}</pubDate>
</item>
XML;
}
}
else {
$rss_content .= <<<XML
<item>
<title>RSS новости не найдены</title>
<guid isPermaLink="true"></guid>
<link>{$config['site_url']}</link>
<description>RSS новости не найдены</description>
<category>undefined</category>
<dc:creator>{$config['site_name']}</dc:creator>
<pubDate>{$rss_date}</pubDate>
</item>
XML;
}
}
$rss_content .= <<<XML
</channel></rss>
XML;
header( 'Content-type: application/xml' );
echo $rss_content;
exit;
?>