카테고리 내에 게시물이 없는 경우 안보이게 할 수 있나요? 정보
카테고리 내에 게시물이 없는 경우 안보이게 할 수 있나요?
본문
플록님의 자동메뉴를 사용하고 있습니다.
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'> ".$cn_count.$cn_countc.$ca_count."</span>":'';
//링크에서 한글로된 카데고리 이름을 urlencode시킴
$sca_url = urlencode($category);
$ca_subject = cut_str(get_text($category),20,"") . $new2;
?>
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'> ".$cn_count.$cn_countc.$ca_count."</span>":'';
//링크에서 한글로된 카데고리 이름을 urlencode시킴
$sca_url = urlencode($category);
$ca_subject = cut_str(get_text($category),20,"") . $new2;
?>
댓글 전체