Joomla 1.0 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
- How to have the plugins processed when genrating PDF documents of content items?
- How to have DirectPHP commands processed in Joomla search?
Joomla 1.5 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
- How to have the plugins processed when genrating PDF documents of content items?
- How to have DirectPHP commands processed in Joomla search?
|
Auto Template Switcher for iPhone |
| Written by kksou | |||||||||||||||||
| Monday, 01 September 2008 | |||||||||||||||||
|
This module allows you to automatically switch to a different template just for iPhone or iPod users. Table of ContentsFor all other users using standard browsers (e.g. Mozilla, IE, Safari), they will see your default template. I designed this initially to serve different templates for iPhone/iPod users. But you can use this for other browsers too, for example, if you wish to serve different templates for iMac, Windows and Linux users. Important for Joomla 1.5 users !!! You need to change one line in the Joomla core for this to work. In file /includes/application.php in function getTemplate (around line 281), change the line if ($template = $this->get('setTemplate')) {
to this one if ($template = $this->getUserState('setTemplate')) {
Latest Version v1.01 (for Joomla 1.0) and v1.51 (for Joomla 1.5) In addition to switching template on different user agents, you can now also specify the inital designated page that will be displayed when a template-switch occurs. For example, you can automatically redirect an iPhone user to a dedicated iPhone home page when he or she comes to your site. You can specify different url page corresponding to each template and user agent in the parameters page of the Module Manager. Note that a redirect to the designated page will only occur when there's a template switch. If there's no swtich of template, there will be no redirect to the page. Thanks to Wayne Geddings for suggesting the above enhancement. How it works?The module uses $_SERVER['HTTP_USER_AGENT']to detect user's browser. For example, the value returned by iPhone is: Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) The program uses The module allows you to specify up to 3 different browser user agents. For example, when you first installed the "Auto Template Switcher" module, the default settings are as follows: Browser 1: iPhone For each browser, you specify the corresponding templates. The following shows the default settings when the module is first installed. The templates are those that come bundled with standard Joomla installation.
The default browser is used when there's no match against browser 1, browser 2 or browser 3. Note that the auto-switching of the template is achieved through the use of module. The only purpose of the module is to detect the user agent and auto switch the template. It does not display anything. So if you set "Show Title" to "No", the module will be invisible. Unique Features
DownloadNote: Due to the recent "warning" from my host that my site's CPU usage is too high, I have to resort to a more primitive method of downloading that does not take up much CPU resource. (The original AJAX version uses too much CPU and mysql resources.) As javascript is used, you have to enable javascript to download the files. Thank you for your understanding. Joomla 1.0.x: autotemplateswitcher_v1.01.zipJoomla 1.5.x: autotemplateswitcher_v1.51.zip How to install
User reviews Average user ratings: 4.5 (from 6 users) Note: You have to be a registered member to leave a comment. Free registration here. |
|||||||||||||||||
| Last Updated ( Monday, 01 September 2008 ) | |||||||||||||||||
| < Prev | Next > |
|---|




4.5 (from 6 users)
September 18, 2008 11:07pm
The perfect extension would be a plugin that sent any mobile visitor to the designated Home Mobile page and adjusted for the browser (IE, Firefox, Google Chrome, etc.
September 24, 2008 12:44am
Hi Wayne,
Please try the latest version v1.01 (for Joomla 1.0) and v1.51 (for Joomla 1.5).
I've incorporated this feature into the new version i.e. you can now specify the inital designated page that will be displayed when a template-switch occurs
Regards,
/kksou
September 27, 2008 8:00am
I use jomla 1 , after 2 hours can't manage to make it work, install was fine, module is publish, can't find why it's not working www.api4.me/joomla/ thanks for helping
September 27, 2008 8:37am
If I publish the module, the site doesn't work at all anymore
September 27, 2008 9:43am
What's the error message that you get? Please provide some details so that we have some clues as to what might have happened.
1. Can you please try on a fresh install of Joomla first. Did it work?
Try this first so that at least you'll know if it works on your machine.
2. If (1) works, try it on your other site that you said didn't work. Please list the entries that you've entered in the parameters page. e.g. user_agent1=?, template1=?, user_agent2=?, template2=?, etc. Please also list the names of the folders in the folder /templates
Regards,
/kksou
September 28, 2008 12:45am
thanks for the answer
here it is http://www.api4.me/joomla/switcher.jpg
this was done on a fresh install of joomla, i don't have any error message, the template just doesnt switch on IE,fox or Iphone
I will try reinstalling a new version of joomla
thanks for the help