에디터를 통해 그림을 올렸을 시, 썸네일 추출 방법? 정보
에디터를 통해 그림을 올렸을 시, 썸네일 추출 방법?본문
안녕하세요.
썸네일을 자동 생성하는 최신글 스킨을 쓰고 있는데요,
이미지 생성까지 소스는 다음과 같습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/thumb.lib.php");
include_once("./_common.php");
/******설정**************/
if (!$board[bo_1]) $board[bo_1]=102; //목록 썸네일 가로
if (!$board[bo_2]) $board[bo_2]=76; //목록 썸네일 세로
if (!$board[bo_3]) $board[bo_3]=99; //해상도
/******설정**************/
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 최신글입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$mod = $board[bo_gallery_cols];
$td_width = (int)(99 / $mod);
$sql="select * from {$g4['board_file_table']} where bo_table='$bo_table' and bf_file !='' order by bf_datetime asc limit 1 ";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$file=$data_path .'/'. $row[bf_file];
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
$list[$i]['bo_table'] = $board['bo_table'];
$thumb = $g4[path]."/data/file/" .$list[$i][bo_table]. "/thumbnail/" .$list[$i][wr_id];
if($row[bf_file]){
$img="<a href='{$g4[bbs_path]}/board.php?bo_table={$bo_table}&wr_id={$row[wr_id]}'><img src='".thumbnail($file,$board[bo_1],$board[bo_2])."' border='0' style='border:1px solid #333333'></a>";
} else{
$img="<img src='".$latest_skin_path."/img/noimg.gif' border='0' style='border:1px solid #333333'>";
}
?>
그런데, 에디터를 통해 그림을 올렸을 때, 썸네일이 추출되지 않습니다.
위 썸네일 경로에서 .$list[$i][wr_id]. 부분이 추출되지 않아요. 걍 $wr_id 해도 안되구요.
뭐가 문제일까요.. 아시는 분 답변을 주시면 고맙겠습니다.
썸네일을 자동 생성하는 최신글 스킨을 쓰고 있는데요,
이미지 생성까지 소스는 다음과 같습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/thumb.lib.php");
include_once("./_common.php");
/******설정**************/
if (!$board[bo_1]) $board[bo_1]=102; //목록 썸네일 가로
if (!$board[bo_2]) $board[bo_2]=76; //목록 썸네일 세로
if (!$board[bo_3]) $board[bo_3]=99; //해상도
/******설정**************/
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 최신글입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$mod = $board[bo_gallery_cols];
$td_width = (int)(99 / $mod);
$sql="select * from {$g4['board_file_table']} where bo_table='$bo_table' and bf_file !='' order by bf_datetime asc limit 1 ";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$file=$data_path .'/'. $row[bf_file];
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
$list[$i]['bo_table'] = $board['bo_table'];
$thumb = $g4[path]."/data/file/" .$list[$i][bo_table]. "/thumbnail/" .$list[$i][wr_id];
if($row[bf_file]){
$img="<a href='{$g4[bbs_path]}/board.php?bo_table={$bo_table}&wr_id={$row[wr_id]}'><img src='".thumbnail($file,$board[bo_1],$board[bo_2])."' border='0' style='border:1px solid #333333'></a>";
} else{
$img="<img src='".$latest_skin_path."/img/noimg.gif' border='0' style='border:1px solid #333333'>";
}
?>
그런데, 에디터를 통해 그림을 올렸을 때, 썸네일이 추출되지 않습니다.
위 썸네일 경로에서 .$list[$i][wr_id]. 부분이 추출되지 않아요. 걍 $wr_id 해도 안되구요.
뭐가 문제일까요.. 아시는 분 답변을 주시면 고맙겠습니다.
댓글 전체
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=29882 참고 하시구요
에디터는 $list[$i]['wr_content'] 부분에서 추출합니다.
에디터는 $list[$i]['wr_content'] 부분에서 추출합니다.
건즈님 감사합니다. 많은 도움 되었어요..