Javascript to edit pages while viewing in browser. Windows Forums (WindowsForums.org) is Back !
Jan 12

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’,’wiijay’);
}

// This is for Windows Mobile Devices
if (false !== stristr($useragent, ‘Windows CE’)) {
define(’JZ_FRONTEND_OVERRIDE’,’slimzora’);
define(’JZ_STYLE_OVERRIDE’,’sandstone’);
global $jzSERVICES;
$jzSERVICES->loadService(‘players’,'ptunes’);
}

// 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’,’simple’);
}
?>

3 Responses to “Mobile Detection for Jinzora by me”

  1. Hadi Mohamed Says:

    this is wap modification for jinzora ! tested and working !

  2. tmahroof Says:

    Gr8 work Hadi!! Me too was in search of this 1…gud!!

  3. Hadi Mohamed Says:

    i think you are not using jinzora. if you need this modified for your website, say

Leave a Reply