1) Script Title:
RSS Display Boxes
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamici...ybox/index.htm
3) Describe problem: I have placed the rss display box on my site but the box won't display the feed. it works with the defaut feeds that comes with it but when i put my own feeds in it won't display it. i am using wordpress to generate my feeds. i did manage to get it working with a .atom feed but i have to manually update it.
here is the main.php file
PHP Code:
<?php
//Function for ouputting the body of each RSS item displayed (inside loop)- DynamicDrive.com
require('../simplepie/simplepie.inc'); //Specify path to simplepie.inc on your server (by default located inside "simplepie" directory)
$feed = new SimplePie();
$feed->cache_location('cache'); //Specify path to cache directory on your server relative to this file
$feed->handle_content_type();
require('outputbody.php'); //Path to custom "outputbody.php" file relative to this file
//Specify list of RSS URLs
$rsslist=array(
"centralbsu" => "http://centralbsu.com/blog/?feed=rss2",
"bsublog" => "www.centralbsu.com/rss.atom" //no trailing comma after last RSS URL!!
);
////Beginners don't need to configure past here. Edit outputbody.php to format the output of each RSS item's body ////////////////////
$rssid=$_GET['id'];
$rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("<b>Error:</b> Can't find requested RSS in list.");
$cachetime=isset($_GET["cachetime"])? (int)$_GET["cachetime"] : 30; //Get cachetime. Default to 30 if not specified
$feednumber=isset($_GET["limit"])? (int)$_GET["limit"] : ""; //Get number of items to fetch. If not specified (""), all is fetched.
$templatename=isset($_GET["template"])? $_GET["template"] : ""; //get name of template, which is used by if/else logic within function outputbody()
if ($templatename!="" && !preg_match("/^(\w|-)+$/i", $templatename)) //Template name can only contain alphanumeric characters, underscore or dash (-)
die ("<b>Error:</b> Template name can only consist of alphanumeric characters, underscore or dash");
$feed->cache_max_minutes($cachetime);
$feed->feed_url($rssurl);
$feed->init();
$max = $feed->get_item_quantity($feednumber);
function outputitems(){
global $feed, $feednumber, $templatename;
$max = $feed->get_item_quantity($feednumber);
for ($x = 0; $x < $max; $x++){
$item = $feed->get_item($x);
outputbody($item, $templatename); //call custom outputbody() function
}
}
?>
<?php
if ($feed->data){
outputitems();
}
?>
here is the link to the site the box is on
http://www.centralbsu.com
Bookmarks