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

페이지 정보

yadolee 루루아빠 3,497 2015.07.20 19:18:14

평점

  • 평점 : 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;
}
?>

 
추천인
  • 추천해 주세요
yadolee
6
루루아빠 - 회원등급 : 최고관리자 - 포인트 : 1,332,814
레벨 100
경험치 1,488,440

Progress Bar 11.47%

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

댓글

첫 번째 댓글을 남겨 주세요

Total 3491618 페이지

제목 글쓴이 날짜 조회 추천
그누•영카트  🏆 영카트 5.1.1 (카카오페이, 간편결제 추가) 패치 루루아빠 2015.10.11 3,228 0
그누•영카트  🏆 영카트 5.1.0 (테마지원) 패치 루루아빠 2015.10.11 3,720 0
그누•영카트  🏆 모바일에서 로고 이미지 올바르게 위치시키기 루루아빠 2015.10.11 3,117 0
그누•영카트  🏆 그누보드 5.1.2 패치 루루아빠 2015.10.11 3,069 0
그누•영카트  댓글+2🏆 💾 네이버 웍스 모바일을 이용해 소유 도메인으로 메일 서비스 이용하기 루루아빠 2015.10.06 3,458 1
그누•영카트  🏆 영카트 이미지 가운데 정렬과 이미지 간격 수정 루루아빠 2015.08.28 2,933 0
그누•영카트  🏆 영카트 5.0.44 패치 루루아빠 2015.08.28 2,975 0
그누•영카트  🏆 그누보드 5.1.1 패치 루루아빠 2015.08.28 2,664 0
그누•영카트  🏆 인기검색어 갯수와 일자 수정하기 루루아빠 2015.08.24 2,621 0
그누•영카트  댓글+1🏆 비밀글 특정 레벨이상 보여주기 루루아빠 2015.08.17 3,129 0
그누•영카트  🏆 그누보드5 최소 글수 제한 관리자와 특정레벨 예외로 하기 루루아빠 2015.08.05 3,051 0
그누•영카트  🏆 그누보드 5.1.0 패치 루루아빠 2015.08.03 2,922 0
그누•영카트  🏆 영카트 5.0.43 패치 루루아빠 2015.07.27 2,770 0
그누•영카트  🏆 그누보드 5.0.42 패치 루루아빠 2015.07.27 3,035 0
그누•영카트  🏆 🚩 접속자 관리에서 브라우저와 OS 종류를 추가해보자 루루아빠 2015.07.20 3,498 0
그누•영카트  🏆 영카트 5.0.42 패치 루루아빠 2015.07.20 3,451 0
그누•영카트  🏆 그누보드 5.0.41 패치 루루아빠 2015.07.20 3,488 0
그누•영카트  🏆 최고관리자의 레벨이 올바르지 않을때 루루아빠 2015.07.15 3,402 0
그누•영카트  🏆 영카트 5.0.41 패치 루루아빠 2015.07.13 6,528 0
그누•영카트  🏆 그누보드 5.0.40 패치 루루아빠 2015.07.13 3,197 0