공지글도 카테고리 숫자에 포함되게 하는방법... 정보
공지글도 카테고리 숫자에 포함되게 하는방법...본문
안녕하세요..^^
요즘 이곳에서 도움 너무 많이 받아가고있습니다..
진심 감사드리구요..
다름이 아니라..
갤러리 사진을 카테고리 윗쪽으로 나오게끔하려고 공지에 체크하면 제일 처음에 보이게끔 소스를 수정했는데요..
문제는.. 공지체크해서 글을 올리면..
카테고리 숫자에
전체(6) 이렇게 나오는부분에..
공지 글은 싹 빠지고..
원래 9개인데 3개빠진 6개가 표현이 되거든요?..
같이 합산되서 표현되게끔 하는 방법이 없을가요?
참조로 아래 카테고리php 소스 올려봅니다...^^
<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><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]&sop=&sst=wr_1&sod=desc&sfl=&stx=&page=1'>$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?>&sca=<?=$arr[$i]?>&sop=&sst=wr_1&sod=desc&sfl=&stx=&page=1'><b>전체 (<?=number_format($total_count)?>)</b></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>
<!-- 분류 셀렉트 박스 끝 -->
<? } ?>
요즘 이곳에서 도움 너무 많이 받아가고있습니다..
진심 감사드리구요..
다름이 아니라..
갤러리 사진을 카테고리 윗쪽으로 나오게끔하려고 공지에 체크하면 제일 처음에 보이게끔 소스를 수정했는데요..
문제는.. 공지체크해서 글을 올리면..
카테고리 숫자에
전체(6) 이렇게 나오는부분에..
공지 글은 싹 빠지고..
원래 9개인데 3개빠진 6개가 표현이 되거든요?..
같이 합산되서 표현되게끔 하는 방법이 없을가요?
참조로 아래 카테고리php 소스 올려봅니다...^^
<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><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]&sop=&sst=wr_1&sod=desc&sfl=&stx=&page=1'>$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?>&sca=<?=$arr[$i]?>&sop=&sst=wr_1&sod=desc&sfl=&stx=&page=1'><b>전체 (<?=number_format($total_count)?>)</b></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>
<!-- 분류 셀렉트 박스 끝 -->
<? } ?>
댓글 전체
$cnt=1; 바로 윗줄에 추가하세요
$total_count+=count($arr_notice);
$total_count+=count($arr_notice);
균이님.. 이렇게하니 공지가 카운팅되는데요..
공지가 없는 게시물들은 모두 1부터 시작해서 전체갯수에서 한개가 플러스가 됩니다..
아무것도 등록안했는데 전체(1) 이런식으로요..ㅠ
다른 방법은 없는건지요...
공지가 없는 게시물들은 모두 1부터 시작해서 전체갯수에서 한개가 플러스가 됩니다..
아무것도 등록안했는데 전체(1) 이런식으로요..ㅠ
다른 방법은 없는건지요...
감사합니다..^^ 역시~