I'm using a script to play mp3 sermons for a church web site. The script takes MP3's found in a directory or sub directories and out puts them to a page and plays them with Yahoo's media player. You can read more about it here: http://vespa.willinger.cc
I want the output to be in column format 2 maybe 3 (about 30 mp3's per column). It currently outputs to 1 column. I added the code from the file below. Thanks for any help.
<?php
// VESPA outputs a single MP3s
$filearray = array();
$handle = opendir($absolute_dir);
while (false !== ($file = readdir($handle))) {
if ($file == "." OR $file == "..") { continue; } // VESPA does not want the root or parent directory
if (strstr($file, ".mp3") OR strstr($file, ".MP3")) array_push($filearray,$file); // VESPA pushes the files into an array
}
natcasesort($filearray);
foreach ($filearray as $file) {
//Yahoo's Media Player requires an absolute Web-URL
echo "<div class=\"singlelink\"><a href=\"http://".$domain.$webdir.$weburl."/".$file."\">".$file."</a>";
// VESPA reads the MP3 text file if available
if (strstr($file, ".mp3")) { $mp3textfile = ereg_replace(".mp3", $replacement, $file); }
else { $mp3textfile = ereg_replace(".MP3", $replacement, $file); }
$mp3 = $absolute_dir . "/" . $mp3textfile . ".txt";
if (file_exists($mp3)) {
echo "<div class=\"mp3text\">";
$mp3text = fopen($mp3,"r");
if ($mp3text) {
while(!feof($mp3text)) {
$text = fgets($mp3text);
echo $text;
}
fclose($mp3text);
}
echo "</div>";
}
echo "</div>";
}
echo "</div>";
closedir($handle);
?>