PDA

View Full Version : Can I check for banned user in a template?


fly
02-03-2007, 02:19 PM
How can I check in a template to see if a user is banned? I tried just checking for the banned usergroup, but that doesn't seem to work. What could I be doing wrong?

Here is what I'm using:

<if condition="$bbuserinfo['usergroupid'] == 19">

but the banned users seem to pass that conditional right over. :confused:

WhaLberg
02-03-2007, 02:29 PM
Use

<if condition="$post[usergroupid] == 19">

or remove the '

<if condition="$bbuserinfo[usergroupid] == 19">

fly
02-03-2007, 05:31 PM
Hmmm, neither seem to work. I'm doing a bunch of checking in the header to see if a user is in different groups. All the others seem to work just fine. Is there some sort of limit on IF ELSE statements I can do? I currently have 4 lined up...

Kirk Y
02-03-2007, 07:06 PM
Depending on what template you're trying to check...
<if condition="is_member_of($bbuserinfo,9)">You're banned.</if>


What exactly are you trying to do?

fly
02-03-2007, 10:10 PM
Got it! It was actually a problem with template changes not trickling down. Basically, I'm stupid.

Anyway, when using that is_member_of, it will check for secondary groups too, right?

Kirk Y
02-03-2007, 10:34 PM
Yep, that's why it's better to use than $bbuserinfo[usergroupid].