View Full Version : Conditionals
theArchitect
09-06-2005, 04:46 AM
I am running 3.5.0 RC 2 and I am having problems writing a conditional. I have made a template change to my forum home page but only want certain user groups to be able to see it.
How do I enclose the html in a conditional so that it is only visable to specified user groups?
At the moment I am using this code that I found on here
<if condition="!is_member_of($userinfo, 25)">
Your ad code
</if>Only problem is that it doesn't seem to work.
Adrian Schneider
09-06-2005, 05:02 AM
That looks fine, just note that the ! means NOT. If you only want to show it to group 25, and show it to all but 25, remove the !.
theArchitect
09-06-2005, 05:36 AM
That looks fine, just note that the ! means NOT. If you only want to show it to group 25, and show it to all but 25, remove the !.
Thanks, but when I use this nothing shows up and I get an
array_merge error in in "function.array-merge" /includes/functions.php (1033) : eval()'d code in line 2
and the same thing error but in line 4 also.
Clearly I am doing somehing wrong.
Try replacing $userinfo in the conditional itself to $vbulletin->userinfo. (And you will have to be a member of group 25 for it to work even if you are an administrator)
theArchitect
09-06-2005, 05:54 AM
Many thanks. That has done the trick. Though, I am still getting the array_merge error.
Have you added any other conditionals with "$userinfo" in them?
If you remove the conditional does the array merge error go away?
Adrian Schneider
09-06-2005, 05:24 PM
Where are you using this? $userinfo is only available (AFAIK) when viewing a user's profile.
$bbuserinfo / $vbulletin->userinfo = current user
theArchitect
09-06-2005, 10:33 PM
Where are you using this? $userinfo is only available (AFAIK) when viewing a user's profile.
$bbuserinfo / $vbulletin->userinfo = current user
I am using it on the forum home page. I only ended up with the $userinfo as I found another post on here asking about conditionals and this was the answer.
https://vborg.vbsupport.ru/showthread.php?t=95494
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.