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

짧은주소
-
https://yadolee.com/tip/252 주소복사
평점
본문
그누보드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;
}
?>
추천인

레벨 99
경험치 1,478,262
Progress Bar 77.32%
- 가입일 : 2015-03-04 03:24:54
- 서명 : KNOW YOUR LIMITS
BUT NEVER STOP TRYING TO EXCEED THEM !!
- 자기소개 : 루루의 자랑
루루아빠랍니다~~
-
[배경 화면] 프랑스의 에귀으 듀 샤흐도네(Aiguille du Chardonnet)산으로 스위스와 접경지에 위치해 있습니다. /*0) generatedType=2; if (generatedType==2) { dMap.style.cursor = "pointer"; dMap.onclick = function(e) {initGmapsLoader(e||event)}; var t = document.createTextNode("로딩하려면 클릭하세요"), d = document.createElement("div"); d.appendChild(t); d.style.cssText="background-color:#e5e5e5; filter:alpha(opacity=80); opacity:0.8; padding:1em; font-weight:bold; text-align:center; position:absolute; left:0; box-sizing:border-box; width:100%; max-width:500px; top:0"; dMap.appendChild(d); } function CreateGMapgmap202421141257() { var dMap = document.getElementById("gmap202421141257"); if (dMap) dMap = dMap.parentNode; else dMap = document.getElementById("wgmap202421141257"); if (!dMap) return; if (dMap.ckemap) { var map = dMap.ckemap.map, center = map.getCenter(); google.maps.event.trigger(map, "resize"); map.setCenter(center); return; } dMap.onclick = null; var mapOptions = { zoom: 11, center: [45.96864,7.00157], mapType: 0, zoomControl: "Default", mapsControl: "Default", heading: 0, tilt: 0, overviewMapControlOptions: {opened:true}, pathType: "Default", googleBar: false }; var myMap = new CKEMap(dMap, mapOptions); dMap.ckemap=myMap; } if (!window.gmapsLoaders) window.gmapsLoaders = []; window.gmapsLoaders.push(CreateGMapgmap202421141257); if (generatedType==3) window.gmapsAutoload=true; window.gmapsKey="AIzaSyApiu_e4Br_dRpB-RNC3XgioygMilKhadA"; /*]]>*/ /* CK googlemapsEnd v3.6 */2024-03-05
-
[공지사항] 특별한 버그가 발견되지 않으면 공개하도록 하겠습니다.2024-01-23
-
[공지사항] 한가지를 빼먹었습니다 사운드클라우드도 썸네일을 생성합니다 사운드클라우드는 meta tag > og:image > content의 url를 통해 이미지를 추출2023-05-05
-
[공지사항] 제법 추가해야 할 소스가 많습니다 또한 외부 프로그램(php exec 함수 이용)도 필요해요 ffmpeg, youtube-dl, twitter-media-downloader 간략하게 설명을 드려 볼게요 twitter-media-downloader은 트위터 트윗 이미지를 추출하는 용도 youtube-dl은 트위터 트윗 이미지 및 동영상 url, 페이스북 watch 동영상 url를 추출하는 용도 ffmpeg는 페이스북 watch의 동영상 url를 이용해 포스터 이미지를 추출하는 용도 인스타그램은 meta tag > og:image > content의 url를 통해 이미지를 추출 그 이미지를 게시판 설정 크기로 썸네일화하기2023-05-04
-
[공지사항] 네 맞습니다. Tagify 기능이 훌륭해 변경해 놓았습니다. 한번 적용해 보세요.2022-12-25
-
[영어 문법] 7년 전 게시되었을 때에는 재생에 문제가 없었던 것으로 기억하고 있었으나 현재에는 재생 목록 파라미터가 변경된 걸로 확인했습니다. 수정완료하였으며 3000점의 경험치를 제공해 드렸습니다. 오류 제보 감사드립니다.2022-12-04
-
[공지사항] 공지와 연관되지 않는 댓글은 자제 부탁드립니다.2022-12-03
-
[공지사항] SortableJS를 이용했습니다. https://inpa.tistory.com/entry/%EB%93%9C%EB%9E%98%EA%B7%B8-%EC%95%A4-%EB%93%9C%EB%A1%AD-Drag-Drop-%EA%B8%B0%EB%8A%A5 {코드} https://github.com/SortableJS/Sortable {코드}위 두 링크를 참조해 보세요.2022-11-27
댓글
첫 번째 댓글을 남겨 주세요