Support Forum

Members groups

RH Richard Heinz
Richard Heinz
Member

Is there a way to show the members of one group. When you click on members it shows all the groups from Admin to a group you may have added. I want to show only one group when a subscriber is logged in.

3 Answers

New Answer

MP Mr Papa
Mr Papa
Member

you can use the members list to show whatever you want…

in your spMembersView.php template file of the sp theme you are using, you will see the members list instantiated with something like:

sp_has_member_groups(‘usergroup’, ‘id’, ‘asc’, 15, true)

you can change those options to control the display… the prototype for the function is:

sp_has_member_groups($groupBy=’usergroup’, $orderBy=’id’, $sortBy=’asc’, $number=15, $limitUG=false, $ugids=”)

the $limitUG option determines whether users can see all usergroups or only ones that they are members of…

if you want to only list specific usergroups, then pass the IDs (comma separated) in the $ugids argument…

RH Richard Heinz
Richard Heinz
Member

Iam using the iForum template and edited the spMembersView.php file. I changed the statement to

sp_hasMember_groups(‘usergroup’, ‘id’, ‘asc’, 15, false) and it still gave me all the groups. So I change it to sp_hasMember_groups(‘usergroup’, ‘id’, ‘asc’, 15, false, 4) which is the group every subscriber is add to. I still get the Admins and the group Destiny Makers (4). Why does the Admin group still show? I expected it to be only the DestinyMakers group.

MP Mr Papa
Mr Papa
Member

not via the query there… but in you sp theme, yes…  so in the template file spMembersView.php, find this code:

                while (sp_loop_member_groups()) {
                    sp_the_member_group();

after it, add:

                    if ($spThisMemberGroup->usergroup_id == 0) continue;

and it wont show the admins…