Announcement

Collapse
No announcement yet.

Conditionals for secondary usergroups act different in vB5 - I need help with code?

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

  • Zachery
    replied
    You should use is_member_of instead of checking the membergroupids or base usergroup

    <vb:if condition="is_member_of($VAR, X)"> </vb:if>
    <vb:if condition="is_member_of($VAR, X,Y,Z)"> </vb:if>

    is_member_of checks both the base, and additional usergroup $VAR can be bbuserinfo, but any other var that has both the usergroup and membergroupids stored in it

    Leave a comment:


  • FBlack-HPath
    replied
    As an inelegant solution, I just added another conditional: (using membergroupids instead of usergroupid)

    <!-- START Side Tab Secondary -->
    <vb:if condition="in_array($bbuserinfo[membergroupids], array(13))">
    <a id="floating_link" href="http://somethingorother.com" target="_blank">Click Me</a>
    </vb:if>
    <!-- END Side Tab -->

    There has got to be a better way though. Suggestions?

    Leave a comment:


  • Conditionals for secondary usergroups act different in vB5 - I need help with code?

    I have a conditional in my template code, but it seems that it only selects for the 'Primary' usergroup. How can I set it to check for the Primary or Secondary usergroups?

    <!-- START Side Tab -->
    <vb:if condition="in_array($bbuserinfo[usergroupid], array(6,13,14))">
    <a id="floating_link" href="http://somethingorother.com" target="_blank">Click Me</a>
    </vb:if>
    <!-- END Side Tab -->

    Registered Users (group 2) with a special secondary group (group 13) can not see the tab, but Admins (primary group 6) can see the tab. I don't want to have to change 2000 registered users with a special secondary group set at 13 into members where their primary group needs to be set at 13 just to see the tab.

    Any help on the conditional would be much appreciated.

Related Topics

Collapse

Working...
X