2010-03-14, 19:11:28
OWS_Matthew Wrote:How should I go about automatically changing the theme for the iphone?
Code:
<?php
global $TEMPLATE;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== FALSE) {
$TEMPLATE = 'iphone_theme_name'; // the theme’s folder name, /themes/iphone_theme_name/template.php etc.
}
?>
OWS_Matthew Wrote:What Plugin Hooks do I need to use for this to work?The above code should run on the ‘index-pretemplate’ hook.
Please note that I did not take the time to test everything I’ve said here. But it should work… I guess.
OWS_Matthew Wrote:Would any one actually be interested in this other than me?I think there will be, especially once version 2 gives you a nice GUI to configure it. And, as there already is an iPhone theme, this could be used almost immediately.
“Don’t forget the important ˚ (not °) on the a,†says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!