mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
use cookie to identify mobile option
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7555 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
901a0e8d01
commit
003b499c40
1 changed files with 11 additions and 1 deletions
|
|
@ -23,7 +23,17 @@ class Mobile {
|
|||
}
|
||||
else
|
||||
{
|
||||
$this->ismobile = Context::get('mobile') || preg_match('/(iPod|iPhone|Android|BlackBerry|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT']);
|
||||
$m = Context::get('m');
|
||||
if($m == "1") {
|
||||
setcookie("mobile", true);
|
||||
$this->ismobile = true;
|
||||
}
|
||||
else if($m === "0") {
|
||||
setcookie("mobile", "");
|
||||
$this->ismobile = false;
|
||||
}
|
||||
else if($_COOKIE["mobile"]) $this->ismobile = true;
|
||||
else $this->ismobile = preg_match('/(iPod|iPhone|Android|BlackBerry|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT']);
|
||||
}
|
||||
|
||||
return $this->ismobile;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue