\n"; echo "\n"; echo " \n"; echo " \n"; echo " index\n"; echo " \n"; echo " \n"; echo "
\n"; /* The $img_src variable is there in case this index appears in a directory * of images that are too large for practical display all at once in a web * browser; instead, clickable images will come from the subdirectory that * $img_src points to. */ $img_src="."; /* need a limit on the size of image to attempt to display */ $i_max_dim="320"; $d_count=0; // counter for directories array $f_count=0; // for files $i_count=0; // for images $handle=opendir("."); while (false !== ($file = readdir($handle))) { if ($file != ".") { if (is_dir($file)) { $d_name[$d_count]=$file; $d_count=++$d_count; } else { $i_size=GetImageSize($file); if ($i_size[3] =="") { $f_name[$f_count]=$file; $f_count=++$f_count; } else { $i_name[$i_count]=$file; $i_count=++$i_count; } } } } closedir($handle); if (sizeof($d_name) > 0) { sort($d_name); } if (sizeof($f_name) > 0) { sort($f_name); } if (sizeof($i_name) > 0) { sort($i_name); } echo " directories
\n"; for ($count=0; $count < sizeof($d_name); $count++) { echo " DIR> "; echo "[ $d_name[$count] ]
\n"; } echo "
\n"; echo " files
\n"; for ($count=0; $count < sizeof($f_name); $count++) { echo " $f_name[$count]
\n"; } echo "
\n"; echo " images
\n"; for ($count=0; $count < sizeof($i_name); $count++) { echo " "; $i_size=GetImageSize($i_name[$count]); // comment out from here... if ($i_size[0] > $i_max_dim or $i_size[1] > $i_max_dim) { $i_width=$i_max_dim; } else { $i_width=$i_size[0]; } echo "\"$i_name[$count]\"\n";\n"; // ... to here, if you want only names and sizes of images displayed echo " full-size: $i_size[3]
\n"; } echo "
\n"; echo " \n"; echo "\n"; ?>