= 1024) { $size /= 1024; $pos++; } return round($size,2)." ".$a[$pos]; } function build_image($img){ list($x, $y) = getimagesize($img); $imgweight = imageweight($img); if (file_exists("$img.txt")) {$comment = file_get_contents("$img.txt");} else {$comment = "No comment was found";} if ($x > $y) { $factor = $y / $x; $x2 = 150; $y2 = 150 * $factor; } else { $factor = $x / $y; $y2 = 150; $x2 = 150 * $factor; } echo ""; echo "\n"; } $picturecount = 0; $dir_handle = @opendir("$gallerybase$gallery") or die("The \"$gallery\" gallery does not exist."); while ($file = readdir($dir_handle)) { if ($file != "." and $file != ".." and substr($file, -4, 4) != ".txt") { build_image("$gallerybase$gallery/$file"); $picturecount = $picturecount + 1; } } closedir($dir_handle); if ($picturecount == 0) { echo ""; } else if ($picturecount == 1) { echo ""; } else { echo ""; } ?>
"; echo ""; echo ""; echo "

$img

"; echo "

Comment: $comment

Dimensions: $x x $y

Bytes: $imgweight

This gallery is empty
There is 1 picture in this gallery
There are $picturecount pictures in this gallery