elelement for link and for publish date Modified by Alan Levine 04.dec.2003 - fixed problem with incorrect parsing of item published dates from RSS 2.0 feeds Usage: see http://jade.mcli.dist.maricopa.edu/feed/ Customization can be achieved via declarations of external CSS This makes use of the Onyx RSS parser from http://www.readinged.com/onyx/rss/ */ // POSTED VARS // retrieve from posted vars, just in case PHP globals are off $xml_src = $_GET['src']; // flag to show channel info, values = no/yes/title; default = yes if ($_GET['chan']) { $channel_option = $_GET['chan']; } else { $channel_option = 'yes'; } // variable to limit number of displayed items; default = 0 (show all) if ($_GET['num']) { $num_option = $_GET['num']; } else { $num_option = 0; } // flag to show item description, values = no/yes; default = no if ($_GET['desc']) { $desc_option = $_GET['desc']; } else { $desc_option = 'no'; } // flag to show date of posts, values = no/yes; default = no if ($_GET['date']) { $date_option = $_GET['date']; } else { $date_option = 'no'; } // ERROR TRAP // trap for missing src param, divert to an error page if (!$xml_src) header("Location:nosource.html"); // INCLUDES // path to location of onyx-rss code files //include('onyx-rss.php'); include 'onyx-rss.php'; // VARIABLES // relative or full path to cache directory (must be writable permissions CHMOD 777) $cachePath = 'cached'; // output spec for item date string if used // see http://www.php.net/manual/en/function.date.php $date_format = "F d, Y h:i:s a"; // create unique cache file name based on URL of feed $url_parts = parse_url($xml_src); $xfile = $url_parts["host"] . $url_parts["path"] . $url_parts["query"]; $xfile = preg_replace("/(\/|=|&)/", "-", $xfile); // Use Onyx RSS $rss = new ONYX_RSS(); // set local local cache (must by CMHMOD 777) $rss->setCachePath($cachePath); //use object mode $rss->setFetchMode(ONYX_FETCH_OBJECT); // set cache based on XML file / path name $rss->parse($xml_src, "$xfile.cache"); // get channel data $channel = $rss->getData(ONYX_META); // begin javascript output string for channel info $str = "
\n"; if ($channel_option == 'yes') { // output channel title and description $str.= "

link\">" . $channel->title . "
" . $channel->description . "

\n"; } elseif ($channel_option == 'title') { // output title only $str.= "

link\">" . $channel->title . "

\n"; } // begin item listing $str.= "
\n"; ?> <?php echo $channel->title?>

RSS Feed for title?>

Note: this RSS feed is provided as a text alternative to inline RSS feeds that may not display on all browsers