카테고리 숫자가 틀리게 나와요!! 정보
카테고리 숫자가 틀리게 나와요!!본문
저기 가보시면,
이렇게 나오는데..괄호안에 숫자가 틀리게 나오네요
여기는 맞게 나오는데..왜그런가요?
댓글 전체
두군데 모두 틀리게 나옵니다.
확인해보니 댓글까지 함께 카운트 하는것 같군요
확인해보니 댓글까지 함께 카운트 하는것 같군요
댓글빼고 원문만 세실려면 wr_is_comment = 0 조건을 주셔야할듯하네요
삼윤님 말데로 수정을 해줘도 이전과 똑같아요 ㅠ_ㅠ
쿼리문으로 어떤것을 주셨는지 알수 있을까요?
카테고리 카운터의 로직 부분을 올려주셔야 파악이 가능할듯...
<style type='text/css'>
/*-- 카테고리명 --*/
.cate {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;}
a.cate:link, a.b_ca:visited, a.b_ca:active {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;}
a.cate:hover {font-family:Tahoma,굴림, arial; color:#FF6600; font-size:12px; text-decoration:underline;}
</style>
<? $cnt_bo_1 = 5; // 한줄당 분류 갯수 ?>
<? if (!$wr_id) { ?>
<!-- 분류 셀렉트 박스 시작 -->
<?
$cnt = 1;
$sql = " SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
$str = "";
$str .= "<tr>";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
$sql1 = " SELECT count(*) as cCount FROM $write_table WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ";
$row1 = sql_fetch($sql1);
$str .= "<td height=24><img src='{$board_skin_path}/img/ico_folder.gif' width='13' height='11'> <a class='cate' href='./board.php?bo_table=$bo_table&sca=$arr[$i]'>$arr[$i] ($row1[cCount])</a></td>";
if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= "</tr><tr>"; }
$cnt++;
}
$sql2 = " SELECT count(*) as cCount FROM $write_table WHERE wr_comment >= 0 ";
$row2 = sql_fetch($sql2);
$Total_Cat = $row2[cCount]
?>
<table width=100% cellspacing=1 cellpadding=4 border=0 style=table-layout:fixed>
<col width=100></col>
<col width=20></col>
<col width=></col>
<tr bgcolor=white>
<td width='' align='center'>
<img src='<?=$board_skin_path?>/img/ico_folder.gif' width='13' height='11'> <a class='cate' href='./board.php?bo_table=<?=$bo_table?>'><b>전체목록</b><br>(최근등록순)</a>
</td>
<td nowrap> </td>
<td width='' style='word-break:break-all;'>
<table border=0 cellspacing=0 cellpadding=0 width=100%>
<span class="cate"><?=$str?></span>
</table>
</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td height=1 class=line1 style=height:1px><img src=<?=$board_skin_path?>/img/tab.gif border=0 height=1></td></tr></table>
<!-- 분류 셀렉트 박스 끝 -->
<? } ?>
위파일이 스킨-보드에 _inc_category.php 내용이구요..이부분을 인쿨르드해서 사용하고 있어요
/*-- 카테고리명 --*/
.cate {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;}
a.cate:link, a.b_ca:visited, a.b_ca:active {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;}
a.cate:hover {font-family:Tahoma,굴림, arial; color:#FF6600; font-size:12px; text-decoration:underline;}
</style>
<? $cnt_bo_1 = 5; // 한줄당 분류 갯수 ?>
<? if (!$wr_id) { ?>
<!-- 분류 셀렉트 박스 시작 -->
<?
$cnt = 1;
$sql = " SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
$str = "";
$str .= "<tr>";
for ($i=0; $i<count($arr); $i++)
if (trim($arr[$i])) {
$sql1 = " SELECT count(*) as cCount FROM $write_table WHERE ca_name = '$arr[$i]' and wr_comment >= 0 ";
$row1 = sql_fetch($sql1);
$str .= "<td height=24><img src='{$board_skin_path}/img/ico_folder.gif' width='13' height='11'> <a class='cate' href='./board.php?bo_table=$bo_table&sca=$arr[$i]'>$arr[$i] ($row1[cCount])</a></td>";
if ($cnt == $cnt_bo_1) { $cnt = 0; $str .= "</tr><tr>"; }
$cnt++;
}
$sql2 = " SELECT count(*) as cCount FROM $write_table WHERE wr_comment >= 0 ";
$row2 = sql_fetch($sql2);
$Total_Cat = $row2[cCount]
?>
<table width=100% cellspacing=1 cellpadding=4 border=0 style=table-layout:fixed>
<col width=100></col>
<col width=20></col>
<col width=></col>
<tr bgcolor=white>
<td width='' align='center'>
<img src='<?=$board_skin_path?>/img/ico_folder.gif' width='13' height='11'> <a class='cate' href='./board.php?bo_table=<?=$bo_table?>'><b>전체목록</b><br>(최근등록순)</a>
</td>
<td nowrap> </td>
<td width='' style='word-break:break-all;'>
<table border=0 cellspacing=0 cellpadding=0 width=100%>
<span class="cate"><?=$str?></span>
</table>
</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td height=1 class=line1 style=height:1px><img src=<?=$board_skin_path?>/img/tab.gif border=0 height=1></td></tr></table>
<!-- 분류 셀렉트 박스 끝 -->
<? } ?>
위파일이 스킨-보드에 _inc_category.php 내용이구요..이부분을 인쿨르드해서 사용하고 있어요
wr_comment >= 0 ";
를
wr_comment =' 0' "; 으로 바꾸어 보시겠습니까?....
http://www.sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=16653&sca=&sfl=mb_id%2C1&stx=vozzang
참조하세요~~~
를
wr_comment =' 0' "; 으로 바꾸어 보시겠습니까?....
http://www.sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=16653&sca=&sfl=mb_id%2C1&stx=vozzang
참조하세요~~~