diff --git a/images/filetype_AUDIO.png b/images/filetype_AUDIO.png new file mode 100644 index 0000000..dad291d Binary files /dev/null and b/images/filetype_AUDIO.png differ diff --git a/images/filetype_OGV.png b/images/filetype_OGV.png deleted file mode 100644 index 577e277..0000000 Binary files a/images/filetype_OGV.png and /dev/null differ diff --git a/images/filetype_VIDEO.png b/images/filetype_VIDEO.png new file mode 100644 index 0000000..b4610da Binary files /dev/null and b/images/filetype_VIDEO.png differ diff --git a/index.php b/index.php index d45fa05..24c667c 100644 --- a/index.php +++ b/index.php @@ -103,20 +103,20 @@ function readEXIF($file) { $emodel = $exif_idf0['Model']; $efocal = $exif_idf0['FocalLength']; - //Next is only cosmectic need but give an error due to division by zero + //Next is only cosmectic need but give an error due to division by zero //list($x,$y) = preg_split('/', $efocal); //$efocal = round($x/$y,0); - + $exif_exif = exif_read_data ($file,'EXIF' ,0 ); $eexposuretime = $exif_exif['ExposureTime']; - + $efnumber = $exif_exif['FNumber']; //Next is only cosmectic need but give an error due to division by zero //list($x,$y) = preg_split('/', $efnumber); //$efnumber = round($x/$y,0); $eiso = $exif_exif['ISOSpeedRatings']; - + $exif_date = exif_read_data ($file,'IFD0' ,0 ); $edate = $exif_date['DateTime']; if (strlen($emodel) > 0 OR strlen($efocal) > 0 OR strlen($eexposuretime) > 0 OR strlen($efnumber) > 0 OR strlen($eiso) > 0) $exif_data .= "::"; @@ -171,7 +171,7 @@ $dirs = array(); { // 1. LOAD FOLDERS if (is_directory($currentdir . "/" . $file)) - { + { if ($file != "." && $file != ".." ) { checkpermissions($currentdir . "/" . $file); // Check for correct file permission @@ -201,15 +201,15 @@ $dirs = array(); } } } - } + } // 2. LOAD CAPTIONS $img_captions['']=''; if (file_exists($currentdir ."/captions.txt")) { $file_handle = fopen($currentdir ."/captions.txt", "rb"); - while (!feof($file_handle) ) - { + while (!feof($file_handle) ) + { $line_of_text = fgets($file_handle); if (empty($line_of_text)) { continue; @@ -217,7 +217,7 @@ if (file_exists($currentdir ."/captions.txt")) $parts = explode('/n', $line_of_text); foreach($parts as $img_capts) { - list($img_filename, $img_caption) = explode('|', $img_capts); + list($img_filename, $img_caption) = explode('|', $img_capts); $img_captions[$img_filename] = $img_caption; } } @@ -280,8 +280,10 @@ if (file_exists($currentdir ."/captions.txt")) if (preg_match("/.doc$|.docx$/i", $file)) $extension = "DOCX"; // Word if (preg_match("/.ppt$|.pptx$/i", $file)) $extension = "PPTX"; //Powerpoint if (preg_match("/.xls$|.xlsx$/i", $file)) $extension = "XLXS"; // Excel - if (preg_match("/.ogv$/i", $file)) $extension = "OGV"; // OGV video - + if (preg_match("/.ogv$|.mp4$|.mpg$|.mpeg$|.mov$|.avi$|.wmv$|.flv$|.webm$/i", $file)) $extension = "VIDEO"; // video files + if (preg_match("/.aiff$|.aif$|.wma$|.aac$|.flac$|.mp3$|.ogg$|.m4a$/i", $file)) $extension = "AUDIO"; // audio files + + if ($extension != "") { $files[] = array ( @@ -290,7 +292,7 @@ if (file_exists($currentdir ."/captions.txt")) "size" => filesize($currentdir . "/" . $file), "html" => "