PDA

View Full Version : membergroupids Conditional


Saphrym
09-29-2004, 07:04 PM
I know the syntax for doing a conditional that checks equality for a groupid.

I'm trying to find out if there's a way to do a template conditional that returns true if a certain ID is in membergroupids WITHOUT being equal to it.

I.E. I want an image to be posted to the left of the poster name on the postbit IF they are a member of a certain group OR a secondary member of a group.

Revan
09-29-2004, 07:10 PM
I do not know if the following will work for both primary and secondary usergroups, but anyways:
if condition="is_member_of($id_of_group)"> html here <else> other html here </if>
Note that most of my "from memory" coding doesnt work right away, so please dont flame me if this turns out to become soup :p

Saphrym
09-29-2004, 07:34 PM
I do not know if the following will work for both primary and secondary usergroups, but anyways:
if condition="is_member_of($id_of_group)"> html here <else> other html here </if>
Note that most of my "from memory" coding doesnt work right away, so please dont flame me if this turns out to become soup :p

Hmmm... No... that doesn't seem to work. Let me see if I can find the boolean syntax for if an item is contained in an array. If there is such a thing.

Saphrym
09-29-2004, 07:39 PM
Well... I should have known that would have been a useless search. No such thing. Argh.

Zachery
09-29-2004, 09:05 PM
<if condition="is_member_of($var, X)"> user is part of X <else /> user is not part of x</if>

$var should contain membergroupids in it, such examples are $bbuserinfo and $post

X should be the group you want to check for.

Saphrym
09-30-2004, 12:16 AM
<if condition="is_member_of($var, X)"> user is part of X <else /> user is not part of x</if>

$var should contain membergroupids in it, such examples are $bbuserinfo and $post

X should be the group you want to check for.

Ok I tried this:

is_member_of($bbuserinfo['membergroupids'], 9)

It resulted in true for everyone on my forums... even the people who were NOT members of group 9. Did I do something wrong?

Saphrym
09-30-2004, 12:20 AM
Ok I tried this:

is_member_of($bbuserinfo['membergroupids'], 9)

It resulted in true for everyone on my forums... even the people who were NOT members of group 9. Did I do something wrong?
Nevermind.

This worked:

<if condition="is_member_of($post, 9)">

Thanks!