MyBB Hacks

Full Version: Hiding Custom Fields from Guests?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been trying several different ways of hiding the value of custom fields from guests (and validating/banned), but no luck. I'm not really any good with this stuff, so that's probably why.

This is what I tried doing:

PHP Code:
<if !in_array($GLOBALS['users']['usergroup'], array(1,5,7)) then>
{$customfieldval}
</if>


It gives me an error when I view a profile. I've also tried different If statements, and one successfully hid the content... but to every user, despite only wanting it for the 3 usergroups above.

Any help with this would be much appreciated. =)

And again, I really have no idea what I'm doing, so if this is completely wrong... then you know why, haha.

Try uisng $GLOBALS['mybb']->user['usergroup'] ?
Thank you. I actually found out my problem was because I was trying to use this in a template not compatible with the plugin (MyNetwork). It was dumb of me.

I've successfully used it in the regular templates.
Reference URL's