그룹 최신글 썸네일 생성

· 16년 전 · 1788 · 1
일반 최신글을 그룹 최신글로 바꿔서 출력 하려고 하는데 다른 최신글은 성공했는데 유아원님 최신글 http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=87375&sca=%C3%D6%BD%C5%B1%DB << 은 그룹으로 목록은 나오는데 썸네일이 나오지 않습니다.

아래 소스입니다. 출력은 <? echo latest_group("basic", "free_group", 4, 38); ?> 이렇게 하였고 latest_group.lib.php 파일도 extend 폴더에 잘 넣었습니다.
아래 소스에서 어느부분을 수정해야 썸네일이 생성이 될까요???

<?
if (!defined("_GNUBOARD_")) exit;

// 썸네일 생성
$thumb_width = "110"; //썸네일 가로길이
$thumb_height = "75"; //썸네일 세로길이

// 1차 테이블 디렉토리
$table_path = $g4['path'] . "/data/thumb/" . $bo_table;

// 1차 디렉토리 생성 및 퍼미션
@mkdir($table_path, 0707);
@chmod($table_path, 0707);

// 썸네일 디렉토리
$thumb_path = $table_path . "/" . $thumb_width . "x" . $thumb_height;

// 디렉토리 생성 및 퍼미션
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

// 돌리고 돌리고~
for ($i=0; $i<count($list); $i++) {

if ($i == '0' || $i == '1') {

// 첨부파일
$listFile = sql_fetch(" select bf_file from $g4[board_file_table] where bo_table = '{$bo_table}' and wr_id = '{$list[$i][wr_id]}' and bf_type in(1,2,3) ");

// 파일
if ($listFile['bf_file']) {

// 썸네일
$thumb = $thumb_path.'/'.$listFile['bf_file'];

// 원본
$thumb_file = "{$g4[path]}/data/file/{$bo_table}/{$listFile['bf_file']}";

// 파일명
$img_filename = "{$listFile['bf_file']}";

} else {
// 에디터

// 내용뽑고
$img_content = "{$list[$i]['wr_content']}";

$img_tmp1 = stristr($img_content,'/data/geditor/'); // 지에디터 디렉토리 체크
$img_tmp2 = strpos($img_tmp1,'>'); // 닫고
$img_tmp3 = stristr(substr($img_tmp1,0,$img_tmp2+1),'geditor'); // 지에디터 부터 경로 시작
$img_tmp4 = substr($img_tmp3,0,strpos($img_tmp3,'"')); // 더블쿼트 이전까지
$img_fileurl = $g4['path']."/data/".$img_tmp4; // 원본파일 상대경로

// 디렉토리에 파일이 있다면.
if (file_exists($img_fileurl)) {

// 파일명
$img_filename = substr($img_tmp4,13);

} else {

// 파일명이 읍네 ?
$img_filename = "";

}

// 썸네일
$thumb = $thumb_path.'/'.$img_filename;

// 원본
$thumb_file = "{$img_fileurl}";

}

// 썸네일이 없다면
if (!file_exists($thumb)) {

// 확장자 체크
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $thumb_file) && file_exists($thumb_file)) {

// 썸네일 생성. 가로, 세로, 원본경로, 생성경로
createThumb($thumb_width, $thumb_height, $thumb_file, $thumb, true);

}

}


if (file_exists($thumb) && $img_filename) {

$img[$i] = "<a href='".$list[$i]['href']."' onfocus='this.blur();'><img src='".$thumb."' width='".$thumb_width."' height='".$thumb_height."' align='absmiddle' border='0'></a>";

} else {

$img[$i] = "";

}

// 제목
$subject[$i] = conv_subject($list[$i]['wr_subject'], '30', '');

// 링크
$link[$i] = $list[$i]['href'];

} else {

// 제목
$subject2 = conv_subject($list[$i]['wr_subject'], $subject_len, '');

// 돌린다.
$add_list .= "<dl class='list'><a href='".$list[$i]['href']."' class='text'>· ".$subject2."</a></dl>";

}

}


if (count($list) == 0) {

$img[0] = "<span class='text'>no image</span>";
$link[0] = "#";
$subject[0] = "<span class='text'>게시물이 없습니다.</span>";

$img[1] = "<span class='text'>no image</span>";
$link[1] = "#";
$subject[1] = "<span class='text'>게시물이 없습니다.</span>";

$add_list = "<span class='text'>게시물이 없습니다.</span>";

}
?>


<style type="text/css">
div, ul, li, dl{padding:0px; margin:0px;}

ul, li {list-style:none outside;}

#box {}
#box .side {height:105px; padding:5px 3px 0 3px;}

#box .image {width:100px; padding-left:8px; float:left;}
#box .image_list {height:95px; padding-left:8px; float:left;}
#box .photo {width:110px; height:75px; padding:3px; border:1px solid #e4e4e4;}
#box .photo_list {width:90px; height:32px; line-height:15px; margin-top:3px; text-align:center;}
#box .list {height:19px;}
#box .text {color:#747474; font-size:11px; font-family:dotum,돋움;}
</style>


<div id="box">

<ul class="side">

<li class="image"><dl class="photo"><?=$img[0]?></dl><dl class="photo_list"><a href="<?=$link[0]?>" class="text"><?=$subject[0]?></a></dl></li>

<li class="image"><dl class="photo"><?=$img[1]?></dl><dl class="photo_list"><a href="<?=$link[1]?>" class="text"><?=$subject[1]?></a></dl></li>



</ul>
<div> <li class="image_list">

<?=$add_list?>

</li></div>
</div>
|

댓글 1개

아 이거..
if (!file_exists($img)) $img = "$g4[path]/data/file/$bo_table/thumbnail/{$list[$i][wr_id]}";
if (!file_exists($img)) $img = "{$list[$i][file][0][path]}/thumbnail/{$list[$i][wr_id]}";
if (!file_exists($img)) $img = "{$list[$i][file][path]}/{$list[$i][file][file]}";
if (!file_exists($img)) $img = "$latest_skin_path/img/noimage.gif";
if (!$list[$i][wr_id]) $img = "$latest_skin_path/img/noimage.gif";

에서 두번째줄 내용을 삽입하시면 그룹하구 멀티게시판 불러오는거도 될껄요.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
16년 전 조회 1,409
16년 전 조회 1,597
16년 전 조회 1,573
16년 전 조회 1,268
16년 전 조회 880
16년 전 조회 1,542
16년 전 조회 922
16년 전 조회 1,010
16년 전 조회 1,561
16년 전 조회 1,789
16년 전 조회 1,553
16년 전 조회 831
16년 전 조회 838
16년 전 조회 829
16년 전 조회 768
16년 전 조회 1,984
16년 전 조회 930
16년 전 조회 1,561
16년 전 조회 858
16년 전 조회 803