Sanserif\n" . print_r($sans_serif_path,1) . ""; //print "
Serif\n" . print_r($serif_path,1) . "
"; $podcasts_directory_exists = &$sans_serif_path['relative_path_to_podcast']; $apology_file_found = false; $mime['mp3'] = "audio/mpeg"; if (!file_exists($podcasts_directory_exists)) { print "

\"$podcasts_directory_exists\" doesn't exist, please create a podcasts directory

"; exit; } else { if ($handle = opendir($podcasts_directory_exists)) { while (false !== ($file = readdir($handle))) { if (!is_dir($file) && ($outcome = preg_match("/^([^.]+)[.]([^.]*)$/",$file,$match)) && isset($mime[$match[2]])) { //print $file . "
"; $rp_to_file = $podcasts_directory_exists . "/" . $file; //print "

" . print_r($match,1) . "
"; $time = filemtime($rp_to_file); //TODO: Change these messages to match your podcast.. // // handle naming for media files if (trim($file) == trim($p['apology_file'])) { //TODO: The Message that will appear if you have no podcasts $title = 'Pardon Us The Podcast Channel Is Currently Empty'; $descr = 'There Is currently no podcast files associated with this channel, check back later!'; $apology_file_found = trim($file); // location // TODO: } elseif(file_exists($file_description)) { // handle descriptions } else { $podcast_name = $file; if (preg_match("/([^.]*)[.][^.]*/",$file,$match)) { $podcast_name = $match[1]; } $podcast_name = preg_replace("/_/"," ",$podcast_name); $title = $podcast_name . " (Your Podcast Site's Name Here)"; $descr = "\"$podcast_name\" for date:" . date("r",$time); } $list[$file] = array( 'title' => $title, 'descr' => $descr, 'time' => $time, 'file' => $file, 'type' => $mime[$match[2]], 'size' => filesize($rp_to_file) ); } else { // unsupported file types and non-files if (is_dir($file)) { //print "found directory: $file
"; } else { if (isset($match) && $outcome) { //print "
" . print_r($match,1) . "
"; } else { //print "This should never happen: \"$file\"
"; } } } } // while // show apology file only when the apology exists if (count($list) > 1) { if (isset($apology_file_found)) { unset($list[$apology_file_found]); } } else { if (count($list) < 1) { // TODO: Apology file info, adjust to your taste $list["apology"] = array( 'title' => 'Pardon Us The Podcast Channel Is Currently Empty', 'descr' => 'There Is currently no podcast files associated with this channel, check back later!', 'time' => time(), 'file' => $p['apology_file'], 'type' => "audio/mpeg", 'size' => '0' ); } else { // it is either an apology file or something else, in any case // it's valid.. } } closedir($handle); } // if (opendir()) } // if podcasts directory exists //print "
" . print_r($list,1) . "

"; // Header determines how RSS file looks when you click on the link, comment // these out, if you don't want any headers (link will appear as gunk).. // header('Content-type: application/rss+xml'); header('Content-Disposition: attachment; filename="your_podcasts_name_as_a_file_here.rss"'); print make_rss_entries($list); function make_rss_entries($entry_list) { $p = $GLOBALS['sans_serif_path']; //alias $s = $GLOBALS['serif_path']; //alias $where = $s['path_to_podcast']; // HANDLE THE CASE WHERE THE ENTRY LIST IS 0, AN APOLOGY TAKES IT'S PLACE. TO RETAIN FEED INTEGRITY // $list = ""; // Make RSS Header // $hdr_title = "Title of your Podcast Feed"; $hdr_link = "Your Website Address Here"; $hdr_description = "Describe to the folks what your podcast is about"; $hdr_copy_right = "Your Copyright Information Here"; $hdr_last_build_date = "Fri, 10 Mar 2006 03:52:34 GMT"; if (is_array($entry_list)) $count = count($entry_list); $header = " $hdr_title $hdr_link $hdr_description en-us $hdr_copy_right $hdr_last_build_date ''Drop-it-in'' Podcast Geneator, based on XML from tdscripts.com website, authored by Kiernan Holland, Look for a Open Source version at Kiernan's Website. riseofthethorax@earthlink.net $count "; // Make rows in RSS if (isset($entry_list) && (is_array($entry_list))) { while(list($key,$value) = each($entry_list)) { if (is_array($value)) { $title = $value['title']; $descr = $value['descr']; $date = date("r",$value['time']); $file = $where . $value['file']; $size = $value['size']; $type = "audio/mpeg"; $row = " $title $file $descr $date "; $list .= $row; } } } // make the RSS footer.. $footer = " "; // return the output as a result return $header . $list . $footer; } ?>