protected function checkMobile(){
if (defined('JOURNAL3_ACTIVE')) {
//error_log(print_r('Journal3 mobile detection algorithm used',true));
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== FALSE){
return 'mobile';
} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== FALSE){
return 'tablet';
} elseif ( (strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== FALSE) ){
return 'mobile';
} elseif ( (strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') == FALSE) ){
return 'tablet';
} else {
return false;
}
} else {
include_once(DIR_SYSTEM . 'library/Mobile_Detect/Mobile_Detect.php');
$detect = new Mobile_Detect();
if($detect->isTablet()){
return 'tablet';
} else if($detect->isMobile()){
return 'mobile';
} else {
return false;
}
}
}