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

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,579
20년 전 조회 1,445
20년 전 조회 1,628
20년 전 조회 1,562
20년 전 조회 1,509
20년 전 조회 1,507
20년 전 조회 1,209
20년 전 조회 1,608
20년 전 조회 1,526
20년 전 조회 1,636
20년 전 조회 1,594
20년 전 조회 1,514
20년 전 조회 1,499
20년 전 조회 1,511
20년 전 조회 1,643
20년 전 조회 2,715
20년 전 조회 1,517
20년 전 조회 1,636
20년 전 조회 1,802
20년 전 조회 1,506
🐛 버그신고