function thumb_img2_1($src, $width, $height, $save_file) { $get_size = getImageReSize($width, $height, imagesx($src), imagesy($src)); //$thumb = ImageCreate($get_size[0],$get_size[1]); $thumb = imagecreatetruecolor($get_size[0], $get_size[1]); // ImageCopyResized($thumb,$src,0,0,0,0,$get_size[0],$get_size[1],ImageSX($src),ImageSY($src)); imageCopyResampled($thumb, $src, 0, 0, 0, 0, $get_size[0], $get_size[1], ImageSX($src), ImageSY($src)); ImagePNG($thumb, $save_file); ImageDestroy($thumb); }
function getUserImage4($user_id, &$conn, $align = "left", $detail = "Y", $tbl_align = "center") { global $save_dir; global $USERHOME; $img_src = "http://cocophoto.bebero.com/bebero/comm/basic_img/pic_no.gif"; $add_location = ""; $class_id = substr("{$user_id}", 0, 1); $t_home_album = "tbl_home_album" . "_" . "{$class_id}"; $sql = "select * from {$t_home_album} where search_fg=1 and user_id='{$user_id}'"; $img_info = getObjectSQL2($sql, $conn); $img_size_info[0] = 100; $img_size_info[1] = 121; if ($img_info) { if ($img_info[dir]) { $add_location = "{$img_info['dir']}/"; } $photo_dir = substr("{$img_info['file']}", 0, 1); $src = "{$save_dir}/album2/" . $add_location . "/" . $photo_dir . "/" . $img_info[file]; $img_src = "http://cocophoto.bebero.com/upload_home/album2/" . $add_location . "/" . $photo_dir . "/" . $img_info[file]; /* $src = "../../home/upload/album2/".$add_location.$img_info[file]; $img_src = "../../upload_home/album2/".$add_location.$img_info[file]; */ $size = 130; $gsize = getimagesize($src); $img_size_info = null; $img_size_info = getImageReSize($size, $size, $gsize[0], $gsize[1]); } $sql = "select homepage from tbl_members where user_id='{$user_id}'"; $home_fg = getOneDataSQL2($sql, $conn); if ($home_fg != 9) { $url_home = "<a href=\"{$USERHOME}{$user_id}\" target=\"_blank\">"; } else { $url_home = ""; } $returned = "{$url_home}<img src='{$img_src}' width='{$img_size_info['0']}' height='{$img_size_info['1']}' border=0 style=\"border-color:EEEEEE\" align='{$align}'></a>"; /* if($detail == "Y") { $header = "<table align=$tbl_align cellspacing=0 cellpadding=0 border=0>"; $header.= " <tr>"; $header.= " <td align=center>"; $footer = "</td>"; $footer.= " </tr>"; $footer.= " <tr>"; $footer.= " <td align=center class=webzizon><font color='#939067'>["; $footer.= getBabyDays($user_id, date("Y-m-d"), $conn); $footer.= "] "; $footer.= getBabyName($user_id, $conn); $footer.= "</font></td>"; $footer.= " </tr>"; $footer.= "</table>"; } else { $header = ""; $footer = ""; } */ return $returned; }