\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)
{
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++)
{
// Audio
if (mediagettype($mediapath .$subdir .$medianame_array[$cnt]) == 2)
{
print "
\r\n";
print " \r\n";
print " $idx{$medianame_array[$cnt]}\r\n";
print " \r\n";
print " \r\n";
$idx++;
}
}
print("
");
print "