\r\n";
print "
Media\r\n";
print "
";
print "
{$subdir}\r\n";
print "
";
$dir_handle = @opendir($dir);
if (!$dir_handle)
{
print "Unable to open $dir";
}
else while ($medianame = readdir($dir_handle))
{
if($medianame == "." || $medianame == ".." || $medianame == 'lost+found')
continue;
$medianame2=addslashes($medianame);
// Directories
if (is_dir($dir ."/" .$medianame))
{
print "\r\n";
print "
\r\n";
}
else
{
// Get file extension
$fileext = end(explode(".", $medianame));
// Check if it is supported
if ( preg_match("'" .$fileext ." '", $videotypes)
|| preg_match("'" .$fileext ." $'", $videotypes)
)
{
print "\r\n";
print "
\r\n";
}
}
}
$updir = dirname($dir);
print "
\r\n";
if ($dir_handle)
closedir($dir_handle);
print "
\r\n";
?>