s

썸네일 출력 오류 도와주세요 ㅠㅠ

· 2013-09-30 (월) 11:53:28 · 1688 · 11
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://vip-reborn.co.kr/bbs/board.php?bo_table=review




베스트 리뷰에 썸네일이 뜨지 않습니다.

대체 무엇이 문제인지...

두시간째 list.skin.php를 뜯어봐도 알수가 없네요!!!!!!!!!!!!!!!!!!!


해결해주시면 감사드리겠습니다.....하아
|

댓글 11개

2013-09-30 (월) 13:49:45
사이트 보니까 되는거 아닌가요?
아뇨 딱 한개의 게시물을 제외하곤 모두 no images로 출력이 되고있습니다!ㅠㅠ
2013-09-30 (월) 13:54:15
어떤 스킨을 가져다 쓰신거죠??
스킨마다 썸네일이 하도 틀리니;;;
2013-09-30 (월) 14:11:45
혹시 적어주신 스킨의 latest.skin.php파일을 list.skin.php파일에 붙혀넣어서 적용하신건가요??
현재 적어주신 스킨의 latest.skin.php파일에는 썸네일을 만드는 부분이 없습니다.
전체 소스를 풀로 한번 찍어봐주세요~
<div class="best">
<ul>
<? for($i=0; $i<count($list); $i++) {$m++;?>
<li>
<div>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
$noimg= $g4[path]. "/images/noimg.gif";

if ( file_exists($thumb) )
$img = $thumb;
else
$img = $noimg;
?>

<!--이미지 가로와 세로의 크기를 정해주세요 -->
<?
echo "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='$img' border='0' width='230' height='155'></a>";
echo "</div><div class='title'>";

echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "{$list[$i]['subject']}";
else
echo "{$list[$i]['subject']}";
echo "</a>";
?>
</div>
</li>
<? if ($m%3==0){ ?>
</ul><? } ?>
<?}?>
</div>
위 소스는 latest.skin.php이고,
아래는 list.skin.php 입니다.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;

//if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

$thumb_width = "230"; //썸네일 가로길이
$thumb_height = "155"; //썸네일 세로길이
$thumb_quality = "100"; //퀼리티 100이하로 설정
$list_content = "200"; //내용길이

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

include_once($board_skin_path . '/lib/skin.lib.php');
?>

<!-- 게시판 목록 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>

<div style="margin-bottom:20px;"><img src="/images/img03_02.png" /></div>

<? include "$g4[path]/best.php"; //베스트 10 ?>

<h1 style="text-align:right;"><a href="http://blog.naver.com/shopreborn" target="_blank"><img src="/images/review_more.png" /></a></h1>

<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 생략시킴-->


<!-- 제목 -->
<form name="fboardlist" method="post">
<input type='hidden' name='bo_table' value='<?=$bo_table?>'>
<input type='hidden' name='sfl' value='<?=$sfl?>'>
<input type='hidden' name='stx' value='<?=$stx?>'>
<input type='hidden' name='spt' value='<?=$spt?>'>
<input type='hidden' name='page' value='<?=$page?>'>
<input type='hidden' name='sw' value=''>


<div style="margin-bottom:15px;"><img src="/images/img03_03.png" /></div>


<table cellspacing="0" cellpadding="0" class="board_list">
<col width="79" />
<? if ($is_checkbox) { ?><col width="40" /><? } ?>
<col />
<col width="102" />
<col width="123" />
<col width="95" />

<tr>
<th><img src="<?=$board_skin_path?>/img/1.gif" /></th>
<? if ($is_checkbox) { ?><th><input onclick="if (this.checked) all_checked(true); else all_checked(false);" type="checkbox"></th><?}?>
<th><img src="<?=$board_skin_path?>/img/2.gif" /></th>
<th><img src="<?=$board_skin_path?>/img/4.gif" /></th>
<th><img src="<?=$board_skin_path?>/img/3.gif" /></th>
<th><img src="<?=$board_skin_path?>/img/5.gif" /></th>
</tr>

<?
for ($i=0; $i<count($list); $i++) {
$bg = $i%2 ? 0 : 1;
?>

<tr class="bg<?=$bg?>">
<td class="num">
<?
if ($list[$i][is_notice]) // 공지사항
echo "<b>공지</b>";
else if ($wr_id == $list[$i][wr_id]) // 현재위치
echo "<span class='current'>{$list[$i][num]}</span>";
else
echo $list[$i][num];
?>
</td>
<? if ($is_checkbox) { ?><td class="checkbox"><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"></td><? } ?>
<td class="subject">
<?
echo $nobr_begin;
echo $list[$i][reply];
echo $list[$i][icon_reply];
if ($is_category && $list[$i][ca_name]) {
echo "<span class=small><font color=gray>[<a href='{$list[$i][ca_name_href]}'>{$list[$i][ca_name]}</a>]</font></span> ";
}

if ($list[$i][is_notice])
echo "<a href='{$list[$i][href]}'><span class='notice'>{$list[$i][subject]}</span></a>";
else
echo "<a href='{$list[$i][href]}'>{$list[$i][subject]}</a>";

if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span class='comment'>{$list[$i][comment_cnt]}</span></a>";

// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }


echo $nobr_end;
?>
</td>
<td class="name" align="center"><?=$list[$i][name]?></td>
<td class="datetime"><?=$list[$i][datetime2]?></td>
<td class="hit"><?=$list[$i][wr_hit]?></td>
</tr>
<? } // end for ?>

<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center style='border-right:none;border-left:none;'>게시물이 없습니다.</td></tr>"; } ?>

</table>
</form>

<div class="board_button">
<div style="float:left;">
<? if ($list_href) { ?>
<a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" align="absmiddle" border='0'></a>
<? } ?>
<? if ($is_checkbox) { ?>
<a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" align="absmiddle" border='0'></a>
<a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" align="absmiddle" border='0'></a>
<a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" align="absmiddle" border='0'></a>
<? } ?>
</div>

<div style="float:right;">
<? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border='0'></a><? } ?>
</div>
</div>

<!-- 페이지 -->
<div class="board_page">
<? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/page_search_prev.gif' border='0' align=absmiddle title='이전검색'></a>"; } ?>
<?
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
//echo $write_pages;
$write_pages = str_replace("처음", "<img src='$board_skin_path/img/page_begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
$write_pages = str_replace("이전", "<img src='$board_skin_path/img/page_prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
$write_pages = str_replace("다음", "<img src='$board_skin_path/img/page_next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
$write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/page_end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
//$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "$1", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><span style=\"color:#4D6185; font-size:12px; text-decoration:underline;\">$1</span></b>", $write_pages);
?>
<?=$write_pages?>
<? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/page_search_next.gif' border='0' align=absmiddle title='다음검색'></a>"; } ?>
</div>

</td></tr></table>

<script type="text/javascript">
if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';
if ('<?=$stx?>') {
document.fsearch.sfl.value = '<?=$sfl?>';

if ('<?=$sop?>' == 'and')
document.fsearch.sop[0].checked = true;

if ('<?=$sop?>' == 'or')
document.fsearch.sop[1].checked = true;
} else {
document.fsearch.sop[0].checked = true;
}
</script>

<? if ($is_checkbox) { ?>
<script type="text/javascript">
function all_checked(sw) {
var f = document.fboardlist;

for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}

function check_confirm(str) {
var f = document.fboardlist;
var chk_count = 0;

for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}

if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}

// 선택한 게시물 삭제
function select_delete() {
var f = document.fboardlist;

str = "삭제";
if (!check_confirm(str))
return;

if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;

f.action = "./delete_all.php";
f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;

if (sw == "copy")
str = "복사";
else
str = "이동";

if (!check_confirm(str))
return;

var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");

f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->
2013-09-30 (월) 14:30:37
일단 테스트는 못해보겠지만
님이 알려주신 skin을 조합해서 latest.skin.php를 다음과 같이 수정해보세요
[code]
<div class="best">
<ul>
<?
$thumb_width = "230"; //썸네일 가로길이
$thumb_height = "155"; //썸네일 세로길이
$thumb_quality = "100"; //퀼리티 100이하로 설정
$list_content = "200"; //내용길이

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<? for($i=0; $i<count($list); $i++) {$m++;?>
<li>
<div>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img= $data_path. "/".$image; //썸네일이 없을경우 원본출력
$noimg= $g4[path]. "/images/noimg.gif";

//썸네일 생성
$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("/\.(jpg|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
continue;

$rate = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);

// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $thumb_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($thumb_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------
$file = '../' . $tmp[0]; // 파일명
$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
continue;

$rate = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);

// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $thumb_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($thumb_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}

if ( file_exists($thumb) )
$img = $thumb;
else
$img = $noimg;

?>


<!--이미지 가로와 세로의 크기를 정해주세요 -->
<?
echo "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='$img' border='0' width='230' height='155'></a>";
echo "</div><div class='title'>";

echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "{$list[$i]['subject']}";
else
echo "{$list[$i]['subject']}";
echo "</a>";
?>
</div>
</li>
<? if ($m%3==0){ ?>
</ul><? } ?>
<?}?>
</div>
[/code]
답변 감사드립니다.
덕분에 썸네일이 출력되었습니다!
한가지만 더 여쭤봐도 될까요 ㅠㅠ
썸네일 크기가 제어가 안되고있네요;;
2013-09-30 (월) 14:50:35
쪽지로 답변 드렸습니다.
덕분에 해결되었습니다. 감사합니다^^
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
13-09-30 조회 865
13-09-30 조회 1,101
13-09-30 조회 1,689
13-09-30 조회 4,170
13-09-30 조회 1,609
13-09-30 조회 4,156
13-09-30 조회 1,732
13-09-30 조회 2,304
13-09-30 조회 1,912
13-09-29 조회 1.3만
13-09-29 조회 1,667
13-09-29 조회 1,157
13-09-29 조회 1,623
13-09-29 조회 1,560
13-09-29 조회 1,671
13-09-29 조회 1,574
13-09-29 조회 2,671
13-09-29 조회 2,109
13-09-29 조회 1,111
13-09-29 조회 1,691