Announcement

Collapse
No announcement yet.

Excluding usergroup from condition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Excluding usergroup from condition

    How do I exclude a usergroup from a condition? ie

    HTML Code:
     ><if condition="((condition))">

  • #2
    Use this:

    HTML Code:
    <if condition="!is_member_of($bbuserinfo, X) AND !is_member_of($bbuserinfo, Y) AND !is_member_of($bbuserinfo, Z)">
    ... change X, Y, and Z to the ID's of the usergroups that you want to exclude. You can remove any one of those "AND..." bits depending on how many you need, you can also add more of them.
    Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

    Comment


    • #3
      thx - so the condition is satisfied, it excludes them - seems like it would do the opposite...

      Comment


      • #4
        ...or instead of
        HTML Code:
        <if condition="!is_member_of($bbuserinfo, X) AND !is_member_of($bbuserinfo, Y) AND !is_member_of($bbuserinfo, Z)">
        you could use
        HTML Code:
        <if condition="!is_member_of($bbuserinfo, array(X,Y,Z))">
        which is more elegant.

        Comment


        • #5
          Originally posted by Gearloose
          ...or instead of
          HTML Code:
          <if condition="!is_member_of($bbuserinfo, X) AND !is_member_of($bbuserinfo, Y) AND !is_member_of($bbuserinfo, Z)">
          you could use
          HTML Code:
          <if condition="!is_member_of($bbuserinfo, array(X,Y,Z))">
          which is more elegant.
          Actually I do not think that is_member_of can take an array() as the second argument. I could be wrong though; I do not have the code in front of me.
          Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

          Comment


          • #6
            I think you can just use x,y,z instead of an array...

            Comment


            • #7
              Oops! I should use in_array($bbuserinfo[usergroupid], array(X,Y,Z)) instead is_member_of.
              My bad.

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              X