메인 최신글에서 답변글 제외하는방법 문의

메인 최신글에서 답변글 제외하는방법 문의

QA

메인 최신글에서 답변글 제외하는방법 문의

본문

메인에서 최신글을 읽어오는 소스를 사용하는데요,

답변글까지 최신글로 뜨네요..

 

답변글은 메인 최신글에 노출 안되게 하는방법 문의드립니다. 

이 질문에 댓글 쓰기 :

답변 1

http://sir.co.kr/g5_plugin/1090 

이걸 한번 사용해 보세요. ^^

 

현재 latest 파일에서 이용하고있는 소스입니다.
어디서 문제인건지 썸네일만 불러오지를 못하네요ㅠㅠ
확인한번 부탁드립니다.

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

include_once(G5_LIB_PATH.'/thumbnail.lib.php');

$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);

if ($options) list($width, $height, $wrap_width, $content_length) = explode(',', $options);
if (!$width) $width = 158;
if (!$height) $height = 99;
if (!$content_length) $content_length = 66;

add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
?>

<ul class="latest-zinex"<?php if ($wrap_width) { echo ' style="width:'.$wrap_width.'px;"'; } ?>>
<?php for ($i=0; $i<count($list); $i++) {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $width, $height);

if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img">';
} else {
$img_content = '<span class="img" style="width:'.$width.'px; height:'.$height.'px;"><img src="/images/main/noimage.gif" alt=""></span>';
}
?>

<li>
<a href="<?php echo $list[$i]['href']; ?>">
<?php echo $img_content; ?>
<h4><?php echo $list[$i]['subject']; ?></h4>
<p><?php echo cut_str(preg_replace("/&nbsp;/", "", strip_tags($list[$i]['wr_content'])), $content_length); ?></p>
</a>
</li>

<?php
}
if (count($list) == 0) { //게시물이 없을 때  ?>
<li class="nodata">게시물이 없습니다.</li>
<?php }  ?>
</ul>

소스상으로는 별 문제 없어 보이는데요..

위 소스에서 실제로 width height 값이 얼마로 찍히는지 echo 를 한번 해 보세요.

width height 값이 양의 숫자가 아닌 문자나 0 이하의 값이 들어가면,
썸네일이 잘 못 만들어 집니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 123,732 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT