Файл: rss/rss.php
Строк: 57
<?
include_once '../inc/bd.php';
include_once '../inc/fun.php';
header('content-type: application/rss+xml');
echo '<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:atom="http://www.w3.org/2005/Atom"
>';
#########
echo '<channel>
<title>'.$title.'</title>
<atom:link href="'.$home.'/rss/rss.php" rel="self" type="application/rss+xml" />
<link>'.$home.'</link>
<description>'.$description.'</description>
<generator>'.$home.'</generator>
<language>ru</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>';
#########
$sql = mysql_query('SELECT * FROM `text` where `checked`=`1` ORDER BY `id` DESC LIMIT 50;');
if (mysql_num_rows($sql) > 0)
{
while ($row = mysql_fetch_assoc($sql))
{
$id = num($row['id']);
$name = html($row['name']);
$text = html($row['text']);
echo '<item>
<title>'.$name.'</title>
<link>'.$home.'/blog.php/?id='.$id.'</link>
<description>'.$text.'</description>
<author>'.$adminlogin.'</author>
<pubDate>'.$row['date'].'</pubDate>
</item>';
}
}
echo '</channel></rss>';
?>