[그누•영카트] 접속자 관리에서 브라우저와 OS 종류를 추가해보자

페이지 정보

루루아빠 3,092 2015.07.20 19:18

평점

  • 평점 : 0점 (0명 참여)

본문

그누보드5/lib/visit.lib.php를 아래 소스로 대체한다.

<?php
if (!defined('_GNUBOARD_')) exit;

// 방문자수 출력
function visit($skin_dir='basic')
{
    global $config, $g5;

    // visit 배열변수에
    // $visit[1] = 오늘
    // $visit[2] = 어제
    // $visit[3] = 최대
    // $visit[4] = 전체
    // 숫자가 들어감
    preg_match("/오늘:(.*),어제:(.*),최대:(.*),전체:(.*)/", $config['cf_visit'], $visit);
    settype($visit[1], "integer");
    settype($visit[2], "integer");
    settype($visit[3], "integer");
    settype($visit[4], "integer");

    ob_start();
    if(G5_IS_MOBILE) {
        $visit_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
        $visit_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
    } else {
        $visit_skin_path = G5_SKIN_PATH.'/visit/'.$skin_dir;
        $visit_skin_url = G5_SKIN_URL.'/visit/'.$skin_dir;
    }
    include_once ($visit_skin_path.'/visit.skin.php');
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}

// get_browser() 함수는 이미 있음
function get_brow($agent)
{
    $agent = strtolower($agent);

    //echo $agent; echo "<br/>";

    if (preg_match("/msie 5.0[0-9]*/", $agent))        { $s = "MSIE 5.0"; }
    else if(preg_match("/inapp/", $agent))              { $s = "NAVER Apps"; } //네이버어플
    else if(preg_match("/navercafe/", $agent))          { $s = "NAVER CAFE Apps"; } //네이버 카페어플
    else if(preg_match("/daumapps/", $agent))          { $s = "DAUM Apps"; } //다음어플
    else if(preg_match("/natebrowser/", $agent))        { $s = "NATE Apps"; } //네이트어플
    else if(preg_match("/9b176/", $agent))              { $s = "Google Apps"; } //구글어플
    //브라우저 어플 끝
    else if(preg_match("/maxthon/", $agent))            { $s = "Maxthon"; } //Maxthon
    else if(preg_match("/apple-pubsub/", $agent))      { $s = "Apple-PubSub"; } //Safari Feed Reader
    else if(preg_match("/mqqbrowser/", $agent))        { $s = "MQQBrowser"; } //MQQBrowser
    else if(preg_match("/diigobrowser/", $agent))      { $s = "DiigoBrowser"; } //DiigoBrowser
    else if(preg_match("/avant browser/", $agent))      { $s = "Avant Browser"; } //Avant Browser
    else if(preg_match("/embedded/", $agent))          { $s = "Embedded Web Browser"; } //Embedded Web Browser
    else if(preg_match("/browserng/", $agent))          { $s = "BrowserNG"; } //BrowserNG
    else if(preg_match("/smarthub|smart-tv|smarttv/", $agent))        { $s = "Smart TV"; } //Smart TV
    else if(preg_match("/flipboardproxy/", $agent))    { $s = "FlipboardProxy"; } //FlipboardProxy
    else if(preg_match("/wosbrowser/", $agent))        { $s = "wOSBrowser"; } //wOSBrowser
    //기타 브라우저 끝
    else if(preg_match("/google/", $agent))            { $s = "Google Robot"; } //구글로봇
    else if(preg_match("/mediapartners/", $agent))      { $s = "Google AdSense"; } //구글애드센스
    else if(preg_match("/-mobile/", $agent))            { $s = "Google-Mobile Robot"; } //구글모바일로봇
    else if(preg_match("/naver blog/", $agent))        { $s = "NAVER Blog Rssbot"; } //네이버블로그로봇
    else if(preg_match("/naver|yeti/", $agent))        { $s = "NAVER Robot"; } //네이버로봇
    else if(preg_match("/daum/", $agent))              { $s = "DAUM Robot"; } //다음로봇
    else if(preg_match("/yahoo/", $agent))              { $s = "Yahoo! Robot"; } //야후!로봇
    else if(preg_match("/empas|nate/", $agent))        { $s = "NATE Robot"; } //네이트로봇
    else if(preg_match("/bing/", $agent))              { $s = "Bing Robot"; } //Bing로봇
    else if(preg_match("/msn/", $agent))                { $s = "MSN Robot"; } //MSN로봇
    else if(preg_match("/zum/", $agent))                { $s = "Zum Robot"; } //Zum로봇
    else if(preg_match("/qrobot/", $agent))            { $s = "Qrobot"; } //Qrobot로봇
    else if(preg_match("/archive|ia_archiver/", $agent)){ $s = "Archive Robot"; } //아카이브로봇
    else if(preg_match("/twitter/", $agent))            { $s = "Twitter Robot"; } //Twitter로봇
    else if(preg_match("/facebook/", $agent))          { $s = "Facebook Robot"; } //Facebook로봇
    else if(preg_match("/whois/", $agent))              { $s = "Whois Search Robot"; } //Whois Search로봇
    else if(preg_match("/checkprivacy/", $agent))      { $s = "KISA"; } //한국인터넷진흥원
    //robots.txt로 차단 안되는 로봇
    else if(preg_match("/mj12/", $agent))              { $s = "MJ12bot"; } //MJ12bot
    else if(preg_match("/baidu/", $agent))              { $s = "Baiduspider"; } //Baiduspider
    else if(preg_match("/yandex/", $agent))            { $s = "YandexBot"; } //YandexBot로봇
    else if(preg_match("/Sogou/", $agent))              { $s = "Sogou web spider"; } //Sogou로봇
    else if(preg_match("/tweetedtimes/", $agent))      { $s = "TweetedTimes Bot"; } //TweetedTimes Bot
    else if(preg_match("/discobot/", $agent))          { $s = "Discoveryengine Robot"; } //Discoveryengine로봇
    else if(preg_match("/twiceler/", $agent))          { $s = "Twiceler Robot"; } //Twiceler로봇
    else if(preg_match("/ezooms/", $agent))            { $s = "Ezooms Robot"; } //Ezooms로봇
    else if(preg_match("/wbsearch/", $agent))          { $s = "WBSearchBot"; } //WBSearchBot
    else if(preg_match("/proximic/", $agent))          { $s = "proximic"; } //proximic로봇
    else if(preg_match("/GTWek/", $agent))              { $s = "GTWek"; } //GTWek로봇
    else if(preg_match("/java|python|axel|dalvik|greatnews|hmschnl|huawei|jakarta|netcraft|parrotsite|readability|unwind|pagepeeker|shunix|crystalsemantics|turnitin|komodia|siteIntel|apercite|butterfly/", $agent))          { $s = "Unknown Robot"; } //Unknown로봇
    else if(preg_match("/cron/", $agent))              { $s = "WebCron"; } //WebCron
    else if(preg_match("/capture/", $agent))            { $s = "WebCapture"; } //WebCapture로봇
    else if(preg_match("/w3c/", $agent))                { $s = "W3C Validator"; } //W3C Validator
    else if(preg_match("/wget/", $agent))              { $s = "Wget Validator"; } //Wget
    else if(preg_match("/hanrss/", $agent))            { $s = "HanRSS"; } //HanRSS
    else if(preg_match("/fetcher/", $agent))            { $s = "Feed Fetcher"; } //Feed Fetcher
    else if(preg_match("/feed|reader|rss|greatnews/", $agent))                  { $s = "Feed Reader"; } //Feed Reader
    else if(preg_match("/bot|slurp|scrap|spider|crawl|curl/", $agent))          { $s = "Robot"; }
    else if(preg_match("/msie 5.5[0-9]*/", $agent))    { $s = "MSIE 5.5"; }
    else if(preg_match("/msie 6.0[0-9]*/", $agent))    { $s = "MSIE 6.0"; }
    else if(preg_match("/msie 7.0[0-9]*/", $agent))    { $s = "MSIE 7.0"; }
    else if(preg_match("/msie 8.0[0-9]*/", $agent))    { $s = "MSIE 8.0"; }
    else if(preg_match("/msie 9.0[0-9]*/", $agent))    { $s = "MSIE 9.0"; }
    else if(preg_match("/msie 10.0[0-9]*/", $agent))    { $s = "MSIE 10.0"; }
    else if(preg_match("/msie 4.[0-9]*/", $agent))      { $s = "MSIE 4.x"; }
    else if(preg_match("/firefox/", $agent))            { $s = "FireFox"; }
    else if(preg_match("/chrome/", $agent))            { $s = "Chrome"; }
    else if(preg_match("/x11/", $agent))                { $s = "Netscape"; }
    else if(preg_match("/opera/", $agent))              { $s = "Opera"; }
    else if(preg_match("/safari/", $agent))            { $s = "Safari"; }
    else if(preg_match("/netFront/", $agent))          { $s = "NetFront"; }
    else if(preg_match("/gec/", $agent))                { $s = "Gecko"; }
    else if(preg_match("/internet explorer/", $agent))  { $s = "IE"; }
    else if(preg_match("/mozilla/", $agent))            { $s = "Mozilla"; }
    else { $s = "기타"; }


    return $s;
}



function get_os($agent)
{
    $agent = strtolower($agent);

    //echo $agent; echo "<br/>";

    //추가사항
    if(preg_match("/iphone/", $agent))                      { $s = "iPhone"; } //iPhone
    else if(preg_match("/ipad/", $agent))                   { $s = "iPad"; } //iPad
    else if(preg_match("/ipod/", $agent))                   { $s = "iPod"; } //iPod
    else if(preg_match("/android/", $agent))                { $s = "Android"; } //Android
    else if(preg_match("/psp/", $agent))                    { $s = "PSP"; } //PSP
    else if(preg_match("/playstation/", $agent))            { $s = "PLAYSTATION"; } //PLAYSTATION
    else if(preg_match("/berry/", $agent))                  { $s = "BlackBerry"; } //BlackBerry
    else if(preg_match("/symbian/", $agent))                { $s = "Symbian"; } //Symbian
    else if(preg_match("/ericsson/", $agent))               { $s = "SonyEricsson"; } //SonyEricsson
    else if(preg_match("/nokia/", $agent))                  { $s = "Nokia"; } //Nokia
    else if(preg_match("/benq/", $agent))                   { $s = "BenQ"; } //BenQ
    else if(preg_match("/mot/", $agent))                    { $s = "Motorola"; } //Motorola
    else if(preg_match("/nintendo/", $agent))               { $s = "Nintendo"; } //Nintendo
    else if(preg_match("/palm/", $agent))                   { $s = "Palm"; } //Palm
    else if(preg_match("/sch/", $agent))                    { $s = "T*옴니아"; } //T*옴니아
    else if(preg_match("/sph/", $agent))                    { $s = "애니콜"; } //삼성폰
    else if(preg_match("/sgh/", $agent))                    { $s = "옴니아"; } //옴니아
    else if(preg_match("/sch/", $agent))                    { $s = "T*옴니아"; } //T*옴니아
    else if(preg_match("/im-s/", $agent))                   { $s = "스카이폰"; } //스카이폰
    else if(preg_match("/lg/", $agent))                     { $s = "LG 사이언"; } //LG 사이언

    //기본사항
    else if(preg_match("/windows 98/", $agent))             { $s = "Win98"; }
    else if(preg_match("/windows 95/", $agent))             { $s = "Win95"; }
    else if(preg_match("/windows nt 4\.[0-9]*/", $agent))   { $s = "WinNT"; }
    else if(preg_match("/windows nt 5\.0/", $agent))        { $s = "Win2000"; }
    else if(preg_match("/windows nt 5\.1/", $agent))        { $s = "WinXP"; }
    else if(preg_match("/windows nt 5\.2/", $agent))        { $s = "Win2003"; }
    else if(preg_match("/windows nt 6\.0/", $agent))        { $s = "WinVista"; }
    else if(preg_match("/windows nt 6\.1/", $agent))        { $s = "Win7"; }
    else if(preg_match("/windows nt 6\.2/", $agent))        { $s = "Win8"; }
    else if(preg_match("/windows nt 6\.3/", $agent))        { $s = "Win8.1"; }
    else if(preg_match("/windows 9x/", $agent))             { $s = "WinME"; }
    else if(preg_match("/windows ce/", $agent))             { $s = "WinCE"; }
    else if(preg_match("/mac/", $agent))                    { $s = "MAC"; }
    else if(preg_match("/linux/", $agent))                  { $s = "Linux"; }
    else if(preg_match("/sunos/", $agent))                  { $s = "sunOS"; }
    else if(preg_match("/irix/", $agent))                   { $s = "IRIX"; }
    else if(preg_match("/phone/", $agent))                  { $s = "Phone"; }
    else if(preg_match("/bot|slurp/", $agent))              { $s = "Robot"; }
    else if(preg_match("/internet explorer/", $agent))      { $s = "IE"; }
    else if(preg_match("/mozilla/", $agent))                { $s = "Mozilla"; }

    //기타
    else { $s = "기타"; }

    return $s;
}
?>

 
추천인
  • 추천해 주세요
6
루루아빠 - 회원등급 : 최고관리자 - 포인트 : 1,290,006
레벨 96
경험치 1,387,199

Progress Bar 67%

- 가입일 : 2015-03-04 03:24:54
- 서명 : KNOW YOUR LIMITS BUT NEVER STOP TRYING TO EXCEED THEM !!
- 자기소개 : 루루의 자랑 루루아빠랍니다~~

댓글

첫 번째 댓글을 남겨 주세요

Total 7462838 페이지
제목 글쓴이 날짜 조회 추천
이윰  댓글+1🏆 이모티콘 크기 바꾸기 루루아빠 2015.07.23 2,779 0
그누•영카트  🏆 🚩 접속자 관리에서 브라우저와 OS 종류를 추가해보자 루루아빠 2015.07.20 3,093 0
그누•영카트  🏆 영카트 5.0.42 패치 루루아빠 2015.07.20 3,061 0
그누•영카트  🏆 그누보드 5.0.41 패치 루루아빠 2015.07.20 3,119 0
HTML5  🏆 HTML5 Video 반응형으로 만들기 루루아빠 2015.07.19 2,777 0
HTML5  댓글+1🏆 HTML5 Video 볼륨 조정하기 루루아빠 2015.07.19 3,520 0
이윰  🏆 modal 오픈시 modal-dialog 아래 background body 스크롤 안되게 하기 루루아빠 2015.07.16 6,558 0
그누•영카트  🏆 최고관리자의 레벨이 올바르지 않을때 루루아빠 2015.07.15 2,961 0
그누•영카트  🏆 영카트 5.0.41 패치 루루아빠 2015.07.13 6,188 0
그누•영카트  🏆 그누보드 5.0.40 패치 루루아빠 2015.07.13 2,948 0
이윰  댓글+1🏆 스타일박스 패치, ios 관련 패치 루루아빠 2015.07.09 3,158 0
서버  댓글+1🏆 PHP 파일 업로드 갯수 수정하기 루루아빠 2015.07.09 3,567 0
이윰  🏆 로그인을 메인으로 - 회원제 사이트 - 폐쇄형 사이트용 루루아빠 2015.07.08 3,220 0
그누•영카트  🏆 영카트 5.0.40 패치 루루아빠 2015.07.07 2,990 0
그누•영카트  🏆 그누보드 5.0.39 패치 루루아빠 2015.07.07 2,895 0
이윰  🏆 Eyoom Builder 1.1.7 패치 루루아빠 2015.07.06 2,911 0
그누•영카트  🏆 영카트 5.0.39 패치 루루아빠 2015.06.30 3,535 0
그누•영카트  🏆 그누보드 5.0.38 패치 루루아빠 2015.06.30 3,353 0
이윰  댓글+1🏆 최신글 랜덤으로 뽑기 루루아빠 2015.06.29 3,144 0
이윰  🏆 사운드클라우드와 게시글 정보와의 간격 조정 루루아빠 2015.06.28 3,500 0