0; $x-- ) { $html_dir = array_pop($dir_array) . "/" . $html_dir; } $html_dir = "/" . $html_dir; $html_dir = preg_replace("/\/$/", "", $html_dir); // get our smallest size file dir and make that the // thumbnail location while ( $var = readdir($inputarray) ) { if ( is_dir( $curdir . "/" . $var ) && ( $var != ".." && $var != "." ) && $var != "movies" ) { array_push( $dirarray, $var ); } } sort($dirarray); $thumbdir = $dirarray[0]; // get all files per resolution(directory), in simple array // foreach ( $dirarray as $dir ) { $dir_list = opendir( $curdir . "/" . $dir ); while ( $file = readdir( $dir_list ) ) { if ( !is_dir( $curdir . "/" . $dir . "/" . $file ) && $file != "index.php" ) { if ( $file == "." || $file == ".." ) { continue; } $filearray[$dir] = $filearray[$dir] . ":" . $html_dir . "/" . $dir . "/" . $file; } } } // // presentation time print (" " . $title . "
"); // // Make an array of all the picture crapola? each // element is the links to sub images of different sizes // foreach ( $dirarray as $dir ) { // grab the files/images as an array, sort that if ( $dir == "private" ) { continue; } $tmp_array = explode( ":", $filearray[$dir] ); sort( $tmp_array ); // set a counter and use that for the stuff inside // each data element, this is the linkage inside each // table element $x = 0; foreach ( $tmp_array as $image ) { // if the image is empty, skip it if ( $image == "" ) { continue; } // set the 'data_array' element for this $data_array[$x] .= "$dir percent sized image
\n\t\t\t"; $x++; } } // // Now, print out the table, hopefully // each image is the thumbnail image? // given $thumbdir and $filearray you know that // $filearray[$thumbdir] is the list of thumbs... go from there // $thumbs = explode(":", $filearray[$thumbdir] ); sort($thumbs); $col = 0; $img = 0; // set a initial tr line print ("\t\n"); foreach ( $thumbs as $image ) { // skip if image is "" if ( $image == "" ) { continue; }; // If the current Column is >= max width, // reset and write another row header if ( $col > $cols ) { $col = 1; print ("\n\t\n"); print ("\t\t

\n\t\t\t" . $data_array[$img] . "
\n"); $img++; } else { print ("\t\t
\n\t\t\t" . $data_array[$img] . "
\n"); $col++; $img++; } } ?>