The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Moderator Permissions -how to work out what the numbers mean in the moderator table?
I'm guessing they use the MySQL OPTION code and work in a similar way to user options.
Anyone got a table of what numbers mean what? Thanks. |
#2
|
|||
|
|||
If you look in file includes/xml/bitfield_vbulletin.xml for <group name="moderatorpermissions"> and <group name="moderatorpermissions2">, you'll see constants defined for each bit of the permissions and permissions2 columns. In the vbulletin scripts these are available in $vbulletin->bf_misc_moderatorpermissions and $vbulletin->bf_misc_moderatorpermissions2. So for instance if you read a moderator's permission value for a given forum and you want to check if they have caneditposts permission, then you'd do something like:
Code:
if ($permission & $vbulletin->bf_misc_moderatorpermissions['caneditposts']) { } or if you're going to the database directly and you don't have $vbulletin, Code:
if ($permission & 1) // 1 is value of caneditposts from bitfield_vbulletin.xml { } you might also want to look at functions can_moderate() and fetch_moderator_permissions() in includes/functions.php (or if you're including global.php in your script, you might just want to call thoses functions to do the check). |
#3
|
||||
|
||||
Many thanks, that's solved it for me:
Code:
SELECT username FROM user , moderator WHERE user.userid = moderator.userid AND permissions &4096 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|