FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Displaying a forum outside of the forum software
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Displaying a forum outside of the forum software [message #39152 is a reply to message #36000] Wed, 03 October 2007 21:15 Go to previous message
pgregg is currently offline  pgregg   United Kingdom
Messages: 14
Registered: July 2006
Karma:
Junior Member
I do (well doing... forum isn't live yet) this via a RSS feed and MagpieRSS http://magpierss.sourceforge.net/

include '/web/common/magpierss-0.72/rss_fetch.inc';
define('MAGPIE_CACHE_DIR', '/web/domain.com/production/attachments/cache');
$rss = fetch_rss('http://www.domain.com/community/rdf.php?mode=m&l=1&basic=1');
$discussions_seen = array();
$discussions_displayed = 0;
foreach ($rss->items as $idx => $item) {
  if ($discussions_displayed == 5) break;
  $tmp_title = $item['title'];
  $tmp_link = $item['link'];
  if (strpos($tmp_title, 'Re: ')===0) $tmp_title=substr($tmp_title, 4); // strip the Re:
  if (isset($discussions_seen[$tmp_title])) continue; // only show the latest post in a thread
  $discussions_seen[$tmp_title] = true;
  printf("<p class='bodytext'><a href='%s'><img src='/images/version2_dec03/arrow.gif' border='0' alt=''><font color='$gray'>%s</font></a><br></p>\n",
    $tmp_link, $tmp_title);
  $discussions_displayed++;
}
unset($discussions_seen, $discussions_displayed, $rss, $idx, $item, $tmp_title, $tmp_link);


Obviously this is trivially easy to change to any forum/category - just change the RSS url.

Hope this helps,
PG

[Updated on: Wed, 03 October 2007 21:24]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Compact view of "Unread Messages"
Next Topic: Hack for FUD 2.3.7 - Import Users from a CSV File
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat May 18 10:04:30 GMT 2024

Total time taken to generate the page: 0.04259 seconds