Save the code below to a php file called RSSFeedReader.php and place it in the same file as your website on the server:
"title",
"link"=>"link",
"description"=>"description",
"pubDate"=>"updated");
$doc = false;
function getTag($element, $tag)
{
$x = $element->getElementsByTagName($tag);
if($x->length == 0)
{
return false;
}
$x = $x->item(0);
$x = $x->firstChild->data;
return $x;
}
function getTags($element, $listOfTags, $type)
{
global $translation;
$a = array("type" => $type);
foreach($listOfTags as $tag)
{
$b = $translation[$tag];
$a[$b] = getTag($element, $tag);
}
return $a;
}
function extractChannel($tag)
{
global $doc;
$channel = $doc->getElementsByTagName($tag);
return $channel->item(0);
}
function extractItems($dnl, $tag)
{
global $doc;
$items = $doc->getElementsByTagName($tag);
return $items;
}
function display($size = 10, $chanflag = true, $descflag = true, $dateflag = true)
{
global $feedArray;
global $style;
global $date_Font;
$i = 0;
$opened = false;
$page = "";
$counter = 0;
if(count($feedArray) == 0)
{
die("Error, nothing to display.");
}
foreach($feedArray as $article)
{
$type = $article["type"];
if($type == 0)
{
if($chanflag != true) continue;
if($opened == true)
{
$page .="\n";
$opened = false;
}
//$page .="";
}
else
{
if($counter++ >= $size)
{
break;
}
if($opened == false && $chanflag == true)
{
$page .= " $title";
if($descflag != false)
{
$description = $article["description"];
if($description != false)
{
$page .= " $description\n";
$opened = true;
}
}
$title = $article["title"];
$link = $article["link"];
if($i == 0)
{
$title = "Treemetrics Blog";
$link = "http://treemetrics.bloghost.name";
}
$page .= "
| ?> |