2010-03-16, 14:53:53
Why don't we check just the folder?
Code:
function sic_change_theme() {
global $TEMPLATE, $SITEURL;
$iPhoneTemplate = 'iPhone';
$file = $SITEURL . '/theme/' . $iPhoneTemplate;
$found = strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone');
if (file_exists($file) && $found == true) {
$TEMPLATE = $iPhoneTemplate;
}
}