3 or ($member_db[1] != 1 and $action == "doimagedelete")){ msg("error", "Access Denied", "You don't have permission to manage images"); } $allowed_extensions = array("gif", "jpg", "png", "bmp", "jpe", "jpeg"); // ******************************************************************************** // Show Images List // ******************************************************************************** if($action != "doimagedelete") { if($action == "quick") { echo" Insert Image "; }else{ echoheader("images","Manage Images"); } if($subaction == "upload") { if(!$image){ $image = $HTTP_POST_FILES['image']['tmp_name']; } if(!$image_name){ $image_name = $HTTP_POST_FILES['image']['name']; } $image_name = str_replace(" ", "_", $image_name); $img_name_arr = explode(".",$image_name); $type = end($img_name_arr); if($image_name == ""){ $img_result = "
No File Specified For Upload !!!"; } elseif(file_exists($config_path_image_upload."/".$image_name)){ $img_result = "
Image already exist !!!";} elseif( !(in_array($type, $allowed_extensions) or in_array(strtolower($type), $allowed_extensions)) ){ $img_result = "
This type of file is not allowed !!!"; } else { @copy($image, $config_path_image_upload."/".$image_name) or $img_result = "Couldn't copy image to server
Check if file_uploads is allowed in the php.ini file of your server"; if(file_exists($config_path_image_upload."/".$image_name)) { $img_result = "
Image was uploaded"; }//if file is uploaded succesfully } } echo"
Upload Image
   $img_result
Uploaded Images "; $img_dir = opendir($config_path_image_upload); $i = 0; while ($file = readdir($img_dir)) { if ($file != ".." and $file != "." and is_file($config_path_image_upload."/".$file)) { $i++; $this_size = filesize($config_path_image_upload."/".$file); $total_size += $this_size; $img_info = getimagesize($config_path_image_upload."/".$file); if( $i%2 != 0 ){ $bg = "class=\"alternate\""; } else{ $bg = ""; } if($action == "quick") { $my_area = str_replace("_", " ", $area); echo" "; } else { echo""; } } } if($i > 0){ echo''; } echo'
  $file $img_info[0]x$img_info[1]  ". formatsize($this_size) ."
  $file $img_info[0]x$img_info[1]  ". formatsize($this_size) ."  [delete]  
 
Total size
 
'. formatsize($total_size) .'
'; if($action != "quick"){ echofooter(); } } // ******************************************************************************** // Delete Image // ******************************************************************************** elseif($action == "doimagedelete") { if(!file_exists($config_path_image_upload."/".$image) or !$image){ msg("error","Error !!!","Could not delete image", "$PHP_SELF?mod=images"); } unlink($config_path_image_upload."/".$image) or msg("error","Error !!!","Could not delete image", "$PHP_SELF?mod=images"); msg("info","Image Deleted","The image was successfully deleted.", "$PHP_SELF?mod=images"); } ?>
Historical archive. This is a preserved copy of 36 Degrees Design (2005–2008), the early web-design weblog of Stuart Frisby. It is maintained independently as a piece of web history and is not operated by, affiliated with, or endorsed by Stuart Frisby. If you are the original owner and would like this domain returned, get in touch — it’s yours, no fuss.
Article Archive