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 .= "\n"; } return $page."\n"; } function reader($url) { global $feedArray; global $content; global $style; global $date_Font; global $rssChannelTags; global $rssItemTags; global $doc; $feedArray = array(); $doc = new DOMDocument("1.0"); $doc->load($url); $content = array(); $channel = extractChannel("feed"); $channel = extractChannel("channel"); $channelArray = getTags($channel, $rssChannelTags, 0); $items = extractItems($channel, "item"); $tagSchema = $rssItemTags; array_push($feedArray, $channelArray); foreach($items as $item) { array_push($feedArray, getTags($item, $tagSchema, 1)); } return $feedArray; } ?> Then add this code to the place in the website that you want the blog feed to be:
?>