Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Plugin
#2
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!
Reply


Messages In This Thread
New Plugin - by JWH_Matthew - 2010-03-14, 14:18:56
New Plugin - by Zegnåt - 2010-03-14, 19:11:28
New Plugin - by JWH_Matthew - 2010-03-14, 23:54:33
New Plugin - by Zegnåt - 2010-03-15, 00:40:12
New Plugin - by JWH_Matthew - 2010-03-15, 01:17:52



Users browsing this thread: 1 Guest(s)