Log in

View Full Version : If user is a member of... (in postbit)


LostForWords
09-12-2010, 08:13 PM
Hey there, I've found a number of coding possibilities for this but non of them have worked and kinda confused me.

Basically what I'm looking for is an <if> code for the postbit (and memberinfo) where I can say 'if user is a member of usergroup A, display this' etc. However it needs to apply at all times, even if the member is in two other usergroups and group A is not the primary or display group.

I'm already using user ranks for something else so this <if> code is quite important :)

Thanks in advance.

Lynne
09-12-2010, 08:48 PM
What have you tried so far?

LostForWords
09-16-2010, 04:56 PM
Errr variations of this:

https://vborg.vbsupport.ru/showthread.php?t=130906&highlight=postbit+usergroup

Lynne
09-16-2010, 05:44 PM
The last one he posted should work in the postbit:
<if condition="is_member_of($post, 9)">

But, it's hard to tell why it isn't since you haven't told us anything about where you are using it or exactly what your code is. $post is not the variable you would use on the member page though. I think $userinfo is what you use (or $prepared, depending).

LostForWords
09-19-2010, 08:59 PM
That worked perfectly for the postbit! Thanks so much.

Is there an equivalent for the member profile?

Lynne
09-19-2010, 09:38 PM
Is there an equivalent for the member profile?
I already said....
The last one he posted should work in the postbit:
<if condition="is_member_of($post, 9)">But, it's hard to tell why it isn't since you haven't told us anything about where you are using it or exactly what your code is. $post is not the variable you would use on the member page though. I think $userinfo is what you use (or $prepared, depending).