1
script_fu
Rss backendforums.php (Great Idea) Will newbb be able to handel it?

Found this lil tidbit over at e-xoops and nuke cops. Will newbb be able to handel this puppy?


_____________________________________________________

<?php

/************************************************************************/
/* RSS Feed for PHP-Nuke phpBB2 Forums */
/* =================================== */
/* */
/* Copyright (c) 2003 by Paul Laudanski (Zhen-Xjell) */
/*http://nukecops.com */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* See a copy of the GPL licensed attached in the archive. */
/************************************************************************/

include("mainfile.php");

header("Content-Type: text/xml");
$result = sql_query("SELECT t.topic_id, t.topic_title FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 10", $dbi);

if (!result) {
echo "An error occured";
} else {
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
echo " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
echo "<rss version=\"0.91\">\n\n";
echo "<channel>\n";
echo "<title>".htmlspecialchars($sitename)."- Forums</title>\n";
echo "<link>$nukeurl</link>\n";
echo "<description>".htmlspecialchars($backend_title)."</description>\n";
echo "<language>$backend_language</language>\n\n";
for ($m=0; $m < sql_num_rows($result, $dbi); $m++) {
list($topic_id, $topic_title) = sql_fetch_row($result, $dbi);
echo "<item>\n";
echo "<title>".htmlspecialchars($topic_title)."</title>\n";
echo "<link>$nukeurl/postt$topic_id.html</link>\n";
echo "</item>\n\n";
}
echo "</channel>\n";
echo "</rss>";
}

?>
_____________________________________________________


http://nukecops.com/forums.html

This is smokin...

2
Bazus
Re: Rss backendforums.php (Great Idea) Will newbb be able to handel it?
  • 2004/1/5 4:10

  • Bazus

  • Not too shy to talk

  • Posts: 144

  • Since: 2002/9/23


what does this do ? what's the idea

3
script_fu
Re: Rss backendforums.php (Great Idea) Will newbb be able to handel it?

This code will take your forum posts and feed them to other sites just like a rss news feed to other sites.

4
script_fu
Re: Rss backendforums.php (Great Idea) Will newbb be able to handel it?

I been emailing back and fourth with the guy who hacked the code above which btw is bundled in the nukecops package.
http://snaps.nukecops.com/

I found this download on e-xoops.com and wondered why XOOPS doesn't offer this. The problem is the file put up for download over at e-xoops must have been mixed up with the nukecops file. So im hopeing the guy who made a mod on the code above will show up here and post the hack!

5
micaheli
Re: Rss backendforums.php (Great Idea) Will newbb be able to handel it?
  • 2004/1/6 3:01

  • micaheli

  • Just popping in

  • Posts: 1

  • Since: 2004/1/6 2


Here's my rss.php that I created and am using.

Basically, its an atonomous rss file. Should work with newbb, newbb_plus (currently the default) and phpBB with a little tweaking.

It doesn't have a config file or anything and requires a little coding unless you have newbb_plus, but it works rather well and is simple.

Check it out at this url: (rssid is the forum id)
http://www.aquariaphile.com/rss.php?rssid=1

Here's the code:

<?php
include("mainfile.php");
$rssid = $_GET['rssid'];
$prefix = $xoopsConfig['prefix'];
header("Content-Type: text/xml");
echo "
<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">
<channel><title>";
$forumresult = mysql_query("SELECT forum_name,forum_desc FROM ".$prefix."_bbplus_forums where forum_id=$rssid");
while($row = mysql_fetch_array($forumresult)) {
echo $row["forum_name"]." - ".$row["forum_desc"];
}
echo "</title><link>http://".$_SERVER['SERVER_NAME']."/modules/newbb_plus/viewforum.php?forum=".$rssid."</link>
<description>".$meta['description']."</description>
<language>en-us</language>
";

$result = mysql_query("SELECT topic_id,subject,post_text,type,post_time FROM ".$prefix."_bbplus_posts where forum_id=$rssid ORDER BY post_time DESC LIMIT 30");
while($row = mysql_fetch_array($result)) {
$realtime = formatTimestamp($row["post_time"], "m");
echo "
<item>
<title>".$row["subject"]."</title>
<link>http://".$_SERVER['SERVER_NAME']."/modules/newbb_plus/viewtopic.php?topic_id=".$row["topic_id"]."&forum=".$rssid."</link>
<description>".$row["post_text"]."</description>
<dc:creator>".$row["type"]."</dc:creator>
<dc:date>$realtime</dc:date>
</item>";
}
echo "
</channel>
</rss>
";
?>

6
script_fu
Re: Rss backendforums.php (Great Idea) Will newbb be able to handel it?

Micaheli thank you for your time and posting the code above. Now to get this working with XOOPS 2...

(okay)
I converted all the new_bb refrences in micaheli post above but have not been able to get this code working yet on 2.0.5.x ????

I did get newbb_plus installed on my e-xoops site. Then set up micaheli's code and it works fine. I have a feed going from my e-xoops site to one of my XOOPS sites. Would anyone care to take a shot at this? Im missing something.

Newbb_plus is one cool module that should be ported over to XOOPS 2. You can use phpbb themes infact the newbb_plus when installed has two themes with it. (very sweet)


7
soconfused
Re: Rss backendforums.php (Great Idea) Will newbb be able to handel it?
  • 2005/7/19 18:35

  • soconfused

  • Not too shy to talk

  • Posts: 108

  • Since: 2005/4/2 1


Hello

I'm trying to get this to work with the pbboard but I just get 'feed contains no items' when accessed through rss reader. Any ideas?

<?php
include("mainfile.php");
$rssid = $_GET['rssid'];
$prefix = $xoopsConfig['prefix'];
header("Content-Type: text/xml");
echo "
<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">
<channel><title>";
$forumresult = mysql_query("SELECT forum_name,forum_desc FROM ".$prefix."_xpbb_forums where

forum_id=$rssid");
while($row = mysql_fetch_array($forumresult)) {
echo $row["forum_name"]." - ".$row["forum_desc"];
}
echo

"</title><link>http://".$_SERVER['SERVER_NAME']."/modules/pbboard/viewforum.php?forum=".$rssid.

"</link>
<description>".$meta['description']."</description>
<language>en-us</language>
";

$result = mysql_query("SELECT topic_id,subject,post_text,type,post_time FROM

".$prefix."_xpbb_posts where forum_id=$rssid ORDER BY post_time DESC LIMIT 30");
while($row = mysql_fetch_array($result)) {
$realtime = formatTimestamp($row["post_time"], "m");
echo "
<item>
<title>".$row["subject"]."</title>
<link>http://".$_SERVER['SERVER_NAME']."/modules/pbboard/viewtopic.php?topic_id=".$row["topic_i

d"]."&forum=".$rssid."</link>
<description>".$row["post_text"]."</description>
<dc:creator>".$row["type"]."</dc:creator>
<dc:date>$realtime</dc:date>
</item>";
}
echo "
</channel>
</rss>
";
?>

Login

Who's Online

168 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 168


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits