Go Back   vBulletin Modification Discussions > vBulletin Discusions > Forum Design, Graphics & Customization
Home Register FAQ Members List Calendar Mark Forums Read
vBSEO Info Tags

About This Page: This is a discussion on Displaying on a non-vBulletin page? within the Forum Design, Graphics & Customization forums, part of the vBulletin Discusions category, at vBulletin Modification Discussions. I'm having diffculties on displaying threads on a non-vBulletin pages, using the RSS feeder. Code: <? // ###################################################### // ## configuration // ## // ## $rss2_file= 'external.php?type=rss2'; // ## Adjust this variable to point to your RSS2 feed $rss2_file = 'external.php?type=rss2&forumids=


Reply
 
LinkBack Thread Tools
Old 11-07-2006, 02:16 AM   #1 (permalink)
Junior Member
 
Join Date: Nov 2006
Posts: 1
bduff07 is on a distinguished road
iTrader: (0)
Displaying on a non-vBulletin page?

I'm having diffculties on displaying threads on a non-vBulletin pages, using the RSS feeder.

Code:
<?

// ######################################################
// ## configuration
 // ##
 // ## $rss2_file= 'external.php?type=rss2';
 // ## Adjust this variable to point to your RSS2 feed

 $rss2_file = 'external.php?type=rss2&forumids=14';

 // ## configuration end
 // ######################################################
 // ## Do not touch code below!

 $is_item = false;
 $tag = '';
 $title = '';
 $description = '';
 $link = '';
 $date = '';
 $poster = '';

 function character_data($parser, $data)
 {
     global $is_item, $tag, $title, $description, $link, $date, $poster;
     if ($is_item)
     {
         switch ($tag)
         {
             case "TITLE":
             $title .= $data;
             break;

             case "DESCRIPTION":
             $description .= $data;
             break;

             case "LINK":
             $link .= $data;
             break;

             case "PUBDATE":
             $date .= $data;
             break;

             case "POSTER":
             $author .= $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, $date, $poster, $rss2_output;
     if ($name == "ITEM")
     {
         $rss2_output .= "<dt><strong><a href='" . trim($link) . "'>" . htmlspecialchars(trim($title)) . "</a></strong> <br><i> " . htmlspecialchars(trim($date)) . " </i>Posted by <em>" . htmlspecialchars(trim($poster)) . "</em></dt>" . htmlspecialchars(trim($description)) . "<br><br>";
         $title = "";
         $description = "";
         $link = "";
         $date = "";
         $poster = "";
         $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($rss2_file,"r");

 while ($data = fread($fp, 4096))
 {
     xml_parse($parser, $data, feof($fp));
 }

 fclose($fp);
 xml_parser_free($parser);
 ?>

 <?
 echo $rss2_output;
 ?>
Could someone help me out, it doesn't display the author and when there is a image, the image doesn;t show up?
bduff07 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links

Reply
Tags: ,





Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


A vBSkinworks Design Recoded By vBModder.
All Code Distributed On This Site is © 2006 by it's author.
Search Engine Optimization by vBSEO 3.1.0

All times are GMT -7. The time now is 10:25 PM.
Online Users 44
Registered 0
Guests 44
Members 3144
Active Members 227
Threads 1575
Posts 6982
Top poster: Code Monkey (2193)
Welcome to our newest member, VbGuru
Most users ever online was 235, 04-11-2007 at 08:59 AM.
Speak Out! vBulletin gets the web talking!


vBulletin Setup SEO

vBulletin graphics resource images