Subscribe to
Posts
Comments
NSLog(); Header Image

RSS for vBulletin

One of the things I wanted in the redesign of The Sand Trap was to further promote the golf forum. One of the ways in which this was done was with a small image at the top and some bolder, colored text. I also wanted to put "Hot Forum Topics" in the sidebar.

vBulletin offers JavaScript, RSS, and XML content via its "external data providers" feature. The feed is easily parsed with MagpieRSS, even if it doesn't validate, and within minutes I had a working side bar with links to the thread and the creator's name. Then I found some problems - namely, that the feed didn't update very frequently. It showed only the most recent 15 threads by creation date, not activity. vBulletin offers no method of changing the RSS template, so it's quite "take it or leave it."

I left it. After filing a feature request, a Google search turned up FPS_External.php. This file, which can replace external.php in a vBulletin installation, offers a number of features not available via vBulletin's built-in "external data providers."

Most important to me: fps_external can display recently updated threads, regardless of their creation date. vBulletin's built-in system displays only the 15 most recent threads by creation date; fps_external displays threads by the last post date. It offers the ability to filter by forumid (?forumids=1,3,5,7,11,13), to display BBCode or HTML, and other nice features. My MagpieRSS script simply looks like this:

require_once 'magpierss/rss_fetch.inc';
define('MAGPIE_CACHE_DIR', '/tmp/magpie_cache');
$url = 'http://thesandtrap.com/forum/fps_external.php?' .
        'type=rss1&qty=10&items=active&postlen=1';
$rss = fetch_rss($url);
foreach ($rss->items as $item)     
{
    $item   = $items[$x];        
    $title  = $item[title];
    $url    = $item[link];
    $author = $item[dc][creator];
    echo "<li><a href=$url>$title</a> by $author</li>";    
}

There's only one thing I'd really change, and it's already been suggested. Currently, fps_external displays the first post in a thread. I'd like it to display the last post, with proper author credit.

There you have it. RSS for vBulletin, customized to suit a "hot topics" link via MagpieRSS. FPS_External offers a lot of features I'm not using, and is a wonderful replacement or addition to any vBulletin installation.

2 Responses to "RSS for vBulletin"

  1. I have taken all the steps that you mentioned in your post. And I would like toi ask: did you find any way to display the latest posts? I can't find any so far...

  2. Boris Lifanovsky said on April 24, 2006:

    I have taken all the steps that you mentioned in your post. And I would like toi ask: did you find any way to display the latest posts? I can't find any so far...

    I have. I use SimplePie and a plugin that shoves off an RSS feed.

    Since this post attracts more spam than any other posts on my blog, I'm going to close comments.