I have added a bit of code to the new mobile module to detect iPads and NOT send them to the mobile site/theme since the iPad displays most webpages fine.
I've tested it on my iPad 32G wifi, and double checked that it still displayed the mobile theme on my iphone.
1. So to get started I added the following code into MobileBrowserDetector.php at line 29:
public static function is_ipad() {
return (preg_match('/ipad/i', $_SERVER['HTTP_USER_AGENT'])) ? false : false;
}
2. then in MobileBrowserDetector.php at line 69:
case(self::is_ipad()):
$isMobile = true;
break;
3. Then had to remove "mobile |" from line 66, so it reads:
case(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|pda|psp|treo)/i', $agent)):
$isMobile = true;
break;
4. added the following code to MobileSiteControllerExtension.php on line 87:
public function IsiPad() {
return MobileBrowserDetector::is_ipad();
}
I'm sure that I might have messed up a few thigns by removing "mobile |" in step 3, for other devices, but I wanted to serve the normal site to iPads, and the mobile version to iPhones. I have tested and this has worked. Im not sure about other mobile devices.
In case any one wants the iPad User agent string here it is:
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
Im not the best a php, and would be interested if anyone could help me add how to serve an iPad specific template to the iPad, and iPad only.
Or it any one know s a better way to do what i just did please help :)
you can see the results on the running simple website www.trackhopper.co.nz