베스트이미지스킨제작에 도움좀 부탁드립니다. 채택완료
좌맥
8년 전
조회 2,256
베스트스킨이&nbsp; 텍스트로만 출력이 되서 이미지형으로 만들자 하는데 썸네일 이미지가 출력이 안되네요.<br />
<br />
베스트스킨은 아래주소의 스킨을 기본으로 해서 이미지(갤러리형)최신글스킨 에서&nbsp; 썸네일 코드를 추가 했습니다.<br />
<a href="https://sir.kr/g5_skin/6948?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%EB%B2%A0%EC%8A%A4%ED%8A%B8" target="_blank" rel="noopener noreferrer">https://sir.kr/g5_skin/6948?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%EB%B2%A0%EC%8A%A4%ED%8A%B8</a><br />
<br />
latest.skin.php파일은 아래와 같이 수정했습니다.<br />
<br />
include_once(G5_LIB_PATH.'/thumbnail.lib.php');<br />
// 스넵이미지 생성함수<br />
<br />
$w = 110;&nbsp; //썸네일 가로 크기 700<br />
$h = 110; //썸네일 세로 크기<br />
?><br />
<style type="text/css"><br />
.subject {width:212px;padding:2px 0 0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}<br />
.subject img {vertical-align:bottom;}<br />
</style><br />
<table width="212" cellpadding="0" cellspacing="0" style="padding:2px 0 0;"><br />
<? for ($i=0; $i<count($list); $i++) { ?><br />
<tr><br />
&nbsp; &nbsp; <td colspan="4"><br />
&nbsp; &nbsp; &nbsp; &nbsp; <table width="100%" border="0" cellpadding="0" cellspacing="0"><br />
&nbsp; &nbsp; &nbsp; &nbsp; <tr><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td height="22" valign="bottom" class="subject"><img src="../skin/latest/best10/img/btn<?=$titles?>_<?=$i+1?>.gif" align="top"><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <?<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $list[$i]['icon_reply'] . " ";<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo "<a href='{$list[$i]['href']}' target=_parent>";<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($list[$i]['is_notice'])<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $list[$i]['subject'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $list[$i]['subject'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo "</a>";<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //if ($list[$i]['comment_cnt']) //<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; '>{$list[$i]['comment_cnt']}</span></a>";//<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?></td><br />
<td><br />
<?php<br />
$n_thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $w, $h); //게시판1개인경우사용<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //$n_thumb = get_list_thumbnail($list[$i]['bo_table'], $list[$i]['wr_id'], $w, $h); //그룹용으로사용<br />
// 스넵이미지 생성하고 뷰어 시킨다.<br />
$n_noimg = "$latest_skin_url/img/noimg.gif";<br />
// 이미지가 없을경우의 이미지 위치<br />
if($n_thumb['src']) {<br />
$img_content = '<img src="'.$n_thumb['src'].'" width="'.$w.'" height="'.$h.'" alt="'.$list[$i]['subject'].'" title="" class="file-img"/>';<br />
} else {<br />
$img_content = '<img src="'.$n_noimg.'" width="'.$w.'" height="'.$h.'" alt="이미지없음" title="" class="file-img"/>';<br />
}<br />
echo $img_content;<br />
?><br />
<br />
<br />
</td><br />
</tr><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; </table><br />
</td><br />
</tr><br />
<br />
<? } ?><br />
<br />
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50>게시물이 없습니다.</a></td></tr><? } ?><br />
</table><br />
<br />
-----<br />
<br />
그리고 출력코드는 <br />
<br />
<?php echo izen_group("theme/best11", "", "'B11'", wr_hit,&nbsp; 10, 20,300);?><br />
<br />
로 일단 한개의 게시판 베스트로 했습니다.<br />
<br />
<br />
썸네일이 나와야 하는 위치에 썸네일이 안나오고 noimg만 출력이 됩니다.<br />
<br />
어떻게 해야 썸네일이 정상적으로 출력이 될지 조언좀 부탁드립니다.<br />
<br />
베스트스킨은 아래주소의 스킨을 기본으로 해서 이미지(갤러리형)최신글스킨 에서&nbsp; 썸네일 코드를 추가 했습니다.<br />
<a href="https://sir.kr/g5_skin/6948?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%EB%B2%A0%EC%8A%A4%ED%8A%B8" target="_blank" rel="noopener noreferrer">https://sir.kr/g5_skin/6948?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%EB%B2%A0%EC%8A%A4%ED%8A%B8</a><br />
<br />
latest.skin.php파일은 아래와 같이 수정했습니다.<br />
<br />
include_once(G5_LIB_PATH.'/thumbnail.lib.php');<br />
// 스넵이미지 생성함수<br />
<br />
$w = 110;&nbsp; //썸네일 가로 크기 700<br />
$h = 110; //썸네일 세로 크기<br />
?><br />
<style type="text/css"><br />
.subject {width:212px;padding:2px 0 0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}<br />
.subject img {vertical-align:bottom;}<br />
</style><br />
<table width="212" cellpadding="0" cellspacing="0" style="padding:2px 0 0;"><br />
<? for ($i=0; $i<count($list); $i++) { ?><br />
<tr><br />
&nbsp; &nbsp; <td colspan="4"><br />
&nbsp; &nbsp; &nbsp; &nbsp; <table width="100%" border="0" cellpadding="0" cellspacing="0"><br />
&nbsp; &nbsp; &nbsp; &nbsp; <tr><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td height="22" valign="bottom" class="subject"><img src="../skin/latest/best10/img/btn<?=$titles?>_<?=$i+1?>.gif" align="top"><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <?<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $list[$i]['icon_reply'] . " ";<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo "<a href='{$list[$i]['href']}' target=_parent>";<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($list[$i]['is_notice'])<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $list[$i]['subject'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $list[$i]['subject'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo "</a>";<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //if ($list[$i]['comment_cnt']) //<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; '>{$list[$i]['comment_cnt']}</span></a>";//<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?></td><br />
<td><br />
<?php<br />
$n_thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $w, $h); //게시판1개인경우사용<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //$n_thumb = get_list_thumbnail($list[$i]['bo_table'], $list[$i]['wr_id'], $w, $h); //그룹용으로사용<br />
// 스넵이미지 생성하고 뷰어 시킨다.<br />
$n_noimg = "$latest_skin_url/img/noimg.gif";<br />
// 이미지가 없을경우의 이미지 위치<br />
if($n_thumb['src']) {<br />
$img_content = '<img src="'.$n_thumb['src'].'" width="'.$w.'" height="'.$h.'" alt="'.$list[$i]['subject'].'" title="" class="file-img"/>';<br />
} else {<br />
$img_content = '<img src="'.$n_noimg.'" width="'.$w.'" height="'.$h.'" alt="이미지없음" title="" class="file-img"/>';<br />
}<br />
echo $img_content;<br />
?><br />
<br />
<br />
</td><br />
</tr><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; </table><br />
</td><br />
</tr><br />
<br />
<? } ?><br />
<br />
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50>게시물이 없습니다.</a></td></tr><? } ?><br />
</table><br />
<br />
-----<br />
<br />
그리고 출력코드는 <br />
<br />
<?php echo izen_group("theme/best11", "", "'B11'", wr_hit,&nbsp; 10, 20,300);?><br />
<br />
로 일단 한개의 게시판 베스트로 했습니다.<br />
<br />
<br />
썸네일이 나와야 하는 위치에 썸네일이 안나오고 noimg만 출력이 됩니다.<br />
<br />
어떻게 해야 썸네일이 정상적으로 출력이 될지 조언좀 부탁드립니다.<br />
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
8년 전
$n_thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $w, $h); //게시판1개인경우사용
여기에 보면 $bo_table이라는 변수가 있는데 이거 echo로 찍어 보면 값 나오나요?
그리고
print_r($n_thumb);
이렇게 했을 때 값이 정상적으로 나오는지도 확인해 보셔야 하겠네요.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 4개
�
좌맥
8년 전
�
왕계란
8년 전
$bo_table에 값이 없어서 그렇겠네요.
위에 보니 for문 안에서 돌아가네요.
그러면 그냥 기존 코드 그대로 쓰면 되지 않나요?
$bo_table 대신에 $list[$i]['bo_table']
위에 보니 for문 안에서 돌아가네요.
그러면 그냥 기존 코드 그대로 쓰면 되지 않나요?
$bo_table 대신에 $list[$i]['bo_table']
�
왕계란
8년 전
저 부분은 $bo_table로 이미지를 갖고 오려는 테이블명을 직접 적으시거나 아니면 해당 함수 호출하는 부분에서 추가를 하시거나 해야 하겠네요.
�
좌맥
8년 전
함수호출하는건 제가 못해서 그냥게시판 1개지정으로 했습니다.
감사합니다.
감사합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
아무것도 나오지 않네요.