"; echo ""; echo "Streaming Archive"; echo ""; echo ""; if (file_exists($dirPath."/logo.gif")) { echo ""; } } function bottomHeaders() { echo ""; echo ""; } function getDir($dirPath) { static $mp3List = array(); static $dirList = array(); $mp3regExp = "/.mp3$|.ogg$/"; $dir = dir($dirPath); while ($file = $dir->read()) { $filePath = $dirPath."/".$file; if (is_dir($filePath) && $file != "." && $file != "..") { $dirList[$file] = 'dirlist'; } elseif (is_file($filePath) && preg_match($mp3regExp, $file)) { $mp3List[$file] = 'mp3list'; } } $dir->close(); $dirArr['programs'] = $dirList; $dirArr['audio'] = $mp3List; return $dirArr; } function formattedOutput($array, $dirPath, $docRoot, $prefix) { $rowCount = 0; ksort($array); reset($array); echo "\n\n"; foreach ($array as $f_name=>$f_value) { if(is_link($dirPath."/".$f_name)) { $useName=realpath($dirPath."/".$f_name); if ($prefix == "") $pf1=""; else $pf1=substr($prefix,1)."/"; $useName=str_replace($docRoot.$pf1,"",$useName); } else { $useName=$dirPath."/".$f_name; } echo ""; echo ""; echo ""; if (file_exists($useName.".playlist.html")) echo ""; else echo ""; } elseif ($f_value == "dirlist") { echo "".$f_name.""; } $descFile = $useName.".description.txt"; if (file_exists($descFile)) { if ($f_value == "mp3list") echo ""; } else { if ($f_value == "mp3list") echo ""; } } echo "\n"; $rowCount++; } echo "
"; if ($f_value && $f_value != 'mp3list' && $f_value != 'dirlist') echo $f_name.":"; $rowColor = ($rowCount % 2) ? "#FFFFFF" : "#EEEEEE"; $bg= "bgcolor='".$rowColor."'"; echo "
 "; if (is_array($f_value)) { formattedOutput($f_value, $dirPath, $docRoot, $prefix); } else { if ($f_value == "mp3list") { echo "
".$f_name."[play][download][playlist]"; $f_handle = @fopen($descFile,"rb"); fpassthru($f_handle); fclose($f_handle); if ($f_value == "mp3list") echo "
\n"; } ?>