[소스]가로형 카테고리에서 게시글 수에서 코멘트수를 제외하고 출력이 되게 하고싶어요. 정보
[소스]가로형 카테고리에서 게시글 수에서 코멘트수를 제외하고 출력이 되게 하고싶어요.본문
가로형 카테고리 소스를 찾아 사용하고 있습니다. 다른것은 다좋은데 각 카테고리별 게시글수를 불러오는 곳에서 문제가 있습니다.
코멘트의 수까지 더해져서 나오네요.
카테고리별 게시글의 갯수만 나오게 하고 싶은데 어느곳을 수정을 하면 될까요? 부탁드립니다.
아래에 소스를 첨부합니다.
<? if ($is_category) { ?>
<?
if (!defined('_GNUBOARD_')) exit;
// $icon_h ="<img src='".$latest_skin_path."/icon_head.gif' border=0 align=absmiddle width=20 height=16>";
$icon_h ="<span style='font-size:10px; color:#eeeeee'>ㆍ</span>";
$cnt = 1;
$row = sql_fetch(" SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ");
$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
$str = "";
$str .= "<tr>";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
//카테고리별 게시물수 체크
$row1 = sql_fetch(" SELECT count(*) as cat_cnt FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ");
//새글표시(아이콘뉴) 부분
$sql = " SELECT wr_datetime FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' order by wr_datetime desc limit 1 ";
$row2 = sql_fetch_array(mysql_query($sql));
if($row2[wr_datetime] >= date("Y-m-d H:i:s", time() - 24 * 3600)) {
$icon_new = "<img src='$board_skin_path/img/icon_new.gif' border=0>";
} else {
$icon_new = "";
}
//출력부분 설정
$str .= "<td>".$icon_h."<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&sca=$arr[$i]'>$arr[$i]<span style='font-family:tahoma; font-size:10px; color:#66CC00'> (".$row1[cat_cnt].")</span></a> ".$icon_new."</td>";
if ($cnt == 10) { $cnt = 1; $str .= "</tr><tr>"; } //줄바꿈 부분 &cnt == 4 (4칸을 띄우고 난후 줄바꿈함)
$cnt++;
}
?>
<?
if (!defined('_GNUBOARD_')) exit;
// $icon_h ="<img src='".$latest_skin_path."/icon_head.gif' border=0 align=absmiddle width=20 height=16>";
$icon_h ="<span style='font-size:10px; color:#eeeeee'>ㆍ</span>";
$cnt = 1;
$row = sql_fetch(" SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ");
$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
$str = "";
$str .= "<tr>";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
//카테고리별 게시물수 체크
$row1 = sql_fetch(" SELECT count(*) as cat_cnt FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ");
//새글표시(아이콘뉴) 부분
$sql = " SELECT wr_datetime FROM {$g4[write_prefix]}{$bo_table} WHERE ca_name = '$arr[$i]' order by wr_datetime desc limit 1 ";
$row2 = sql_fetch_array(mysql_query($sql));
if($row2[wr_datetime] >= date("Y-m-d H:i:s", time() - 24 * 3600)) {
$icon_new = "<img src='$board_skin_path/img/icon_new.gif' border=0>";
} else {
$icon_new = "";
}
//출력부분 설정
$str .= "<td>".$icon_h."<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&sca=$arr[$i]'>$arr[$i]<span style='font-family:tahoma; font-size:10px; color:#66CC00'> (".$row1[cat_cnt].")</span></a> ".$icon_new."</td>";
if ($cnt == 10) { $cnt = 1; $str .= "</tr><tr>"; } //줄바꿈 부분 &cnt == 4 (4칸을 띄우고 난후 줄바꿈함)
$cnt++;
}
?>
댓글 전체
wr_comment >= 0
--> wr_is_comment = '0'
--> wr_is_comment = '0'
together 님 감사합니다. ^^;
바로 해결되네요.. 행복하세요.
바로 해결되네요.. 행복하세요.