Файл: pages/rewrite_RSS.php
Строк: 92
<?php # Created by Up
error_reporting(0);
include_once '../sistem/config.php';
include_once '../sistem/db.php';
header("Content-type: application/rss+xml; charset=utf-8");
print '<?xml version="1.0" encoding="utf-8" ?>'."rn";
print '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">'."rn".' <channel>'."rn";
print ' <title>Новости '.$config['name'].'</title>'."rn";
print ' <link>'.$config['home'].'</link>'."rn";
print ' <description>'.$config['name'].' - RSS Новости</description>'."rn";
print ' <image>'."rn".' <url>'.$config['home'].'/images/project.gif</url>'."rn";
print ' <title>Новости '.$config['name'].'</title>'."rn";
print ' <link>'.$config['home'].'</link>'."rn".' </image>'."rn";
print ' <language>ru</language>'."rn";
print ' <copyright>Created by Up</copyright>'."rn";
print ' <managingEditor>'.str_replace('@','#'.ord('@').';',$config['mail']).'</managingEditor>'."rn";
print ' <webMaster>'.str_replace('@','#'.ord('@').';',$config['mail']).'</webMaster>'."rn";
print ' <lastBuildDate>'.date('r',time()).'</lastBuildDate>'."rnrn";
$sql=mysql_query('SELECT * FROM `news` ORDER BY `id` DESC LIMIT 0,10;');
while($arr=mysql_fetch_assoc($sql))
{
print ' <item>'."rn".' <title>'.trim(preg_replace("/(".chr(208)."|".chr(209).")$/",'',mb_substr($arr['news'],0,25))).'...</title>'."rn";
print ' <description>'.$arr['news'].'</description>'."rn".' <author>Администрация</author>'."rn";
print ' <pubDate>'.date('r',$arr['time']).'</pubDate>'."rn".' <category>Новости</category>'."rn";
print ' </item>'."rnrn";
}
print ' </channel>'."rn".'</rss>';
exit;
?>