The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
RSS2 Display on External Page
Running vB3.6.8PL2 Using the 'How To' from This Thread page coded as follows: Code:
<?php include "header.php"; // ###################################################### // ## configuration // ## // ## $rss2_file= 'http://www.****.net/forums/external.php?type=rss2&forumids=39&lastpost=1'; // ## Adjust this variable to point to your RSS2 feed $rss2_file = 'http://www.****.net/forums/external.php?type=rss2&forumids=39&lastpost=1'; // ## configuration end // ###################################################### // ## Do not touch code below! $is_item = false; $tag = ''; $title = ''; $description = ''; $link = ''; $date = ''; $author = ''; function character_data($parser, $data) { global $is_item, $tag, $title, $description, $link, $date, $author; 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 "AUTHOR": $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, $author, $rss2_output; if ($name == "ITEM") { $rss2_output .= "<dt><strong><a href='" . trim($link) . "'>" . htmlspecialchars(trim($title)) . "</a></strong> - " . htmlspecialchars(trim($date)) . " by <em>" . htmlspecialchars(trim($author)) . "</em></dt><dd>" . htmlspecialchars(trim($description)) . "</dd>"; $title = ""; $description = ""; $link = ""; $date = ""; $author = ""; $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); ?> <table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><span style="text-decoration: underline; font-style: italic; font-weight: bold;">WELCOME MESSAGE</span><br> blah blah blah yada yada yada blah blah blah yada yada yada blah blah blah yada yada yada blah blah blah yada yada yada blah blah blah yada yada yada blah blah blah yada yada yada blah blah blah yada yada yada blah blah blah yada yada yada blah blah blah yada yada yada<br> </td> </tr> </tbody> </table> <span style="font-family: calisto mt;"></span> <table style="text-align: left; width: 577px; height: 315px;" border="0" cellpadding="15" cellspacing="5"> <tbody> <tr> <td style="width: 60%; vertical-align: top;"><span style="font-style: italic; text-decoration: underline; font-weight: bold;">NEWS<br> </span> <p style="text-align: justify;"><left></left><big style="font-family: garamond;"><font color="#302808"><small><?php include "echo $rss2_output"; ?> <br> <p style="text-align: left;"><font color="#302808"><big>Click <b><a href="http://www.****.net/forums/showthread.php?t=2605">HERE</a></b> for more Current Events!</big></font></p> </td> <td style="width: 40%; vertical-align: top;"> <span style="text-decoration: underline; font-style: italic; font-weight: bold;">HOT LINKS</span><br> <span style="text-decoration: underline; font-style: italic; font-weight: bold;"></span><br> <big><span style="font-family: garamond;"><a href="http://www.****.net/holds/Maps/index.php">Territory Maps</a></span><br style="font-family: garamond;"> <span style="font-family: garamond;"><a href="http://www.****.net/weyr/Maps/index.php">Weyr Maps</a></span><br style="font-family: garamond;"> <span style="font-family: garamond;">Resident Lists(link)</span><br style="font-family: garamond;"> <span style="font-family: garamond;"><a href="http://www.****.net/home/Guides/index.php">Persona Guide</a></span><br style="font-family: garamond;"> <span style="font-family: garamond;"><a href="http://www.****.net/club/Canon/index.php">Canon</a></span><br style="font-family: garamond;"> <span style="font-family: garamond;"><a href="http://www.****.net/club/Participation/index.php">Membership & Participation Policies</a></span><br style="font-family: garamond;"> <span style="font-family: garamond;"><a href="http://www.****.net/club/Pern101/index.php">Pern 101</a></span><br style="font-family: garamond;"> <span style="font-family: garamond;">Create/Submit a Persona(whizzy link)</span></big> </td> </tr> </tbody> </table> <span style="font-family: calisto mt;"></span> <div style="text-align: left;"><font face="Calisto MT"> </font></div> <div style="text-align: left;"> </div> <table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"> <div> </div> <div style="text-align: center;"><span style="font-weight: bold;"></span> <br> <br> </div> </td> </tr> </tbody> </table> <table style="width: 100%; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"> <span style="color: rgb(153, 51, 0);"> <center><br> <a title="Take The Tour!" onmouseover="changeImages( /*CMP*/'tour_up',/*URL*/'images/tour_over.jpg');return true" onmouseout="changeImages( /*CMP*/'tour_up',/*URL*/'images/tour_up.jpg');return true" href="http://www.****.net/home/Tour/tour1.html"><img src="images/tour_up.jpg" alt="" name="tour_up" border="0" height="40" width="113"></a><br> <br> </center> </span></td> </tr> </tbody> </table> <font face="Calisto MT"> </font></td> </tr> </tbody> </table> <?php include "footer.php" ?> Quote:
screenshot (attached) & 'line 120' is the '?php include "echo $rss2_output"; ?' line Any assistance to get this to work/display 'right' would be appreciated. |
#2
|
|||
|
|||
![]()
n/m, figured it out
![]() |
#3
|
|||
|
|||
![]()
Like I said in the above post I got the code fixed to display with the rss2 feed on my non-vB page (outside of the forums directory). My next question is why the 'author' isn't showing up (see attachment). I actually don't care to have the 'author' showing, but the "....by " is a bit disconcerting. Is their a way to remove the 'by' from displaying altogether? Is there a way to keep the post date from displaying, since I might not want that either?
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|