그룹최신글 렌덤 오류 질문..

그룹최신글 렌덤 오류 질문..

QA

그룹최신글 렌덤 오류 질문..

답변 1

본문

뷰페이지에 접속시 해당카테고리별로 글 하단에 해당 카테고리최신글이 렌덤으로 나오게 했는데요.

 

네이비칼라님의 http://sir.kr/g5_skin/2928?sfl=wr_subject&stx=%EB%9E%9C%EB%8D%A4 이스킨을 다운받아서 설치를 했습니다.

 

근데 적용을 해보니 게시물뿐만 아니라 댓글이 함께 불러져서 

f48db3d141b41abb99c1fea484b57965_1463566722_4422.png
이렇게 노이미지로 나옵니다.

댓글이 아닌 본문글은 정상적으로 썸네일과 제목이 노출이 되고요....

 

 

 
// 최신글 카테고리 데이타를 랜덤으로 추출 
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

참조코드17번 라인에  이렇게 한번 변경해보세요.


 $sql = " select * from {$tmp_write_table} where  wr_is_comment = 0 and ca_name = '$category' order by rand() desc limit 0, $rows ";  
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 104
© SIRSOFT
현재 페이지 제일 처음으로