1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any Chance of ismemberof Accepting Multiple Usergroup IDs in 1.1?

Discussion in 'General XenForo Discussion and Feedback' started by James, Jul 22, 2011.

  1. James

    James Well-Known Member

    Just curious - will it be there?!

    (Question aimed at XF devs - obviously)
     
  2. Kier

    Kier XenForo Developer Staff Member

    I'll look to see what's involved.
     
    James likes this.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Do you mean like this?

    <xen:if is="!{xen:helper ismemberof, $visitor, 3} AND !{xen:helper ismemberof, $visitor, 4}">

    Or do you mean as an array?
     
  4. James

    James Well-Known Member

    Like this:
    <xen:if is="{xen:helper ismemberof, $visitor, 3, 4, 5,}">

    Where 3,4,5 represent IDs. Of course, that's the vB approach and they may choose something like:
    <xen:if is="{xen:helper ismemberof, $visitor, {xen:array 3,4,5}}">
     
  5. Kier

    Kier XenForo Developer Staff Member

    The xen:array syntax is a little ugly in that instance, I'd prefer to have {xen:helper ismemberof, $user, 2, 3, 4, 5} I think.
     
    Onimua and James like this.
  6. James

    James Well-Known Member

    Me too, but I was just suggesting alternatives :D
     
  7. Kier

    Kier XenForo Developer Staff Member

    Done :)
     
    CyberAP, pjfry, James and 4 others like this.
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Will the old method continue to work alongside?
     
  9. Kier

    Kier XenForo Developer Staff Member

    Yes, it's fully backward compatible.

    Old:
    {xen:helper ismemberof, $user, $userGroupId}

    New:
    {xen:helper ismemberof, $user, $userGroupId1, $userGroupId2, ... $userGroupIdx}
     
    Valhalla, DeltaHF, A.E. and 5 others like this.

Share This Page