$current_dir_clr = "#666666"; $list_columns = 4; $min_to_split = 10; // Minimum # of files before columsn are split // BEGIN // Read dir and assign... for IMAGES $i = -1; // -1 becuz i'll ++ it and i need it at 0 while (($file = readdir($handle))!==false) { $i++; // ...assign the current file name to an array member... if (!is_dir($file)) { if ((strstr($file, ".gif")) or (strstr($file, ".jpg"))) { if (($file != ".") && ($file != "..")) { $list_img_files[$i] = $file; } }} } $current_dir = basename(getcwd()); closedir($handle); sort($list_img_files); // Sort the array which now has all the files in it... $img_total = count($list_img_files); for ($i = 0; $i < $img_total; $i++) { $list_img_size[$i] = filesize($list_img_files[$i]); if ($list_img_size[$i] == 0) $list_img_size[$i] = 1; } // Read dir and assign... for OTHER FILES $i = -1; // -1 becuz i'll ++ it and i need it at 0 while (($file2 = readdir($handle2))!==false) { $i++; // ...assign the current file name to an array member... if (!is_dir($file2)) { if ((!strstr($file2, ".jpg")) && (!strstr($file2, ".gif"))) { if (($file2 != ".") && ($file2 != "..")) { $list_other_files[$i] = $file2; } }} } closedir($handle2); sort($list_other_files); // Sort the array which now has all the files in it... $other_total = count($list_other_files); for ($i = 0; $i < $other_total; $i++) { $list_other_size[$i] = filesize($list_other_files[$i]); if ($list_other_size[$i] == 0) $list_other_size[$i] = 1; } echo "
|
IMAGE FILES IN " . strtoupper($current_dir) . "" ?> |
|||
|
$img_no. \n";
if ($list_img_files[$i] == $src) echo "$list_img_files[$i] ($img_size) \n"; else { echo "$list_img_files[$i] ($img_size) \n"; } if ($img_total > $min_to_split) { if (($i+1) % (intval($img_total / ($list_columns - 1))) == 0) { echo " | \n"; } } } ?> | ||
|
OTHER FILES IN " . strtoupper($current_dir) . "" ?>
|
|||
|
$other_no. \n";
if ($list_other_files[$i] == $src) echo "$list_other_files[$i] ($other_size) \n"; else { echo "$list_other_files[$i] ($other_size) \n"; } if ($other_total > $min_to_split) { if (($i + 1) % (intval($other_total / ($list_columns - 1))) == 0) { echo " | \n"; } } } ?> | ||