뷰페이지에 접속시 해당카테고리별로 글 하단에 해당 카테고리최신글이 렌덤으로 나오게 했는데요.
네이비칼라님의 http://sir.kr/g5_skin/2928?sfl=wr_subject&stx=%EB%9E%9C%EB%8D%A4 이스킨을 다운받아서 설치를 했습니다.
근데 적용을 해보니 게시물뿐만 아니라 댓글이 함께 불러져서

이렇게 노이미지로 나옵니다.
댓글이 아닌 본문글은 정상적으로 썸네일과 제목이 노출이 되고요....
Copy
// 최신글 카테고리 데이타를 랜덤으로 추출 function latest_category ($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="", $category="") { global $g5; if ($skin_dir) $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir; else $latest_skin_path = G5_SKIN_PATH.'/latest/basic'; $list = array(); $sql = " select * from $g5[board_table] where bo_table = '$bo_table'"; $board = sql_fetch($sql); $tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름 $sql = " select * from {$tmp_write_table} where ca_name = '$category' order by rand() desc limit 0, $rows "; //explain($sql); $result = sql_query($sql); for ($i=0; $row = sql_fetch_array($result); $i++) $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len); ob_start(); include "$latest_skin_path/latest.skin.php"; $content = ob_get_contents(); ob_end_clean(); return $content; }
어떻게 수정해야 게시물글만 정상적으로 최신글로 노출이 되게 할수 있나요?
|
답변 1개 / 댓글 1개
채택된 답변
+20 포인트
참조코드17번 라인에 이렇게 한번 변경해보세요.
Copy
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 and ca_name = '$category' order by rand() desc limit 0, $rows ";
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.