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.
It's indeed getting complicated. I can see the announement forum now, but your last query didn't work out the way I was expecting it. Instead of showing a clean list of latest threads, it shows thread titles multiple times when there have been multiple recent replies into one thread.
It looks like your last query gives a list of thread titles based on the post dates, instead of based on the last post date of a thread. So if there are 10 new posts in only 1 thread, the thread title will show up 10 times
How do I get the rss file to be displayed on a website?
Is it possible only show certain forums? I have a few news forums that would be cool to have a seperate rss file. One for my forums and one for my news. Could you guys create something like that for me? Please.
How do I get the rss file to be displayed on a website?
Is it possible only show certain forums? I have a few news forums that would be cool to have a seperate rss file. One for my forums and one for my news. Could you guys create something like that for me? Please.
How exactly do I install the hack.. I installed the plugin for trillian pro, and had it point to feed.php? But nothing happens. I have feed.php in my forums dir.