투사님 자동메뉴 전체글 수 추력 질문드려요 > 그누4 질문답변

그누4 질문답변

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

투사님 자동메뉴 전체글 수 추력 질문드려요 정보

투사님 자동메뉴 전체글 수 추력 질문드려요

본문

<table width='154' cellpadding=0 cellspacing=0 border=0>
<?
$sql = " select gr_id, gr_subject from $g4[group_table] where gr_id = '04'";//해당그룹 $gr_id를 해당그룹명으로 대체가능
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
$sql2 = " select bo_subject, bo_table from $g4[board_table] where (bo_list_level <= $member[mb_level]) and (gr_id = '$row[gr_id]') and bo_use_search = '1' order by bo_order_search";
$result2 = sql_query($sql2);
while ($row2=mysql_fetch_array($result2)) {
$new_time = date("Y-m-d H:i:s", time()-3600*$row2[bo_new]);
$sql3 = " select count(*) as cnt from $g4[write_prefix]$row2[bo_table] where wr_datetime >= '$new_time' ";
$row3 = sql_fetch($sql3);
if ($row2[bo_table] == $bo_table)
echo "<tr><td background=$g4[path]/images/rightmenu_off_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'><font color=#616B71><b>$row2[bo_subject]<b></font></a></td></tr>";
else
echo "<tr><td background=$g4[path]/images/rightmenu_on_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'>$row2[bo_subject]</a></td></tr>"; //네모 뷸릿 + 테이블명 + new 아이콘
}
}
?>

</table>

===============================


여기 어디에다가 넣어야 전체 글 수를 출력 할 수 있나요?^^;

아래 것을 빈페이지에서는 출력되는데, 위에것의 안에다 넣으니 에러가 나서요.
아니면 다른 것을 넣어야 되는건지..궁금해요

<?
function t_count($bo_table){
global $g4;
$row = sql_fetch("select bo_count_write from $g4[board_table] where bo_table='{$bo_table}'");
$total_count = $row[bo_count_write];
return $total_count;
}
?>

자유게시판(<?=t_count("c1")?>)
질문게시판(<?=t_count("c2")?>)

댓글 전체

<?
function t_count($bo_table){
global $g4;
$row = sql_fetch("select bo_count_write from $g4[board_table] where bo_table='{$bo_table}'");
$total_count = $row[bo_count_write];
return $total_count;
}

$totalC1 = t_count("c1");
$totalC1 = t_count("c2");
?>



<table width='154' cellpadding=0 cellspacing=0 border=0>
<tr>
    <td> 자유게시판(<span=style="color:red"><?=$totalC1?></span>) 질문게시판(<span=style="color:red"><?=$totalC2?></span>) </td>
</tr>

<?
$sql = " select gr_id, gr_subject from $g4[group_table] where gr_id = '04'";//해당그룹 $gr_id를 해당그룹명으로 대체가능
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
$sql2 = " select bo_subject, bo_table from $g4[board_table] where (bo_list_level <= $member[mb_level]) and (gr_id = '$row[gr_id]') and bo_use_search = '1' order by bo_order_search";
$result2 = sql_query($sql2);
while ($row2=mysql_fetch_array($result2)) {
$new_time = date("Y-m-d H:i:s", time()-3600*$row2[bo_new]);
$sql3 = " select count(*) as cnt from $g4[write_prefix]$row2[bo_table] where wr_datetime >= '$new_time' ";
$row3 = sql_fetch($sql3);
if ($row2[bo_table] == $bo_table)
{
    echo "<tr><td background=$g4[path]/images/rightmenu_off_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'><font color=#616B71><b>$row2[bo_subject]<b></font></a></td></tr>";
}
else
{
    echo "<tr><td background=$g4[path]/images/rightmenu_on_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'>$row2[bo_subject]</a></td></tr>"; //네모 뷸릿 + 테이블명 + new 아이콘

}
}
}
?>

</table>

// 이렇게 하면 될려나... 한번 해보세요.
전체 37 |RSS
그누4 질문답변 내용 검색

회원로그인

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