Contribute to the Flap.TV collection! Upload your
albums via FTP to:
>>> flap.tv | username: public | password: private <<<
Click here for download
statistics.
Click here to return to music.
function listdir($path)
{
global $dir,$webdir,$lvl,$amt_mp,$amt_alb,$file_array,$numfl,$band,$album;
$lvl--;
$handle = opendir($path);
while (false !== ($file = readdir($handle))) {
if ($file !=".." && $file !=".")
{
if ( is_dir($path . $file))
{
//print "Level= $lvl ";
if ($lvl==2) {
//print "$file ";
$band = $file;
}
if ($lvl==1 || $first) {
//print "$file ";
$album = $file;
}
if ($lvl < 1) {
$lvl=2;
$band = $file;
}
$newpath = $path . "/" . $file . "/";
listdir($newpath);
$lvl++;
}
else
{
$amt_mp++;
if (ereg(".mp3",$file))
{
$numfl++;
$n_file = ereg_replace($dir, "", $path). $file;
$n_file = str_replace ("//","/",$n_file);
$n_file = rawurlencode($n_file);
$dl_file = "/download.php?file=" . $n_file;
$file_array[$numfl]['band']=$band;
$file_array[$numfl]['path']=$n_file;
$file_array[$numfl]['title']=$file;
$file_array[$numfl]['url']=$dl_file;
$file_array[$numfl]['album']=$album;
}
}
}
}
}
$dir = "/var/www/flap/htdocs/music/";
$webdir = "music/";
listdir($dir);
print " There are currently $amt_mp MP3s available for download. ";
sort ($file_array);
reset ($file_array);
?>
$i=0;
$j=1;
while(list($key,$val)=each($file_array)){
if ($currentband != $file_array[$i]['band'] ){
print "" . $file_array[$i]['band'] . " ";
}
if ($currentalbum != $file_array[$i]['album'] ){
print " " . $file_array[$i]['album'] . " ";
}
$currentband = $file_array[$i]['band'];
$currentalbum = $file_array[$i]['album'];
$i++;
}
?>
|