From 8aad3ae25b7dbf5250ea4bae4eb0cbd0eafda15f Mon Sep 17 00:00:00 2001 From: james Date: Fri, 14 Jan 2005 19:44:37 +0000 Subject: [PATCH] Logo image uploader --- config/images.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 config/images.php diff --git a/config/images.php b/config/images.php new file mode 100644 index 0000000..15af3bf --- /dev/null +++ b/config/images.php @@ -0,0 +1,54 @@ +<< ".i18n("Back to Configuration")."
"; + +if($_POST['action']=="addimage") +{ + if($_FILES['image']['error']==UPLOAD_ERR_OK) + { + //make sure its a JPEG + $imagesize=getimagesize($_FILES['image']['tmp_name']); + if($imagesize[2]==1 || $imagesize[2]==2 || $imagesize[2]==3) // GIF or JPG or PNG + { + echo notice(i18n("Creating sized logo files:
 logo-100.gif
 logo-200.gif
 logo-500.gif
 logo.gif")); + system("convert -sample 100 \"".$_FILES['image']['tmp_name']."\" ../data/logo-100.gif"); + system("convert -sample 200 \"".$_FILES['image']['tmp_name']."\" ../data/logo-200.gif"); + system("convert -sample 500 \"".$_FILES['image']['tmp_name']."\" ../data/logo-500.gif"); + system("convert \"".$_FILES['image']['tmp_name']."\" ../data/logo.gif"); + echo happy(i18n("Logo Image successfully uploaded")); + } + else + { + echo error(i18n("Logo Image must be JPG, GIF or PNG")); + } + } + else + echo error(i18n("Error uploading Logo Image").": ".$_FILES['image']['error']); +} + + + echo "
"; + echo "\n"; + echo "

Fair Logo Image

"; + echo ""; + if(file_exists("../data/logo.gif")) + { + echo ""; + } + echo ""; + echo "
"; + echo ""; + echo ""; + echo "Original size
"; + echo "100 Pixel width
"; + echo "200 Pixel width
"; + echo "500 Pixel width
"; + echo "
"; + echo ""; + echo "\n"; + echo "
"; + echo "
"; + + send_footer(); +?>