사이트 통계 페이지2 (현재접속자,방문자수,페이지뷰,사이트현황,그 외..) > 그누4 스킨

그누4 스킨

스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다.
스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y
그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.

사이트 통계 페이지2 (현재접속자,방문자수,페이지뷰,사이트현황,그 외..) 정보

방문자 사이트 통계 페이지2 (현재접속자,방문자수,페이지뷰,사이트현황,그 외..)

첨부파일

site_status2.zip (10.8K) 662회 다운로드 2006-05-11 17:23:33

본문

안녕하세요^^
저번에 만든 사이트 통계페이지에서 기능을 추가해 보았습니다.
현재 접속자,방문자수,페이지뷰,사이트현황에

남/여 성비, 연령분포, 지역분포까지 알아볼 수 있습니다.

필요하신 분들은 받아서 적용해 보세요^^

※ 기존에 사이트 통계를 적용하신 분들은 site_status.php 파일만 덮어쓰시고
사이트명, 특정레벨이상 보여주기 기능만 수정하여 쓰시면 됩니다.

<설치하기>

1. 먼저 페이지뷰 기능을 추가합니다.
네잎클로버님의 글 ( http://www.sir.co.kr/bbs/tb.php/g4_tiptech/2484 ) 참고

2. 첨부파일을 다운로드 받습니다.

3. 압축을 풀어 해당 파일,폴더를 업로드 합니다.

bul2.gif -> gboard4/img 폴더에 안에 업로드
connect_status -> gboard4/skin/connect 폴더 안에 업로드
visit_status -> gboard4/skin/visit 폴더 안에 업로드
site_status.php , graph.php -> gboard4 폴더 안에 업로드

4. visit_status 폴더 안에 visit.skin.php 파일의 42번째 줄

        // 그누보드 전체 디비용량 구하기
        $result = mysql_query("show table status from 자기DB명 like 'g4%'");

이 부분에서 자기DB명 부분에 자신의 DB명을 입력하세요.

5. 웹 상에서 site_status.php 페이지를 보여주시면 됩니다.


*** 2006.05.11 10:44 수정사항 ***

Division by zero 문제를 해결하였고, 몇개의 이미지 경로가 잘못되어 있는 것을 바로 잡았습니다.
Division by zero 에러가 나시는 분들은
sprintf 문자열을 검색하셔서 그 앞에 @ 기호를 붙여주시기 바랍니다.

sprintf -> @sprintf

*** 2006.05.11 17:21 수정사항 ***

site_status.php 파일의 95번째 줄

$year5_per = sprintf("%.2f",(($year5 / $total_year)*100));

여기서 $total_year -> $total_num 으로 수정하셔야 합니다.
지적해주신 푸름빠덜님 감사합니다.
추천
7
  • 복사

댓글 전체

대단하시네요...

그런데 아래와 같은. 에러가.. 발목을 잡네요 OTL...



Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in .............\gnuboard4\site_status.php on line 63

Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in .............\gnuboard4\site_status.php on line 64



음 회원 수가 넘 적어서 값이 없는듯. ㅡ0ㅡ;;;
허컥. 그냥 이렇게 함 바꾸어 보았다니 오류가 없어지네요. ㅡ3ㅡ;;
그냥 문구만 없애버릴려구..  했는데 일단 오류가 안뜨니... 패스랄까요. ㅋㅋ
혹 다른분들도 비슷한 경우가 있을까봐 남겨봅니다.


====수정전=========================

/*

연령분포

*/

$old1 = date("Ymd",strtotime("-9 year", time()));
$old2 = date("Ymd",strtotime("-19 year", time()));
$old3 = date("Ymd",strtotime("-29 year", time()));
$old4 = date("Ymd",strtotime("-39 year", time()));
$old5 = date("Ymd",strtotime("-49 year", time()));


====수정후=========================


/*

연령분포

$old1 = date("Ymd",strtotime("-9 year", time()));
$old2 = date("Ymd",strtotime("-19 year", time()));
$old3 = date("Ymd",strtotime("-29 year", time()));
$old4 = date("Ymd",strtotime("-39 year", time()));
$old5 = date("Ymd",strtotime("-49 year", time()));

*/
감사합니다.
너무 좋아요.
그런데 이것이 ....
Warning: Division by zero in /free/home/qtbang/html/7272/gnuboard4/site_status.php on line 95

www.7272.biz/gnuboard4/site_status.php

해결책을 부탁드립니다.

95라인은
  $year5_per = sprintf("%.2f",(($year5 / $total_year)*100));

좋은 시간되세요...
감사합니다.

@ 를 붙이니까 잘 됩니다.

그런데 우측 연령별과 지방이
좌측과 너무 떨어지는 현상은 무엇인지요...

즐거운 시간되세요
connect_status 폴더의 connect.skin.php , visit_status 폴더의 visit.skin.php 파일을 열으셔서
테이블로 구성된 부분을 잘 보시면 width=700 이라는 부분이 있습니다.
700 -> 350 으로 하시면 됩니다..

압축파일을 다시 다운받으셔도 해결됩니다..^^
좋은하루 되세요~
95라인에 $total_year가 $total_num로 바뀌어야 하는거 아닌가요? $total_year로 넘어오는 값이 없던데요

        $year5_per = sprintf("%.2f",(($year5 / $total_year)*100));
windows 사용하시는 분은 아래와 같이 고치시면 됩니다.

        // 30~39세
        $sql = " select count(mb_birth) as old from g4_member where `mb_birth`  > '$old4' and `mb_birth`  <= '$old3'";
        $row = sql_fetch($sql);
        $year3  = $row[old];

        // 40~49세
        $sql = " select count(mb_birth) as old from g4_member where `mb_birth`  > '$old5' and `mb_birth`  <= '$old4'";
        $row = sql_fetch($sql);
        $year4  = $row[old];

        // 50세 이상
        $sql = " select count(mb_birth) as old from g4_member where `mb_birth`  <= '$old5'";
        $row = sql_fetch($sql);
        $year5  = $row[old];
      =============================을 

        // 30~39세
        $sql = " select count(mb_birth) as old from g4_member where `mb_birth`  > ('$old4'-100000) and `mb_birth`  <= '$old3'";
        $row = sql_fetch($sql);
        $year3  = $row[old];

        // 40~49세
        $sql = " select count(mb_birth) as old from g4_member where `mb_birth`  > ('$old5'-200000) and `mb_birth`  <= ('$old4'-100000)";
        $row = sql_fetch($sql);
        $year4  = $row[old];

        // 50세 이상
        $sql = " select count(mb_birth) as old from g4_member where `mb_birth`  <= ('$old5'-200000)";
        $row = sql_fetch($sql);
        $year5  = $row[old];
=====================이렇게 고치시면 됩니다.
windows 사용자분들 빠진 것 있습니다.
$old1 = date("Ymd",strtotime("-9 year", time()));
$old2 = date("Ymd",strtotime("-19 year", time()));
$old3 = date("Ymd",strtotime("-29 year", time()));
$old4 = date("Ymd",strtotime("-39 year", time()));
$old5 = date("Ymd",strtotime("-49 year", time()));  를

$old1 = date("Ymd",strtotime("-9 year", time()));
$old2 = date("Ymd",strtotime("-19 year", time()));
$old3 = date("Ymd",strtotime("-29 year", time()));
$old4 = date("Ymd",strtotime("-29 year", time()));
$old5 = date("Ymd",strtotime("-29 year", time()));  로 바꿔야 합니다.
가로수님이 알려주신 부분을 추가해보니 적용이 잘 되네요....... 감사합니다.

윈도우...
디비 용량 구하기도 구현이 가능할까요 ㅇㅇ??

        // 그누보드 전체 디비용량 구하기
        $result = mysql_query("show table status from blueani like 'g4%'");
        $db_using = 0;
        while($dbData=mysql_fetch_array($result)) {
        $db_using += $dbData[Data_length]+$dbData[Index_length];
        }

        // 계정 용량 구하기
        $du = `du -csk`;
이상하게......

select vs_pageview as cnt from g4_visit_sum where vs_date = '2006-05-15'

1054 : Unknown column 'vs_pageview' in 'field list'

error file : /gnuboard4/site_status.php

저는 이렇게 나옵니다ㅠㅠ

어디가 잘못된걸까요?
skin/connect/connect_status/connect.skin.php 에서
<?=$row[total_cnt]?>
<?=$row[mb_cnt]?>
<?=$row[total_cnt]-$row[mb_cnt]?>

<?=$row2[total_cnt]?>
<?=$row2[mb_cnt]?>
<?=$row2[total_cnt]-$row2[mb_cnt]?>
로 고치면 됩니다....^^
Unknown column 'vs_pageview' in 'field list'  에러....

mysql에서 아래와 같이 필드 추가해야합니다...
alter table g4_visit_sum add vs_pageview int(11) not null after vs_count;

not null 이거 빼고 했드만 페이지뷰 카운트가 안되서 한참헤맸네여
다른분들도 도움 되셨으면 합니다 ^^
© SIRSOFT
현재 페이지 제일 처음으로