Support Forum

Hide User Groups Membership Information?

Michael Walden
Free Members
Oct 17, 2017 - 7:34 pm

Is it possible turn off or remove the ability for users to see what user groups other members belong to? For example on a post in the author box it lists the user name, rank and then groups the author is a member of.

For privacy reasons I would like to disable the display of user group membership in the author box and in member lists as well. I do not want to hide the user, just their user group membership information.

I would also prefer that this information NOT be hidden from admins and moderators. Of curse I just have to be difficult...¬† ūüôā

This would be a very nice admin option and perhaps as a preference setting in the user profile options so that a user can decide whether or not his or her user group affiliation is displayed.

Mr Papa
Simi Valley, CA
Free Members
Oct 18, 2017 - 3:13 am

not sure I really understand the use case for hiding the usergroup memberships, but doesnt really matter...  our themes are very much like WP themes... everything displayed is controlled by template functions... you have complete control over what is display or not displayed...

so you just need to qualify the display of usergroup info int he topic view template file...

but first, I really need to ask for clarification...  when you say author box, are you referring to the author info section to the right (in most themes) of topic posts???  or other?  do you mean the profile?

as with WP themes, in SP themes you have complete control over what is displayed or not via the template files and the functions within...

of course, before making any sp theme mods, you really should make a child theme or a custom theme...

for example in your sp theme, look for this (assuming you meant profile):

                                        sp_UserMembership('', $spProfileUser->memberships);

to only display for admins and mods, change to

                                        if ($spThisUser->admin || $spThisUser->moderator) sp_UserMembership('', $spProfileUser->memberships);

and it will only be displayed to admins and mods...  this example is from reboot, but applies to other themes that display it...  worth noting, its also for the profile popup template file... you may want the same change for the profile display template file...

The members list you mention is a bit more problematic.. and needs more questions and understanding... 

do you even want to show a members list??  normally, its organized by usergroup... if you dont want folks to know memberships, may make more sense to just remove the members list...  we can help if that is what you really want to do...

if you just want a singular list of members, you might look in your members view template for this line

                        if (sp_has_member_groups('usergroup', 'id', 'asc', 15, true)) {

and change it to

                        if (sp_has_member_groups('user', 'id', 'asc', 15, true)) {

and see if that gives you what you want...

Michael Walden
Free Members
Oct 18, 2017 - 3:34 am

I'll explain briefly. The site is for an organization that has various levels. I have created a user group and forum for the general membership of this organization as well as a user group and forum for each level of this organization. We would prefer that the users level within the organization not be common knowledge. Does that make any sense?

I guess my questions was much more loaded than I assumed haha! That's me all over!

Using this forum as a reference by authorbox I mean the information that is displayed 

<--- Here My name, avatar etc... I would like to remove the User Group titles from there. 

To solve the member list issue, I just restricted it to admins and mods. Easy enough fix once I had some sleep  haha!

While I am at it, is the login on the sidebar a widget that is available for the current release or is that coming up in the future release? I could sure use it ūüôā

Yellow Swordfish
Glinton, England
Oct 18, 2017 - 5:41 am

It's a home-grown custom widget. Too entwined in our membership plugin etc., to be if use to anyone else. But you should find similar widgets in the WP plugin repository.

Michael Walden
Free Members
Oct 20, 2017 - 12:08 pm

I resolved this by commenting out the line that displays the group membership in topic displays (it was already done in the mobile topic display template).

In our case the displaying usergroup membership is important only to admins and mods who can see it in the membership list. 

Thank you! exclaim