m

총게시물 수, 총 댓글수 뽑기

<? 
//게시물수 뽑기
 $results1 = sql_query(" SELECT bo_table FROM $g4[board_table] ");
 
  $all_com = 0;
   $all_art= 0;
   $i=0;
     while ($row13 = sql_fetch_array($results1)) {
    
 $i++; //테이블수
    //게시물
    $gul_su="select count(wr_is_comment) as ctt from g4_write_$row13[bo_table] where wr_is_comment='0' ";
    
    //코멘트
    $co_su="select sum(wr_is_comment) as ctt2 from g4_write_$row13[bo_table] where wr_is_comment='1' "; 
    //게시물
    $article = sql_fetch($gul_su);
    $article_su=$article[ctt];
    $all_art= $all_art +$article_su;
    
    //코멘트
    $comm= sql_fetch($co_su);
    $comm_su=$comm[ctt2];
    $all_com = $all_com+$comm_su;
 }


?>


<table width=100%>
        <tr>
         <td align=right>
          <span  style='font-family:돋움;font-size:11px;color:#999999;'>· 총게시물 :</span></td>
         <td align=right> <span style='font-family:돋움;font-size:11px;color:#999999;'>
           <?=number_format($all_art)?> </span></td>
         <td align=right>
          <span  style='font-family:돋움;font-size:11px;color:#999999;'>· 총코멘트 :</span> </td>
          <td align=right> 
            <span style='font-family:돋움;font-size:11px;color:#999999;'>
             <?=number_format($all_com)?> </span></td>
         </tr>
 </table>
|

댓글 2개

요게 각 회원들이 작성한 총 게시물과 코멘트를 출력하는 소스인가요?
정말 유용한팁!
감사합니다~~~~~
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
07-10-01 조회 1.1만
07-09-29 조회 5,828
07-09-29 조회 5,222
07-09-28 조회 3,957
07-09-25 조회 3,301
07-09-24 조회 3,469
07-09-22 조회 3,257
07-09-21 조회 8,200
07-09-19 조회 5,743
07-09-18 조회 3,808
07-09-17 조회 6,005
07-09-15 조회 8,056
07-09-15 조회 3,616
07-09-15 조회 3,431
07-09-14 조회 5,529
07-09-12 조회 5,158
07-09-07 조회 5,143
07-09-07 조회 1.2만
07-09-06 조회 4,618
07-09-06 조회 3,172