View Full Version : Need help with user permission codes

25 Nov 2009, 17:28

I have a script in vb4 footer template, and I want to allow some usergroups and also want to disallow some user ids. how can I do that and what codes will be used?


25 Nov 2009, 19:15
If you wanted to do it just in a template (which will proably be easier and faster in most cases.

<vb:if condition="{vb:var bbuserinfo.userid} == 1"> Show this</vb:if>

Since you are combining uergroups and id's you may end up using nested if statements.

Another optoins which you could use and it will be ALOt easier (this is what I did), make a special userfield for permission, make the fault no and then whoever youw anted to give permission to just change it to yes. Then just use an i statement ont he user field.

First Look at vBulletin 4 Template Variables (http://www.vbulletin.org/forum/showthread.php?t=217569)

First take a look at this one First Look at vBulletin 4 Template Tags (http://www.vbulletin.org/forum/showthread.php?t=217570)

<vb:if condition="$show['guest']">
<div class="alert">You are a guest, no soup for you.</div>
<vb:elseif condition="$is_member_of($bbuserinfo,6)" />
<div class="adminalert">Hello {vb:raw bbuserinfo.musername}! Let's get to work.</div>
<vb:else />
<div class="useralert">Welcome Back {vb:raw bbuserinfo.musername}!</div>