Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Hiding Custom Fields from Guests?
Gstone Offline
Member
***
Posts: 55
Joined: May 2012
Post: #1
Hiding Custom Fields from Guests?
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.

05-26-2012 11:45 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Hiding Custom Fields from Guests?
Try uisng $GLOBALS['mybb']->user['usergroup'] ?

05-27-2012 06:02 AM
Find all posts by this user Quote this message in a reply
Gstone Offline
Member
***
Posts: 55
Joined: May 2012
Post: #3
RE: Hiding Custom Fields from Guests?
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.
05-30-2012 02:23 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: