PDA

View Full Version : Need help with user permission codes


Veer
11-25-2009, 03:28 PM
Hello,

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?

Thanks.

Zaiaku
11-25-2009, 05:15 PM
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 (https://vborg.vbsupport.ru/showthread.php?t=217569)

First take a look at this one First Look at vBulletin 4 Template Tags (https://vborg.vbsupport.ru/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>
</vb:if>