MyBB Community Forums

Full Version: Hiding certain fields (reputation) for Admin usergroup via profile?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What can I use to hide certain fields (such as reputation and other variables) in the member_profile templates for specific usergroups?

There are a few areas I would like to hide for admin only, but not sure what code to use. (I do have PHP Template Conditionals installed already)

For example, on admin only profiles (gid 4), I want reputation field to be hidden
This should show the content for the groups you choose only.

<if $user['usergroup'] != 1 or $user['usergroup'] != 2 then>
Your content
</if>
(2019-08-08, 01:33 AM)iAndrew Wrote: [ -> ]This should show the content for the groups you choose only.

<if $user['usergroup'] != 1 or $user['usergroup'] != 2 then>
Your content
</if>

Did not entirely work.

I just want to hide for example, reputation for admin users on member_profile (even when disabled in the usergroup settings, it still shows on profile)

Bump for assistance.
Bump for assistance.
Bump for assistance.
I'm not sure if this works.

$mybb->user['usergroup'] -> It's the usergroup of user who are viewing  the forum, maybe you.
$memprofile['usergroup'] -> It's the usergroup of which user you're viewing.

If you don't want users who are not in a particular group to see something, use the first one. Or if you want to hide some fields of users from a particular group, use the second one.

For example, prevent others from viewing reputation of users in the Administrators group, you'd like to have this in the member_profile template (I don't use PHP Template Conditionals, correct any syntax error yourself please), replace {$reputation} with:
<if $memprofile['usergroup'] == 4 then>
Hidden content.
<else />{$reputation}</if> 
(2019-08-08, 03:11 AM)makpaolo Wrote: [ -> ]I just want to hide for example, reputation for admin users on member_profile (even when disabled in the usergroup settings, it still shows on profile)
Probably because is hard coded the reputation field in your template and there's no need to hard code also the view condition. If you use {$reputation} variable in member_profile, member permissions will be automatically considered.