From cce5e7710295021b41d9aaecc503a60fb99256be Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 4 Oct 2008 10:38:03 +0000 Subject: Initial revision --- utils/admin_gallery.php | 108 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 utils/admin_gallery.php (limited to 'utils/admin_gallery.php') diff --git a/utils/admin_gallery.php b/utils/admin_gallery.php new file mode 100644 index 0000000..b584229 --- /dev/null +++ b/utils/admin_gallery.php @@ -0,0 +1,108 @@ +

Gallery

+ + + +"; + echo $albumcopyright . "
"; + echo $albumdir . "
"; + mkdir($albumdir); + $xml = "\n"; + $xml .= "\n"; + $xml .= "\n"; + $fp = fopen($albumdir . "/album.xml", "w"); + fprintf($fp, $xml); + fclose($fp); +} +?> + +"; + echo $description . "
"; + echo $_FILES['userfile']['tmp_name'] . "
"; + + if($_FILES['userfile']['tmp_name'] != "") { + echo "Filename [". $_FILES['userfile']['tmp_name'] . "]"; + if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { + echo "File ". $_FILES['userfile']['name'] ." uploaded successfully.\n"; + + $outputfile = time() . ".jpg"; + + $image = imagecreatefromjpeg($_FILES["userfile"]["tmp_name"]); + list($w, $h) = getimagesize($_FILES["userfile"]["tmp_name"]); + + // output size and quality + $quality = 80; + + $max = 530; + + $width = 530;; + $height = 380; + + if($w > $h) { + $width = 530; + $height = 530 / $w * $h; + } else { + $height = 530; + $width = 530 / $h * $w; + } + $image_p = imagecreatetruecolor($width, $height); + imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $w, $h); + imagejpeg($image_p, $ALBUMS_DIR ."/" .$album ."/" .$outputfile, $quality); + + $photo = new Photo($outputfile, $description); + $album = new Album($album); + $album->add($photo); + $album->write(); + + } else { + echo "Possible file upload attack: "; + echo "filename '". $_FILES['userfile']['tmp_name'] . "'."; + } + } +} +?> + +
New album
+
+

+ Title: +

+

+ Copyright: +

+

+ +

+
+ +
Upload image
+
+

+ Album: + +

+

+ Description: + +

+

+ Upload this image: + +

+

+ +

+
-- cgit v1.2.3