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.

 

J!1.6: Display a different module for each user group

J!1.6: Display a different module for each user group

Hey,

Thanks a lot for sharing this amazing tool! I've been very happy to use it on my J!1.5 site, and now I can finally use it on my J!1.6/1.7 site. Yay! smile

I run a membership site with several user groups:
-Public
-Registered
-Member
-Board member
-Employee
-Partner
-Sponsor

In the header, I want to display a different banner/image for each of these user groups.

I've accomplished the first two, but the "Member" banner won't show. The "Registered" banner is displayed to members also (and all the other self defined user groups). So, at this time my users can only be divided in "logged in" and "not logged in".

Any ideas what I can do to accomplish what I want?

These are the rules I use (found them in the recipes section):

Code:

if ( MM_NOT_LOGGED_IN ) return 44;

if ( MM_USER_REGISTERED ) return 46;
if ( $user->usertype == "My Special Group Name" ) return 54;

System: Joomla 1.6.5/MetaMod 3.1.
URL: http://www.norskgrunderforum.no/

General Secretary at Norsk Gründerforum (Norwegian Entrepreneur Forum), an entrepreneurial association with focus on innovation.
http://www.norskgrunderforum.no/
http://www.facebook.com/norskgrunderforum

Midnightman
Beginner Modder
ranks
useravatar
Offline
9 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

Hi Midnightman,

I suggest that you use the JomGenius syntax for doing this. I revamped it for the new J1.6 group memberships, and it seems to work nicely.

You should be able to do:

if ( MM_NOT_LOGGED_IN ) return 44;
if ($core_genius->check("groups = Public")) return 1;
if ($core_genius->check("groups = Registered")) return 2;
if ($core_genius->check("groups = Member")) return 3;
if ($core_genius->check("groups = Board Member")) return 4;
if ($core_genius->check("groups = Employee")) return 5;
if ($core_genius->check("groups = Partner")) return 6;
if ($core_genius->check("groups = Sponsor")) return 7;


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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

Yes indeed, it works like a charm. Thanks a lot, Stephen! Amazing stuff! smile

I have to apologize for my late reply, it's because I've been on vacation.

Cheers! smile

General Secretary at Norsk Gründerforum (Norwegian Entrepreneur Forum), an entrepreneurial association with focus on innovation.
http://www.norskgrunderforum.no/
http://www.facebook.com/norskgrunderforum

Midnightman
Beginner Modder
ranks
useravatar
Offline
9 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

Just updated Joomla to 2.5.1 and MetaMod to 3.8, and it seems this recipe no longer work. Any ideas why?

General Secretary at Norsk Gründerforum (Norwegian Entrepreneur Forum), an entrepreneurial association with focus on innovation.
http://www.norskgrunderforum.no/
http://www.facebook.com/norskgrunderforum

Midnightman
Beginner Modder
ranks
useravatar
Offline
9 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

Yes, I have a fix for this, will go in next update of the software, intended within 7 days.

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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

Great, thx. smile

General Secretary at Norsk Gründerforum (Norwegian Entrepreneur Forum), an entrepreneurial association with focus on innovation.
http://www.norskgrunderforum.no/
http://www.facebook.com/norskgrunderforum

Midnightman
Beginner Modder
ranks
useravatar
Offline
9 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

Out of interest, do you also have Chameleon installed? The version of JomGenius in the current version of Chameleon is not up to date with the version in MetaMod 3.8, and the Chameleon version overrides the MM one in certain situations. Therefore, Chameleon can actually break MetaMod since it has an older version.

interested,
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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

No, I don't have Chameleon. Thx for following up. smile

General Secretary at Norsk Gründerforum (Norwegian Entrepreneur Forum), an entrepreneurial association with focus on innovation.
http://www.norskgrunderforum.no/
http://www.facebook.com/norskgrunderforum

Midnightman
Beginner Modder
ranks
useravatar
Offline
9 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

Ok, 3.8 should really have this fixed (compared to 3.7).

Can you try the following code in the PHP box:

echo "Groups: ";
print_r($core_genius->info("groups"));


Then log in with a member of some of the different groups and see what it comes up with. If that doesn't work then there must be something else going on... but try that first.

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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: J!1.6: Display a different module for each user group

I don't know PHP programming. Should I remove any of the old code? I tried pasting this code before the old code, with the following results:

When not logged in, this text:

Code:

Groups: Array ( )

displays over the module.

When logged in no module displays, and I get this text:

Code:

Groups: Array ( [0] => Member [1] => Superadmin [2] => Board Member [3] => Employee )

Yes, I belong to all 4 groups. smile

Additional info:
Before the upgrade, the only module (image) showing when I was logged in was the "Member" image. That was possibly not correct, but it was fine by me. smile

General Secretary at Norsk Gründerforum (Norwegian Entrepreneur Forum), an entrepreneurial association with focus on innovation.
http://www.norskgrunderforum.no/
http://www.facebook.com/norskgrunderforum

Midnightman
Beginner Modder
ranks
useravatar
Offline
9 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10772
Newest User:
alton29318
Members Online:
0
Guests Online:
227

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