| Code:
|
<?php
include("mainfile.php");
global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<rss version=\"0.91\">";
echo "<channel>";
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";
$count = 1;
$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 15", $dbi);
while(list($topic_id, $topic_last_post_id, $topic_title) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);
echo "<item>\n";
echo "<title>".htmlspecialchars($topic_title)."</title>\n";
echo "<link>$nukeurl/modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id</link>\n";
echo "<guid>$nukeurl/modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id</guid>\n";
echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
?>
?>
|