Searched a lot for mobile detection code, at last made my own.
Tested on jinzora 2.7.5.
Replace /frontend/useragent.php with the following code :
<?php
// constants:
// JZ_FRONTEND_OVERRIDE
// JZ_STYLE_OVERRIDE
// JZ_LANGUAGE_OVERRIDE
// todo: jukebox
$useragent = $_SERVER['HTTP_USER_AGENT'];
// This is for the Nintendo Wii
if (false !== stristr($useragent, ‘Nintendo Wii’)) {
define(’JZ_FRONTEND_OVERRIDE’
}
// This is for Windows Mobile Devices
if (false !== stristr($useragent, ‘Windows CE’)) {
define(’JZ_FRONTEND_OVERRIDE’
define(’JZ_STYLE_OVERRIDE’,
global $jzSERVICES;
$jzSERVICES->loadService(
}
// Mobile Detection by Hadi (hadimhd.com) - don’t remove this line
$mobile=0;
$mobile_enabled=1; // 1 -on , 0- off
if ($mobile_enabled==1)
{
$mobilebrowsers = array(
“WebTV”,
“AvantGo”,
“Blazer”,
“PalmOS”,
“lynx”,
“Go.Web”,
“Elaine”,
“ProxiNet”,
“ChaiFarer”,
“Digital Paths”,
“UP.Browser”,
“Mazingo”,
“Mobile”,
“T68″,
“Syncalot”,
“Danger”,
“Symbian”,
“Symbian OS”,
“SymbianOS”,
“Maemo”,
“Nokia”,
“Xiino”,
“AU-MIC”,
“EPOC”,
“Wireless”,
“Handheld”,
“Smartphone”,
“SAMSUNG”,
“J2ME”,
“MIDP”,
“MIDP-2.0″,
“320×240″,
“240×320″,
“Blackberry8700″,
“Opera Mini”,
“NetFront”,
“BlackBerry”,
“PSP”
);
if(preg_match(’/(’.implode(’|', $mobilebrowsers).’)/i’, $_SERVER['HTTP_USER_AGENT'], $match))
{
$mobile=1;
}
}
if ($mobile==1)
{
define(’JZ_FRONTEND_OVERRIDE’,
}
?>
January 20th, 2008 at 12:11 pm
this is wap modification for jinzora ! tested and working !
June 17th, 2008 at 9:16 pm
Gr8 work Hadi!! Me too was in search of this 1…gud!!
June 18th, 2008 at 7:04 am
i think you are not using jinzora. if you need this modified for your website, say