$image_attr[1]) { $image_width = $image_attr[0]; $image_height = $image_attr[1]; $image_new_width = $max_side; $image_ratio = $image_width/$image_new_width; $image_new_height = $image_height/$image_ratio; //width is > height } else { $image_width = $image_attr[0]; $image_height = $image_attr[1]; $image_new_height = $max_side; $image_ratio = $image_height/$image_new_height; $image_new_width = $image_width/$image_ratio; //height > width } if (function_exists('gd_info')) { $gdver=gd_info(); if(strstr($gdver["GD Version"],"1.")!=false){ //For GD $thumbnail = imagecreate($image_new_width, $image_new_height); }else{ //For GD2 $thumbnail = imagecreatetruecolor($image_new_width, $image_new_height); } } else { if (function_exists('imagecreatetruecolor')) { $thumbnail = @imagecreatetruecolor($image_new_width, $image_new_height); } if (!$thumbnail) { $thumbnail =imagecreate($image_new_width, $image_new_width); } } @imagecopyresized($thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1]); // move the thumbnail to it's final destination $path = explode('/', $file); $thumbpath = substr($file, 0, strrpos($file, '/')) . '/thumb-' . $path[count($path)-1]; if($type[2] == 1) { if(!imagegif($thumbnail, $thumbpath)) { $error = "Thumbnail path invalid"; } } elseif($type[2] == 2) { if(!imagejpeg($thumbnail, $thumbpath)) { $error = "Thumbnail path invalid"; } } elseif($type[2] == 3) { if(!imagepng($thumbnail, $thumbpath)) { $error = "Thumbnail path invalid"; } } } } if(!empty($error)) { return $error; } else { return 1; } } ?>
()
KB
filename '' moved to ''
"; die(); } if (!strlen($imgalt)) { @$moved = move_uploaded_file($img1, $pathtofile); //Path to your images directory, chmod the dir to 777 // move_uploaded_file() can fail if open_basedir in PHP.INI doesn't // include your tmp directory. Try copy instead? if(!$moved) { $moved = copy($img1, $pathtofile); } // Still couldn't get it. Give up. if (!$moved) { die("Couldn't Upload Your File to $pathtofile."); } else { chmod($pathtofile, 0666); @unlink($img1); } } else { rename($img1, $pathtofile) or die("Couldn't Upload Your File to $pathtofile."); } if(($_POST['thumbsize'] != 'none')&&($_POST['thumbsize'] != 'icon')) { if($_POST['thumbsize'] == 'small') { $max_side = 200; } elseif($_POST['thumbsize'] == 'large') { $max_side = 400; } elseif($_POST['thumbsize'] == 'custom') { $max_side = intval($_POST['imgthumbsizecustom']); } $result = wp_create_thumbnail($pathtofile, $max_side, NULL); if($result != 1) { print $result; } } $img_prefix = 'thumb-'; if ($_POST['associate'] == 'amazon') { $asin = explode(".", $img1_name); $piece_of_code = "<a href="http://www.amazon.co.jp/exec/obidos/ASIN/$asin[0]/$amazon_id" target="_blank"><img style="float: left; margin: 0 10px 0 0;" src="". get_settings('fileupload_url') ."/$img1_name" border="0" alt="$imgdesc" /></a>"; } elseif ($_POST['thumbsize'] == 'icon') { $piece_of_code = "<a style="float: left; margin: 0 10px 0 0;" href="". get_settings('fileupload_url') . "/$img1_name">" . "<img src="". $siteurl ."/wp-images/file.gif" alt="$imgdesc" />" .$img1_name. "(".$fsize."KB)</a>"; } elseif ( ereg('image/',$img1_type) && $_POST['thumbsize'] != 'none') { $piece_of_code = "<a style="float: left; margin: 0 10px 0 0;" href="". get_settings('fileupload_url') . "/$img1_name">" . "<img src="". get_settings('fileupload_url') ."/$img_prefix$img1_name" alt="$imgdesc" />" . "</a>"; } else { $piece_of_code = "<img src="". get_settings('fileupload_url') . "/$img1_name" alt="$imgdesc" />"; } ?>Image Details:
Name:
Size:
KB
Type: