The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
Well, what were you thinking about? Do you just want some space between them or do you want some type of header saying what the feed is?
|
#12
|
||||
|
||||
well if it could have some header saying this is news this is events it will be perfect.
|
#13
|
|||
|
|||
OK, you could do something like this:
Code:
<?php // ###################################################### // ## configuration // ## // ## $rss_file= 'http://www.vbulletin.com/forum/external.php?type=rss'; // ## Adjust this variable to point to your RSS feed $rss_files = array( array('url' => 'http://forum.elitegamers.co/external.php?type=RSS2&forumids=18', 'max' => 5, 'title' => "News"), array('url' => 'http://forum.elitegamers.co/external.php?type=RSS2&forumids=48', 'max' => 5, 'title' => "Events") ); // ## configuration end // ###################################################### // ## Do not touch code below! echo '<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title></title> <style type="text/css"> A:link {text-decoration: none; color: #FB7800; font-weight:bold;} A:visited {text-decoration: none; color: #FB7800; font-weight:bold;} A:active {text-decoration: none; color: #FB7800; font-weight:bold;} A:hover {text-decoration: underline; color: red; font-weight:bold;} </style> </head> <body>'; function character_data($parser, $data) { global $is_item, $tag, $title, $description, $link , $date; 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; } } } 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, $date; if ($name == "ITEM") { global $item_count, $max_items; $item_count++; if ($item_count <= $max_items) { $rss_output .= "<table width='530' style='margin-left:auto; margin-right:auto; padding-bottom:10px;'> <tr> <td style='padding-left:15px;' align='left'><p><a href='".trim($link)."' target=\"_blank\">".htmlspecialchars(trim($title))."</a></p></td> </tr> <tr> <td><p style='color:#95BEDA;'>Posted ".$date."</p></td> </tr> <tr> <td><p style='color:#70CCA0'>" . htmlspecialchars(trim($description)) . "</p></td> </tr> </table>"; $title = ""; $description = ""; $link = ""; $date = ""; $is_item = false; } } } $rss_output = ""; foreach ($rss_files AS $feed) { $rss_output .= "<table width='530' style='margin-left:auto; margin-right:auto; padding-bottom:10px;'> <tr><td align='left'>{$feed['title']}</td></tr></table>"; $max_items = $feed['max']; $item_count = 0; $is_item = false; $tag = ''; $title = ''; $description = ''; $link = ''; $parser = xml_parser_create(); xml_set_element_handler($parser, "begin_element", "end_element"); xml_set_character_data_handler($parser, "character_data"); $fp = fopen($feed['url'],"r"); while ($data = fread($fp, 4096)) { xml_parse($parser, $data, feof($fp)); } fclose($fp); xml_parser_free($parser); $rss_output .= "<BR/>"; } echo $rss_output; echo '</body> </html>'; ?> I just took the table tags from the end_element function, but if you want it to look different you'll have to figure out the html for it (and change the "$rss_output = " line at the beginning of the foreach loop). |
#14
|
||||
|
||||
Thank you very much.I will try to improve now the visual of it.
--------------- Added [DATE]1343173125[/DATE] at [TIME]1343173125[/TIME] --------------- But one problem,if you look here http://cabal.elitegamers.co/ the [Ended] Boss/drop event show more post dates.How do i fix that? |
#15
|
|||
|
|||
In the foreach loop, change:
Code:
$link = ''; $parser = xml_parser_create(); Code:
$link = ''; $date = ''; $parser = xml_parser_create(); (add the $date = ''; after the $link line). |
#16
|
||||
|
||||
Fixed.
Now another thig is that [Ended] Boss/drop event is created before the [In progress] New Advertise banner for EGCabal Online post and its closed to.Why it appears as the first and current one? |
#17
|
|||
|
|||
That's the order they are in the feed, and the post date of the first [ended] one is later than the [in progress] one, so I'm not sure what you can do about that.
|
#18
|
||||
|
||||
o ok.Thank you very much.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|