2010-03-16, 15:24:32
Give this a shot. I can't test as I don't have an iPhone.
This should make the $TEMPLATE var equal to "iPhone" when the user is using an iPhone.
So when the below is called...
It should output like this...
Try and keep it simple. You were trying to make sure the iPhone folder exists... well, I wouldn't have this plugin if it didn't exist If you want to check for that, show it off in the admin panel.
This should make the $TEMPLATE var equal to "iPhone" when the user is using an iPhone.
Code:
add_hook('index-pretemplate','sic_change_theme');
function sic_change_theme() {
global $TEMPLATE;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') == true) {
$TEMPLATE = 'iPhone';
}
}
So when the below is called...
Code:
include("theme/".$TEMPLATE."/".$template_file);
Code:
include("theme/iPhone/".$template_file);
Try and keep it simple. You were trying to make sure the iPhone folder exists... well, I wouldn't have this plugin if it didn't exist If you want to check for that, show it off in the admin panel.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.
Have you ever coded in your underwear before?
Have you ever coded in your underwear before?