"; $uploaddir = "./$photo_folder/$folder/"; if (chdir("$uploaddir")) { } else { echo "

Please create the directory first

"; exit; } $dir = opendir("."); foreach($userfile as $tagname=>$object) { echo "$tagname = $object
"; if ($object) { // get the temporary name (e.g. /tmp/php34634.tmp) $tempName = $_FILES['userfile']['tmp_name'][$tagname]; // get the real filename $realName = $_FILES['userfile']['name'][$tagname]; // where to save the file? $target = $realName; // print something to the user echo "
Processing file $realName...\n"; flush(); // move the file to the target directory move_uploaded_file($tempName,$target); // Spectial File Processing $file = $realName; createthumb("$file","tn_".$file,135,135); $watermark = "../../watermark.png"; $quality = "75"; createthumb("$file",$file,500,500); if ($watermark_option == "yes") { watermark($file, $file, $watermark, $quality); } $queryb="SELECT * FROM `$event_id` WHERE image='$file'"; $resultb=mysql_query($queryb); $numb=mysql_num_rows($resultb); if ($numb) { echo "

Image Replaced

"; } else { $query = mysql_query("INSERT INTO `$event_id` ( `folder`, `image`, `image_cat`) VALUES ('$folder', '$file', '$image_category');") or die (mysql_error()); echo "

Image Added


"; } echo "next file...
"; flush(); } flush(); } } ?>
Upload One Photo to the Event
Image should be no larger then 150kb. If the file already exists with the same name, it will be replaced. Otherwise a new file will be added to this event.
Upload this Photo: Category WaterMark
";
Please allow up to 2 minutes for image uploading and processing
$old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x < $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); if (preg_match("/png/",$system[1])){ imagepng($dst_img,$filename); } else { imagejpeg($dst_img,$filename); } imagedestroy($dst_img); imagedestroy($src_img); } ?>