I use this rss reader to get mi data from the forum
How do i modifie to show only the last 10 updates
Regards
PHP Code:
<?php
// ######################################################
// ## configuration
// ##
// ## $rss_file= 'http://www.vbulletin.com/forum/external.php?type=rss';
// ## Adjust this variable to point to your RSS feed
$rss_file = 'http://forum.elitegamers.co/external.php?type=RSS2&forumids=18';
// ## 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 .= "<table width='530' style='margin-left:auto; margin-right:auto; padding-bottom:10px;'>
<tr>
<td style='padding-left:15px;' align='left'><p style='font-weight:bold;'><a style='color:#FB7800;' href='" . trim($link) . "'>" . htmlspecialchars(trim($title)) . "</a></p></td>
</tr>
<tr>
<td><p style='color:#70CCA0'>" . htmlspecialchars(trim($description)) . "</p></td>
</tr>
</table>";
$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);
?>