and the page if($_SERVER['HTTPS'] == on) { $SERVER_NAME = "https://" . $_SERVER['HTTP_HOST']; } else { $SERVER_NAME = "http://" . $_SERVER['HTTP_HOST']; } $INSTALLATION_PATH = $_MY_PATH_PART ? substr( dirname($_SERVER['SCRIPT_NAME']), 0, -strlen($_MY_PATH_PART) ) : dirname($_SERVER['SCRIPT_NAME']); $INSTALLATION_PATH = $INSTALLATION_PATH . '/'; $rss = new UniversalFeedCreator(); $rss->useCached(); // use cached version if age<1 hour $rss->title = $ShowName . " PSP videos"; $rss->description = $ShowName; //optional $rss->descriptionTruncSize = 500; $rss->descriptionHtmlSyndicated = true; $rss->link = $SERVER_NAME . $INSTALLATION_PATH; $rss->syndicationURL = $SERVER_NAME.$_SERVER["PHP_SELF"]; $image = new FeedImage(); $image->title = $ShowName . " Feed"; $image->url = $SERVER_NAME . $INSTALLATION_PATH . $ImagePath; $image->link = $SERVER_NAME; $image->description = $ShowName; //optional $image->descriptionTruncSize = 500; $image->descriptionHtmlSyndicated = true; $rss->image = $image; // get the files in the current directory if ($handle = opendir('.')) { while (false !== ($file=readdir($handle))) { if (strpos($file, $ShowName) !== false) $files[]=array(filemtime($path.$file),$file); #2-D array } closedir($handle); if ($files) { rsort($files); #sorts by filemtime #done! Show the files sorted by modification date foreach ($files as $file) { $item = new FeedItem(); $item->title = $file[1]; $item->link = $file[1]; $item->description = $ShowName; //optional $item->descriptionTruncSize = 500; $item->descriptionHtmlSyndicated = true; $item->date = $file[0]; $item->source = $SERVER_NAME . $INSTALLATION_PATH; $item->author = "MythTV"; $item->enclosure->url = $SERVER_NAME . $INSTALLATION_PATH . $file[1]; $item->enclosure->length = filesize($file[1]); $item->enclosure->type = 'video/mp4'; $rss->addItem($item); } } } $rss->outputFeed("RSS2.0"); ?>