|
23.08.2011, 13:55
PHP код:
<?php
include("mainfile.php");
global $prefix, $db, $nukeurl;
header("Content-Type: application/xml");
// $db->sql_query("set names windows-1251");
$result = $db->sql_query("SELECT sid, title, hometext FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10");
// echo "<xml version=\"1.0\" encoding=\"windows-1251\">\n\n";
echo "<rss version=\"2.0\">\n\n";
echo "<channel>\n";
echo "<title>".htmlspecialchars($sitename)."</title>\n";
echo "<link>$nukeurl</link>\n";
echo "<description>".htmlspecialchars($backend_title)."</description>\n";
echo "<language>$backend_language</language>\n\n";
echo " <image>
<url>http://www.chelseateam.ru/images/banner.gif</url>
<title>".htmlspecialchars($sitename,ENT_QUOTES)."</title>
<link>".$nukeurl."/</link>
</image>";
while (list($rsid, $rtitle, $rtext) = $db->sql_fetchrow($result)) {
$rsid = intval($rsid);
echo "<item>\n";
echo "<title>".htmlspecialchars($rtitle)."</title>\n";
echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$rsid</link>\n";
echo "<description>".htmlspecialchars($rtext)."</description>\n";
echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
?>
|
|