$now_time = time();
for ( $i=0;$i<=2 ;$i++ ) { if( $img[$i] != "" ){ // ÆÄÀÏüũ $src_name = explode(".",$img_name[$i]); $f_name = strtolower($src_name[0]); //ÆÄÀϸí $f_ext = strtolower($src_name[1]); //È®ÀåÀÚ $img_size = round($img_size[$i] / 1024); foreach ($pic_ok_ext as $list){ if ($f_ext == $list){ $check_ext_name = "1"; } $ext_name_view .= "$list "; }
if ( $check_ext_name != '1' ) { error("È®Àå¸íÀÌ $ext_name_view "."À̹ÌÁö ÆÄÀϸ¸ °¡´ÉÇÕ´Ï´Ù."); }
if ( $img_size >= $max_file_size ) { error("$max_file_size"."k ÆÄÀÏ »çÀÌÁî ÃÊ°úÀÔ´Ï´Ù."); } $img_url_re = "com[$i]".$now_time.$img_name[$i]; if (copy($img[$i],"$ADMIN[admin_etc1]/$img_url_re")){
if ($gi_joon && eregi('.jpg',$img_url_re) ) { #½æ³×ÀÏÀ» ¸¸µé¾îº¸ÀÚ $imagehw = GetImageSize("$ADMIN[admin_etc1]/$img_url_re"); $imagewidth = $imagehw[0]; $imageheight = $imagehw[1]; $new_height = $imageheight * $gi_joon[$i] / $imagewidth ; $new_height=ceil($new_height); $new_width = $gi_joon[$i]; $src = ImageCreateFromJPEG("$ADMIN[admin_etc1]/$img_url_re"); $thumb = ImageCreate($new_width,$new_height); $thumb = imagecreatetruecolor($new_width,$new_height); imagecopyresampled($thumb,$src,0,0,0,0,$new_width,$new_height,imagesx($src),imagesy($src)); /* #»õ À̹ÌÁö¿¡ ±ÛÀÚÀ§Ä¡ Á¤ÇÏÀÚ $y_location = $new_height - 5; $mycolor = "black"; $mark = "Copyright (C) " . "$main_url"; imageTTFtext($thumb, 10, 0, 5, $y_location, $mycolor, "./font/arial.ttf", $mark) ; */ ImageJPEG($thumb,"$ADMIN[admin_etc1]/$img_url_re"); ImageDestroy($thumb); }
unlink( $img[$i]);
} } }
#¾÷µ¥ÀÌÆ®½Ã ºóÆÄÀϸíÀº ¿¹ÀüÆÄÀÏ·Î $img_arr = array("$old_file0","$old_file1"); for ( $i=0; $i<=1; $i++ ) { if ( $img_name[$i] != "" ) { $file[$i] = "com[$i]".$now_time.$img_name[$i]; if (file_exists("$ADMIN[admin_etc1]/$old_file[$i]") && $old_file[$i] != "" ){ unlink("$ADMIN[admin_etc1]/$old_file[$i]"); } } else { $file[$i] = $img_arr[$i]; } }
if ($img_name[0] == "" && $img_name[1] == ""){ error('¾÷µ¥ÀÌÆ®µÉ À̹ÌÁö°¡ ¾ø½À´Ï´Ù.'); exit; }
|