I’ve made a few minor changes to both Ryan King’s original dircaster.php and Chris Curtis’s index.php as well. But due to the anti-html-code filter of the website of the original author Ryan King, and his refusal to put an email address anywhere on his website, the best I can do is post the changes here.
The key change I’ve made is to also recognize a “file.txt” which has the same base name as the “file.mp3″ and use that file as the contents of the description tag for the RSS feed, and to include the contents of the file inside the table for the index.php. This implements shownotes if you will.
I’ve also implemented separately (outside of dircaster.php and index.php) some code that posts the shownotes from this text file and the mp3 tags into my companion weblog when I post a file, but this (1) does not use the metaweblog API and (2) is therefore highly specific to my blog software. Oh well.
The bulk of the action in dircaster.php is simply (instead of just the target of the else):
$notesfile = str_replace("mp3","txt",$filename);
if (file_exists($notesfile)) {
echo ("<description>");
$notes = "";
$lines = file($notesfile);
foreach ($lines as $line_num => $line) $notes .= $line;
echo strip_tags($notes);
echo ("</description>");
}
else echo ("<description>$mp3file->title - $mp3file->album -
$mp3file->artist</description>\n");
and the bulk of the action in index.php is similar (replacing the obvious line with this):
echo ("<td><a href=".$rootMP3URL."/".
htmlentities(str_replace(" ", "%20", $filename)) .
">".$rootMP3URL."/".
htmlentities(str_replace(" ", "%20", $filename))."</a>");
$notesfile = str_replace("mp3","txt",$filename);
if (file_exists($notesfile)) {
echo (" <br>\n");
readfile($notesfile);
}
echo ("</td>\n");
I also abstracted the common variables into a config.php and share it between the two. You can fetch my version of this here dircaster_0_5.zip.