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.

 

Show module when a member of a jomssocial Group

Show module when a member of a jomssocial Group

I need some help with the following issue:

I would like to show a mod to only those that are a member of a group.

Not sure how to do this.

Using the latest Joomla and Metamod and Jomsocial ?

Thanks in advance

Addy
Beginner Modder
ranks
useravatar
Offline
12 Posts
Administrator has disabled public posting

Re: Show module when a member of a jomssocial Group

After some messing around i have finally been able to make this work:

Code:


$userid = $user->id;
$query = "select * from #__community_groups_members where memberid = '$userid';";
$db->setQuery( $query );
$row = $db->loadObject();

$group = $row->groupid;
$member = $row->memberid;
$approv = $row->approved;

if ( $member > 0 ) {
if ( $group == 3 && $approv == 1 ) return 59;
}

This will check the database for JomSocial and if a joomla user id is in the group you want to to show a module too, it will.

Addy
Beginner Modder
ranks
useravatar
Offline
12 Posts
Administrator has disabled public posting

Re: Show module when a member of a jomssocial Group

Hey that's awesome - thanks so much for sharing this!

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

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11570
Newest User:
moises1247
Members Online:
1
Guests Online:
152

Online: 
moises1247

Forum Legend:

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