Timan, on Apr 30th 2009, 01:50 PM, said:
Theres one big problem with this tho.
The templates would remain the same. If I was to do a mobile skin, I would have every single template redone to just have the most basic functionality. (check out my windows-mobile skin at
www.neowin.net/forum/)
eh ok, how about checking the user agent string?
something like this (can use some inprovement):
<?php
$browser = $_SERVER['HTTP_USER_AGENT'];
if($browser == 'Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20'){
//ipod touch with safari 2.2.1
}elseif($browser == 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20'){
//iphone with safari 2.2.1
}elseif($browser == 'Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/419.3'){
//ipod touch with safari 1.1.4
}elseif($browser == 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/419.3'){
//iphone with safari 1.1.4
}
//else we'll assume a desktop.
?>these are the correct browser agent strings but the problem with this is,
you can set them to be like this in some browsers, even if you don't have a iphone/ipod touch