기본 스킨의 겔러리 스킨에서 업로드하는 모든 파일 썸네일 이미지 생성

http://sir.co.kr/bbs/tb.php/g4_skin_basic/4
스킨에 보면... write_update.skin.php 파일의 일부 인데요...
이 소스가 썸네일 파일을 $wr_id 명으로 하나만 생성하게되는데요...

아래소스를 사용해서 업로드 되는 모든 파일의 썸네일 이미지를 만드려고 합니다...

어떻게 수정을 해야할지...

if ($_FILES[bf_file][name][0])
{
$row = sql_fetch(" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '0' ");

$file = $data_path .'/'. $row[bf_file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $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 = $board[bo_1] / $size[0];
$height = (int)($size[1] * $rate);

@unlink($thumb_path.'/'.$wr_id);
$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.'/'.$wr_id, $board[bo_2]);
chmod($thumb_path.'/'.$wr_id, 0606);
}
}
|

댓글 1개

bbs/write_update.php 화일 내
171행에 썸네일 생성부분을 include 시키면 되겟네요
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
20년 전 조회 1,609
20년 전 조회 1,471
20년 전 조회 1,659
20년 전 조회 1,598
20년 전 조회 1,546
20년 전 조회 1,533
20년 전 조회 1,238
20년 전 조회 1,638
20년 전 조회 1,554
20년 전 조회 1,667
20년 전 조회 1,635
20년 전 조회 1,541
20년 전 조회 1,534
20년 전 조회 1,545
20년 전 조회 1,682
20년 전 조회 2,765
20년 전 조회 1,550
20년 전 조회 1,666
20년 전 조회 1,840
20년 전 조회 1,538