"", "file" => "tsarchive.gif"); //Only MP3 supported for now $audio_types = array(".mp3", "link" => "index.php?nav=7&post=", "file" => "tsaudio.gif"); $video_types = array(".ogv", "link" => "index.php?nav=8&post=", "file" => "tsmovie.gif"); $image_types = array(".bmp",".gif",".jpg",".jpeg",".png",".ico",".svg",".xpm", "link" => "index.php?nav=9&post=", "file" => "tsimage.gif"); $schematic_types = array(".dwg",".dxf",".cad",".gcode",".mcode", "link" => "", "file" => "tsschematic.gif"); $model_types = array(".stl",".blend",".3ds", "link" => "", "file" => "tsmodel.gif"); $binary_types = array(".exe",".o",".dll",".so",".jnilib",".a",".bin",".hex", "link" => "", "file" => "tssoftware.gif"); $code_types = array(".py",".c",".h",".js",".php",".tcl",".m",".txt", "link" => "index.php?nav=6&post=", "file" => "tscode.gif"); $doc_types = array(".htm",".html",".post", "link" => "index.php?nav=5&post=", "file" => "tsdoc.png"); $legacy_types = array(".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pages",".ai",".psd",".tiff",".tif",".eps",".ps",".xps", "link" => "index.php?nav=10&post=", "file" => "tsprop.png"); $mime_types = array($arch_types,$audio_types,$video_types,$image_types,$schematic_types,$model_types,$binary_types,$code_types,$doc_types,$legacy_types); //Find the directory contents $ls = @scandir($pwd, 1); // $dlist = array_filter($ls,function ($a) {return is_dir($a);}); $dban1 = '.'; $dban2 = '..'; $dkey = array_search($dban1,$ls); if ($dkey!==false){unset($ls[$dkey]);}; $dkey = array_search($dban2,$ls); if ($dkey!==false){unset($ls[$dkey]);}; //See if this directory is even there if (@in_array($test[0], $check)) { echo 'Directory listing for '.$pwd; echo '