• 북마크
  • 1:1문의
  • 새글
  • 회원가입
  • 로그인

팁 & 테크

  • Home
  • 스터디
  • 팁 & 테크

브라우저와 OS 종류를 추가해 봅니다.

3,379 2015.07.20 09:11

첨부파일

짧은주소

본문

첨부한 파일을 LIB 폴더에 있는 파일과 교체해 주시면 됩니다.

백업은 필수요.

 

소스는 아래와 같습니다.


<?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;
}

?>

1
좋아요!
0
- 암스원 메일보내기 아이디로 검색 - 회원등급 : 씨앗/Level 4 - 포인트 : 6,644
레벨 4
경험치 1,586

Progress Bar 49%

- 가입일 : 2015-06-11 01:12:56
- 서명 : 배달전용 보온용기, 한통도시락
- 자기소개 : http://zangzip.com
댓글목록

메탎포스님의 댓글

^^ 오~ 어플까지 다양하게 지원해주나보네요~

축하합니다. 첫댓글 포인트 31포인트를 획득하였습니다.

shadow님의 댓글

소중한 자료 감사합니다.
방문자의 디바이스와 사용 브라우져를 살펴보는데 큰 도움이 될 듯 하네요.

비즈팔님의 댓글

정말 상세한 방문자 정보를 얻을 수 있겠군요.
자료 감사합니다.

소다님의 댓글

감사합니다. ^^ 덕분에 사용자 분석에 많은 도움이 되겠네요!

암스원님의 댓글

제가 편하게 쓰려고 조금 수정한 것을 나눌 뿐입니다.

크롱크롱님의 댓글

멋진소스 잘쓰겠습니다. 감사합니다.

robell님의 댓글

감사합니다

미스트님의 댓글

감사합니다. 도움이 되는 자료입니다.^^

축하합니다. 행운의 포인트 30포인트를 획득하였습니다.

퓨리프리님의 댓글

최고에요 진심..

Total 123건 1 페이지
번호 제목 글쓴이 날짜 추천
123 이윰EGG 아이디로 검색 2016.08.24 3,615 0
122 절대섹쉬꽃미남 아이디로 검색 2016.08.12 2,644 1
121 그림자밟기 아이디로 검색 2016.03.26 1,573 0
120 그림자밟기 아이디로 검색 2016.03.26 1,435 1
119 l2zeo 아이디로 검색 2016.01.27 1,649 0
118 수퍼개미 아이디로 검색 2015.10.27 2,553 0
117 l2zeo 아이디로 검색 2015.10.26 9,433 0
116 l2zeo 아이디로 검색 2015.10.26 2,705 0
115 shadow 아이디로 검색 2015.10.06 5,336 1
114 shadow 아이디로 검색 2015.09.21 1,632 0
113 shadow 아이디로 검색 2015.09.20 1,685 1
112 l2zeo 아이디로 검색 2015.09.18 6,547 0
111 shadow 아이디로 검색 2015.09.17 1,235 1
110 shadow 아이디로 검색 2015.09.17 1,981 0
109 shadow 아이디로 검색 2015.08.17 3,277 1
108 shadow 아이디로 검색 2015.07.30 2,947 1
열람 암스원 아이디로 검색 2015.07.20 3,380 1
106 이윰넷 아이디로 검색 2015.07.08 3,774 1
105 갓구운빵 아이디로 검색 2015.07.03 1,891 0
104 암스원 아이디로 검색 2015.07.01 3,143 2
LOGIN
사이드 메뉴

최신글이 없습니다.

최신글이 없습니다.

출석 랭킹

오늘의 랭킹

회원사진

닉네임

개근왕

최다1위

shadow shadow
Ranking

    출력할 랭킹이 없습니다.

  • 01 shadow
    674,374
  • 02 신비
    335,419
  • 03 가을하늘
    204,735
  • 04 mame
    202,630
  • 05 이윰MOUNT
    199,181
  • 06 미스코리아
    163,939
  • 07 레오나르도
    147,576
  • 08 테크니션
    142,655
  • 09 이윰IN
    135,258
  • 10 비온뒤맑음
    127,882
  • 01 shadow
    28,938
  • 02 joosam
    23,606
  • 03 티보리
    21,954
  • 04 홍인
    18,644
  • 05 레오나르도
    18,088
  • 06 이윰IN
    17,983
  • 07 도깨비
    16,614
  • 08 이윰EGG
    16,105
  • 09 자이언트
    14,698
  • 10 미스트
    14,379