";
}
else $ing="";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
/* rate 계산,, 썸네일은 가로 정렬임으로 세로가 동일해야 함 */
/*
$rate = $board[bo_1] / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($board[bo_1], $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_2]);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
*/
$rate = $board[bo_2] / $size[1];
$width = (int)($size[0] * $rate);
//echo "rate : $rate ,width : $width, $height : $board[bo_2]
";
if($width <= $board[bo_1]) { //width가 지정된 사이즈보다 작을경우 rate 비율로 썸네일 생성
$dst = imagecreatetruecolor($width, $board[bo_2]);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $board[bo_2], $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_2]);
} else {
$rate = $board[bo_1] / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($board[bo_1], $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_2]);
}
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
$photo_view = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (file_exists($thumb)){
$img = " ";
}
$title = "클릭하시면 해당 사이트로 이동합니다.";
$content = cut_str(get_text($list[$i][wr_content]), 80);
//$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
//if (!file_exists($img) || !$list[$i][file][0][file])
if ( !$list[$i][file][0][file])
$img = " ";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&no=1";
$view_href = "";
//if ($is_admin)
$view_href = "";
$checkbox = "";
if ($is_checkbox)
$checkbox = " ";
if($list[$i][wr_2]) $btimg_dc=" ";
else $btimg_dc="";
$btimg_order="$board_skin_path/img/bt_order.gif";
$btimg_view="$board_skin_path/img/bt_view.gif";
$order_href="";
$tr = "";
if ($i && $i%$board[bo_gallery_cols]==0)
$tr = "
$subject = "<span $style>".cut_str($list[$i][subject],$board[bo_subject_len])."</span>";