26 if(!isset($theInstance))
28 $theInstance =
new Mobile();
41 return $oMobile->_isFromMobilePhone();
51 if($this->ismobile !== NULL)
57 return ($this->ismobile =
false);
63 $this->ismobile = FALSE;
70 $this->ismobile = TRUE;
74 $this->ismobile = FALSE;
77 elseif(isset($_COOKIE[
'mobile']))
79 if($_COOKIE[
'user-agent'] == md5($_SERVER[
'HTTP_USER_AGENT']))
81 if($_COOKIE[
'mobile'] ==
'true')
83 $this->ismobile = TRUE;
87 $this->ismobile = FALSE;
92 $this->ismobile = FALSE;
93 setcookie(
"mobile", FALSE);
94 setcookie(
"user-agent", FALSE);
97 $this->ismobile = TRUE;
105 $this->ismobile = FALSE;
111 $this->ismobile = TRUE;
116 if($this->ismobile !== NULL)
118 if($this->ismobile == TRUE)
120 if($_COOKIE[
'mobile'] !=
'true')
122 $_COOKIE[
'mobile'] =
'true';
123 setcookie(
"mobile",
'true');
126 elseif($_COOKIE[
'mobile'] !=
'false')
128 $_COOKIE[
'mobile'] =
'false';
129 setcookie(
"mobile",
'false');
132 if($_COOKIE[
'user-agent'] != md5($_SERVER[
'HTTP_USER_AGENT']))
134 setcookie(
"user-agent", md5($_SERVER[
'HTTP_USER_AGENT']));
155 $mobileAgent = array(
'iPod',
'iPhone',
'Android',
'BlackBerry',
'SymbianOS',
'Bada',
'Tizen',
'Kindle',
'Wii',
'SCH-',
'SPH-',
'CANU-',
'Windows Phone',
'Windows CE',
'POLARIS',
'Palm',
'Dorothy Browser',
'Mobile',
'Opera Mobi',
'Opera Mini',
'Minimo',
'AvantGo',
'NetFront',
'Nokia',
'LGPlayer',
'SonyEricsson',
'HTC');
157 if($oMobile->isMobilePadCheckByAgent())
163 foreach($mobileAgent as $agent)
165 if(stripos($_SERVER[
'HTTP_USER_AGENT'], $agent) !== FALSE)
187 $padAgent = array(
'iPad',
'Android',
'webOS',
'hp-tablet',
'PlayBook');
191 $exceptionAgent = array(0 => array(
'Opera Mini',
'Opera Mobi'),
'Android' =>
'Mobile');
193 foreach($padAgent as $agent)
195 if(strpos($_SERVER[
'HTTP_USER_AGENT'], $agent) !== FALSE)
197 if(!isset($exceptionAgent[$agent]))
202 elseif(strpos($_SERVER[
'HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
205 foreach($exceptionAgent[0] as $val)
207 if(strpos($_SERVER[
'HTTP_USER_AGENT'], $val) !== FALSE)
238 return ($db_info->use_mobile_view ===
'Y');
isMobilePadCheckByAgent()