MyBB Community Forums

Full Version: Need conditional check
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to hide threads and posts on home for everyone except admins moderators and super moderators for some reason can't make it work?

forumbit_depth1_cat template


Hide to everyone except these groups!
<if (!in_array($mybb->user['usergroup'], array(3,4,6))) then>
!inarray => NOT in array

given condition --> if user does not belong to groups 3, 4, 6 then do the following
Thanks M but it just hides it from everyone WHY

$mybb->user['uid'] && $mybb->user['usergroup'] == 4

How to add more than one group to this conditional????


How about this one?

<if $mybb->user['uid'] && $mybb->user['usergroup'] == 3 || $mybb->user['usergroup'] == 4 || $mybb->user['usergroup'] == 6  then>
<if in_array($mybb->user['usergroup'], array('3', '4', '6')) then>
show required content
</if>

as we are checking for specific user groups, we need not check if viewer is a logged in member ..
Thanks buddy very much!