\r\n";
print "
\r\n";
$dir_handle = @opendir($mediapath .$subdir);
if (!$dir_handle)
print "Unable to open $mediapath .$subdir";
else while ($medianame = readdir($dir_handle))
{
// Add only mp3 files and dirs
if($medianame == "." || $medianame == ".." || $medianame == 'lost+found')
continue;
$type = mediagettype($mediapath .$subdir .$medianame);
if (($type != 2) && ($type != 3))
continue;
$medianame_array[] = $medianame;
}
if ($medianame_array[0])
{
// Alphabetical sorting
sort($medianame_array);
$count = count($medianame_array);
for ($cnt=0; $cnt < $count; $cnt++)
{
// Dirs
if (mediagettype($mediapath .$subdir .$medianame_array[$cnt]) == 3)
{
$medianame2=addslashes($medianame_array[$cnt]);
print " - \r\n";
print " \r\n";
print " {$medianame_array[$cnt]}>\r\n";
print " \r\n";
print "
\r\n";
print "
\r\n";
}
}
$idx = 1;
for ($cnt=0; $cnt < $count; $cnt++)
{
$medianame2=addslashes($medianame_array[$cnt]);
$mediapath2=addslashes($mediapath);
$subdir2=addslashes($subdir);
// Audio
if (mediagettype($mediapath .$subdir .$medianame_array[$cnt]) == 2)
{
print "
\r\n";
unset($track);
for ($cnt2=$cnt; $cnt2<$count; $cnt2++)
{
if (mediagettype($mediapath .$subdir .$medianame_array[$cnt2]) == 2)
$track[$cnt2-$cnt] = $httppath ."playlist/" .addslashes($medianame_array[$cnt2]);
}
$jsarray = php2js($track);
print " \r\n";
print " $idx{$medianame_array[$cnt]}\r\n";
print " \r\n";
print " \r\n";
$idx++;
}
}
print("
");
}
else
print "\r\n";
$upsubdir = dirname($subdir);
print "