카테고리 내에 게시물이 없는 경우 안보이게 할 수 있나요? > 그누4 질문답변

그누4 질문답변

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

카테고리 내에 게시물이 없는 경우 안보이게 할 수 있나요? 정보

카테고리 내에 게시물이 없는 경우 안보이게 할 수 있나요?

본문

플록님의 자동메뉴를 사용하고 있습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=47018

여기서 카테고리를 생성하면 자동으로 메뉴로 생성해서 보여주는데요,
카테고리는 있지만 게시물이 없는 경우 해당 카테고리만 안보이게 할 수 있나요?

 //분류목록 세로배열
    $bo_width = 100;//전체 테이블 너비 %
    $cols = 1;//세로 칼럼수
    $ca_width = intval($bo_width / $cols);//셀 너비

    //게시판이고 분류사용 체크되있으며 분류내용 있는 경우
    if (($bbs['bo_table'] == $bo_table) && (($bbs['bo_use_category'] == "1") && ($category))){

      ?>
    <div id='bcRFV_sub'>
      <div style="width:<?=$bo_width?>%; border:0px solid white;">
        <?
       
      //분류
      $cntc = 1;
      foreach( $bbs['sca'] as $category){
        //bo_new에서 지정한 시간내 분류별 원글 및 코멘트 새글 카운트 by nasca, izen님 빠른쿼리로 보강
        $sql2_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment = '0' and wr_datetime >= '$intime' and ca_name = '$category'");
        $row2_new = mysql_fetch_array($sql2_new);
        $sql2_cm_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment <> '0' and wr_datetime >= '$intime' and ca_name = '$category'");
        $row2_cm_new = mysql_fetch_array($sql2_cm_new);
        $sql2_ca_total = mysql_query(" select count(ca_name) as ca_name from $tmp_write_table where wr_is_comment = '0' and ca_name = '$category'");
        $row2_ca_total = mysql_fetch_array($sql2_ca_total);

        $cn_count = $row2_new['wr_datetime'];
        $cn_countc = $row2_cm_new['wr_datetime'];
        $ca_count = $row2_ca_total['ca_name'];

        //$new2 = ($cn_count || $cn_countc > 0)?"<span class='new'>".$cn_count."</span>/<span class='new'>".$cn_countc."</span>/":'';
        $cn_count = ($cn_count > 0)?"<span class='new'>".$cn_count."</span>/":'';
        $cn_countc = ($cn_countc > 0)?"<span class='new'>".$cn_countc."</span>/":'';
        $new2 = ($ca_count > 0)?"<span class='new3'>&nbsp;".$cn_count.$cn_countc.$ca_count."</span>":'';

        //링크에서 한글로된 카데고리 이름을 urlencode시킴
        $sca_url = urlencode($category);

        $ca_subject = cut_str(get_text($category),20,"") . $new2;

        ?>

댓글 전체

전체 7 |RSS
그누4 질문답변 내용 검색

회원로그인

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