Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Mobile detect for php section
Mobile detect for php section
Mobile detect for php section
Hello
I thought I saw the recipe here (or somewhere) that I can put in the PHP tab to detect mobile.
I see this in the metamod recipes -- but am not sure how to modify it for chameleon.
/ detect iphones, ipods and ipads. You can stack several browsers together like this:
if ( $core_genius->check( "browser_type = iphone, ipod, ipad" ) ) return XXX;
For example, I assume for Chameleon I don't include the return XXX;
Any clarification will be appreciated _
Thanks
Rowby
Re: Mobile detect for php section
Hi Rowby,
the PHP section in the *detection* part of a Chameleon rule can return several types of things:
return true; // makes the rule succeed
return false; // makes the rule fail
return "4"; // makes the rule succeed and uses templatestyle with id#4. Rule chain exits immediately after that.
return "4:continue"; // makes the rule succeed, sets templatestyle id #4, and next rule in chain is run.
So in your case you probably just want to return true, to make the Succeed action get run.
Cheers,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Mobile detect for php section
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 1
- Guests Online:
- 140
- Online:
- uistr4qx
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked