MyBB Community Forums

Full Version: Filter Member List By Additional Groups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I adapted the instructions in this tutorial (http://community.mybb.com/post-550832.html) to create a separate memberlist.php page (renamed so that I can still use the original as well) that displays only members of a certain primary user group. The opposite of what the tutorial does essentially: instead of filtering out a certain user group but displaying all others, I filtered it to only display one user group. That page works flawlessly for my purposes. However, I would like to create further member list pages for displaying members of a couple of other user groups.

The problem is that these are essentially subgroups of the main group that I have displayed on my modified member list page. No one has these groups set as their primary user group, and a member may belong to multiple of these groups.

So as far as I can see the only way I can make the extra member list pages the way I want them is if they not only check for usergroup, but also additionalgroups in the filter. The problem is I have no idea how to set up a filter for additionalgroups as well. If I add an if statement to the memberlist.php that checks if user's additionalgroups is equal to the group ID that I want to be displayed, that only works if that group is the ONLY additional group that the member belongs to. That is, it doesn't work if the member is a member of that group and another group in additionalgroups.

I'm not sure how easy or difficult this is, but I am hoping you could assist me in making the member list check whether ONE of the user's additional groups is equal to a certain group id. Therefore allowing the member list to display a member that is a member of that group in additionalgroups, but not in usergroup.

Thanks in advance.