Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » MetaMod for Mobile Device + Logged...
MetaMod for Mobile Device + Logged In/Out + PC/Laptop
MetaMod for Mobile Device + Logged In/Out + PC/Laptop
Joomla 1.5.22
MetaMod 2.6 (Free)
Everything is working.
Searched combination of keywords and was hard to find a related topic. Probably nobody asked this before.
My goal is to know recipe is for (MetaMod):
Show A, if user is logged out and using a Mobile Device.
Show B, if user is logged out and using Desktop/Laptop.
Show C, if user is logged in and using a Mobile Device.
Show D, if user is logged in and using Desktop/Laptop.
Same for IE and Firefox too.
------------------------------------------------------
Code I am using is:
if ( MM_NOT_LOGGED_IN and $core_genius->check( "browser_type = IE" ) ) return 129;
else return 99;
if ( MM_LOGGED_IN and $core_genius->check( "browser_type = IE" ) ) return 129;
else return 126;
Re: MetaMod for Mobile Device + Logged In/Out + PC/Laptop
Bearing in mind that JomGenius does not have full mobile device detection (just android, ipad, iphone, ipod), I think I'd structure it like this:
$is_mobile = $core_genius->check( "browser_type = ipod, iphone, ipad, android" );
$is_ie = $core_genius->check( "browser_type = ie" );
$is_ff = $core_genius->check( "browser_type = firefox" );
if ( MM_NOT_LOGGED_IN ) {
if ( $is_mobile ) return AAA;
if ( $is_ie ) return BBB;
if ( $is_ff ) return CCC;
return DDD; // any other device, for non-logged in (incl googlebot etc)
}
// from here on we know they are logged in:
if ( $is_mobile ) return EEE;
if ( $is_ie ) return FFF;
if ( $is_ff ) return GGG;
return HHH; // any other device, for logged-in users
Replace AAA-HHH with the relevant module ids that you want to use for those devices.
Cheers,
Stephen
Re: MetaMod for Mobile Device + Logged In/Out + PC/Laptop
That's why I like being able to configure MetaMod in PHP: it's relatively easy to structure any sort of rules like this and combine different conditions alone or in combination with others.
- Index
- » MetaMod
- » MetaMod General Support
- » MetaMod for Mobile Device + Logged...
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:
- 0
- Guests Online:
- 112
- 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