* Wapper How do you do it in php? Whats the script in php xtgem uses to detect?
2014-07-07 04:42 · (0)
* youngestdj * Wapper It can be done with css media queries. You can also write a function that detects mobile devices based on their user agents
2014-07-07 08:19 · (0)
* net3x * Wapper i have one. that i used..
2014-07-07 08:25 · (0)
* Wapper * net3x Share please
2014-07-08 00:58 · (0)
* Wapper * net3x It seems good https://github.com/serbanghita/Mobile-Detect
2014-07-08 03:03 · (1)
* TechnoSparks * Wapper That script is the one that the Device Redirection Widget uses.
The script is quite popular and actively commited in their repo, however, due some PHP limitations by XtGem, you cannot use that script locally on XtGem.
I like that script due to its great functions :)
2014-07-08 09:39 (edited 2014-07-08 09:40 by TechnoSparks ) · (0)
* net3x * Wapper
<?php
function isMobile(){
return 
preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i"$_SERVER["HTTP_USER_AGENT"]);}
if(
isMobile())
header("Location:  http://m.MOBILESITE.com/index.php");
else{
echo
"This is web version";
}
?>

Copy code


U use this simple code to redirect mobile user to "M" folder..

another way is include theme using SERVER HTTP USERAGENT
2014-07-08 18:40 · (0)
* net3x * Wapper u can easily use it on XtGem or any php enable site. It works fine..
2014-07-08 18:44 · (1)
* TechnoSparks * Wapper net3x php code may work as well, but do keep in mind in order for his code to work, you will need to put it at the start of the file. With no spaces at the start of the file.
Else, the script won't work and will output error. Location headers needs to be read before any text are sent to the browser.
2014-07-09 08:22 · (0)

Online: Guests: 1