Announcement

Collapse
No announcement yet.

RSS Feed Display Issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RSS Feed Display Issue

    Code:
    // ######################################################
    // ## configuration
    // ##
    // ## $rss_file= 'http://www.vbulletin.com/forum/external.php?type=rss';
    // ## Adjust this variable to point to your RSS feed
     
    $rss_file = 'http://www.vbulletin.com/forum/external.php?type=rss';
        
    // ## configuration end
    // ######################################################
    // ## Do not touch code below!
        
        
    $is_item = false;
    $tag = '';
    $title = '';
    $description = '';
    $link = '';
        
    function character_data($parser, $data)
    {
        global $is_item, $tag, $title, $description, $link;
        if ($is_item)
        {
            switch ($tag)
            {
                case "TITLE":
                $title .= $data;
                break;
                case "DESCRIPTION":
                $description .= $data;
        
                break;
                case "LINK":
                $link .= $data;
                break;
            }
        }
    }
        
    function begin_element($parser, $name)
    {
        global $is_item, $tag;
        if ($is_item)
        {
            $tag = $name;
        }
        else if ($name == "ITEM")
        {
            $is_item = true;
        }
    }
        
    function end_element($parser, $name)
    {
        global $is_item, $title, $description, $link, $rss_output;
        if ($name == "ITEM")
        {
            $rss_output .= "<dt><strong><a href='" . trim($link) . "'>" . htmlspecialchars(trim($title)) . "</a></strong></dt><dd>" . htmlspecialchars(trim($description)) . "</dd>";
            $title = "";
            $description = "";
            $link = "";
            $is_item = false;
        }
    }
        
        
    $parser = xml_parser_create();
        
    xml_set_element_handler($parser, "begin_element", "end_element");
    xml_set_character_data_handler($parser, "character_data");
    $fp = fopen($rss_file,"r");
        
    while ($data = fread($fp, 4096))
    {
        xml_parse($parser, $data, feof($fp));        
    }
        
    fclose($fp);
    xml_parser_free($parser);
    How can I modify that code for display the latest forum threads on my forum so that it outputs like this...

    At the moment, my feed looks like this:

    New Guides in Wiki and Site Upgrade Coming Soon!

    Forum: News and Announcements Posted By: windrider07 Post Time: 03-13-2010 at 11:54 PM
    How can it be modified so that it looks like this:

    New Guides in Wiki and Site Upgrade Coming Soon!
    Posted by windrider07 at 11:54 PM on 3/13/2010

    Original post here.................

    Click here for more details.
    The feed output vBulletin has is so simple. Can it be more expanded?

  • #2
    anyone?

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X