The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#2
|
||||
|
||||
![]() Code:
if (!in_array($vbulletin->userinfo['usergroupid'], array(5, 6, 12))) { print_no_permission(); } The way in_array() function works is simple: It checks through the array until an element matches, then it stops performing the rest of the check and returns a boolean result. That improves the code performance. So if you are a member of usergroupid 6 and 12, it will not check for 12, since 6 is already true. Still, is better to avoid those type of usergroup checks and use instead the vBulletin bitfield permissions. For example, if I want to see if an user is an admin, I can use this: Code:
$show['adminoption'] = (bool)($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']); if $show['adminoption'] { // my action here... } In global.php there are few boolean conditions already defined. I dont understand why no hacker use them in their code. They are there to be used, since they are already defined, so there is no need to perform extra code processing re-defining them again and again. For example, $show['admincplink'] will check if you are an admin (uses deprecated code ![]() $show['modcplink'] checks if you are either an admin or mod. Take your time and look at the code, is pretty cool what you can find in there. ![]() Those forums are made for posting, so others will be able to learn from threads, code examples, etc. If you ask a question on an IRC channel, how do you think others will learn from your current problem? Have fun with your vb hacking. ![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|