11-15-2008, 03:41 PM
Already integrated to THT, there is a RSS Reader Class made specially to read the THT Community's news items and show it in the THT AdminCP. But you can use it also, if you create a new page in the system using this code, you will get a news feed! (Made using MyBB)
Remember to edit $url to make it to work.
Explore the code by yourself, you will find out more.
Remember to edit $url to make it to work.
PHP Code:
require_once(LINK.'rss/rss_fetch.inc');
$url = "http://thehostingtool.com/forum/syndication.php?fid=2&limit=3";
$rss = fetch_rss($url);
echo "<p>";
foreach ($rss->items as $item) {
$author = $item['dc:creator']; //Post Author
$subject = $item['title']; //Topic Title
$href = $item['link']; //Topic Link
$pubdate = $item['pubDate']; //Topic Publication Date
$description = substr($item['description'], 0, strrpos(substr($item['description'], 0, 250), ' ')) . '...
<a href='.$href.' target="_blank" title="This post is cut to 250 characters. To read the rest of this post, click Read More." class="tooltip">
[Read More]</a>';
/* Above is the post content */
echo "<strong><a href='".$href."' target='_blank'>".$subject."</a></strong> - Posted by ".$author."<br />
$description<br /><br />"; //tpl: rss feed
}
echo "</p>";
Explore the code by yourself, you will find out more.