Version: , by Marshalus
Developer Last Online: Jul 2020
Version: Unknown
Rating:
Released: 10-29-2002
Last Update: Never
Installs: 0
No support by the author.
OK, I digging though the bowels of the site, and stumbled apon a RSS feed hack that will pull the most recent threads from a forum you specify, and deliver them up in RSS format.
What I want to do, instead of having to specify the forum, is just have it dish out the latest threads from all forums.
Here is what I have to work with:
Code:
<?php echo '<?xml version="1.0"?>'; ?>
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
"http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91">
<channel>
<?php
echo "<!--\n";
require("global.php");
echo "-->\n";
echo "<title>$bbtitle</title>\n";
echo "<link>$bburl</link>\n";
// set defaults
if (isset($perpage)==0 or $perpage==0) {
$perpage=$maxthreads;
}
$forumid = verifyid("forum",$forumid);
$foruminfo=$DB_site->query_first("SELECT title,description,active FROM forum WHERE forumid=$forumid");
$forumtitle=htmlspecialchars($foruminfo[title]);
if ($foruminfo[active]==0) {
echo "<item><title>Forum Not Active</title></item></channel></rss>";
exit;
}
$description=htmlspecialchars($foruminfo[description]);
$forumtitle=htmlspecialchars($foruminfo[title]);
$threads=$DB_site->query("SELECT threadid,title,lastpost,replycount,postusername FROM thread WHERE forumid=$forumid ORDER BY lastpost DESC LIMIT 0,$perpage");
while ($thread=$DB_site->fetch_array($threads)) {
$threadtitle=htmlspecialchars($thread[title]);
$threadid=$thread[threadid];
$notes=htmlspecialchars($thread[notes]);
$replies=$thread[replycount];
$firstposter=htmlspecialchars($thread[postusername]);
$lastreplydate=date($dateformat,$thread[lastpost]+($timeoffset*3600));
$lastreplytime=date($timeformat,$thread[lastpost]+($timeoffset*3600));
echo "<item>\n";
echo "<title>$threadtitle</title>\n";
echo "<link>". $bburl ."/showthread.php?threadid=$threadid</link>\n";
echo "<description> $firstposter - $replies - $lastreplytime </description>\n";
echo "</item>\n";
}
?>
</channel>
</rss>
This would be very useful for programs like Trillian that can pull RSS news feeds, or for syndicating your latest threads on other websites.
Any help would be appreciated.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.