MyBB Community Forums

Full Version: RSS feed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can i use RSS feed to fetch the forum contents into my intranet ?

1. I want the feed to appear on a html page
2. RSS feed to html is possible only if my forum is hosted public and not internal, so it is this part that makes it difficult for me.

Pls advise
(2010-09-28, 03:57 AM)jason220273 Wrote: [ -> ]RSS feed to html is possible only if my forum is hosted public and not internal, so it is this part that makes it difficult for me.

This isn't strictly true. As long as the RSS feed is accessible internally it should work fine - depending on what you're using for converting it to HTML?

MyBB includes an XML -> PHP class, which can then be used to output to HTML. An example of this is when you do a version check in the ACP - it brings up the latest news from the Blog. Have a look through the coding, and in particular, the functions in class_feedparser.php.
Can you kindly show me How-to ?
Appreciate

require_once MYBB_ROOT."inc/class_feedparser.php";
$feed_parser = new FeedParser();
$feed_parser->parse_feed("<link to your feed>");

$feed_parser->items will then contain a list of items from the feed. You just need to loop through these like any other normal PHP foreach loop, formatting as you want and adding templates together.

$items = '';
foreach($feed_parser->items as $item)
{
	// Format the items' contents

	eval("\$items. = \"".$templates->get("template_name_for_feed_item")."\";");
}
Thanks so much.
We will try it.