PDA

View Full Version : Conditional statement for Primary or Secondary Usergroup selection?


BatCave
02-01-2014, 12:50 AM
I have the following code for a usergroup conditional, but it only seems to work for primary usergroups. How can I have it look for primary or secondary?


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

(Conditional codes seem to have changed a lot since vB4x)

BatCave
02-01-2014, 01:27 AM
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?