Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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 smile_

Thanks

Rowby

rowby
Junior Modder
ranks
useravatar
Offline
24 Posts
User info in posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4421
Newest User:
rajajudi14
Members Online:
0
Guests Online:
140

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked