Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Plugins] The News Feed System
#1
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.

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'], 0strrpos(substr($item['description'], 0250), ' ')) . '...
<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.
Jimmie Lin - Community Manager & THT.Next Developer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)