Possible to select usergroups to display in member list?

TheBigK

Well-known member
I hope I'm not overlooking the things, but I'd want only select members to show up in our member lists. Is there a way to show only selected user-groups in the member list? Our member list is sorted alphabetically and users with ZERO post counts show up on the top - which makes kind of a not-good impression.
 
You will have to edit the ControllerPublic/Member.php file for this.
On line 48 you will find:
PHP:
$criteria = array(
    'user_state' => 'valid',
    'is_banned' => 0
);
Replace it with:
PHP:
$criteria = array(
    'user_state' => 'valid',
    'is_banned' => 0,
    'secondary_group_ids' => array(3,7)
);

That will only grab users from those secondary groups.
If you want to grab primary groups simply use user_group_id instead.
 
That's a cool way. Upgrade will wipe out those changes, though, right? I hope XF upgrade is coming soon :D.

For the time being, I'll update the code.
 
MOZ has made a Memberlist Manager and I have been talking to him about adding this kind of ability. He cannot finish it right now as he has exams but he's doing it for me at the end of the month.

In admin I select the usergroups to display on the standard memberlist.
As admin I can also Search on frontend to see my selection of usergroups.
 
Top Bottom