setcookie for detected device

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7575 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2010-07-02 09:44:46 +00:00
parent 875ab37b07
commit 074074623f

View file

@ -33,7 +33,13 @@ class 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']);
else {
if(preg_match('/(iPod|iPhone|Android|BlackBerry|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT']))
{
setcookie("mobile", true);
$this->ismobile = true;
}
}
}
return $this->ismobile;