Update mobiletool.php
This commit is contained in:
parent
beff73d2de
commit
53ac08b647
|
@ -7,7 +7,7 @@
|
||||||
* @documentation https://www.w3.org/Mobile/training/device-detection/mobile_detector.txt
|
* @documentation https://www.w3.org/Mobile/training/device-detection/mobile_detector.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(check_function_exists("detect_mobile")) {
|
if(!check_function_exists("detect_mobile")) {
|
||||||
function detect_mobile() {
|
function detect_mobile() {
|
||||||
// This function returns the value of a local variable ($mb)
|
// This function returns the value of a local variable ($mb)
|
||||||
// that is 0 if a desktop client is detected and > 0 for mobile.
|
// that is 0 if a desktop client is detected and > 0 for mobile.
|
||||||
|
@ -34,7 +34,8 @@ if(check_function_exists("detect_mobile")) {
|
||||||
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
|
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
|
||||||
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
|
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
|
||||||
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
|
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
|
||||||
'wapr','webc','winw','winw','xda','xda-');
|
'wapr','webc','winw','winw','xda','xda-'
|
||||||
|
);
|
||||||
|
|
||||||
if(in_array($mobile_ua, $mobile_agents)) {
|
if(in_array($mobile_ua, $mobile_agents)) {
|
||||||
$mb++;
|
$mb++;
|
||||||
|
@ -58,6 +59,16 @@ if(check_function_exists("detect_mobile")) {
|
||||||
$mb++;
|
$mb++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// detect android os
|
||||||
|
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'android') > 0) {
|
||||||
|
$mb++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// detect tizen os
|
||||||
|
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'tizen') > 0) {
|
||||||
|
$mb++;
|
||||||
|
}
|
||||||
|
|
||||||
return $mb;
|
return $mb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user