The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
HowTo Create Custom Usergroup Permissions
Usergoup Permissions are being controlled through XML files, you don't have to edit usergroup.php anymore To create your own usergroup permissions, the first thing to do is to modify table usergroup (keep table prefixes in mind!): [sql]ALTER TABLE usergroup ADD myhackpermissions INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL ;[/sql] If your hack does need some integer settings as well (and not just On/Off-Options): [sql]ALTER TABLE usergroup ADD myhackintset INT( 10 ) DEFAULT '100' NOT NULL ;[/sql] Then you must create a an XML-File bitfield_myhack.xml and place it in includes/xml: HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <bitfields product="vbulletin"> <bitfielddefs> <group name="ugp"> <group name="myhackpermissions"> <bitfield name="canfoo" group="my_hack_permissions" phrase="can_foo_forum" install="1,2,3,4,5,6,7">1</bitfield> <bitfield name="canbaa" group="my_hack_permissions" phrase="can_baa_forum" install="">2</bitfield> <bitfield intperm="true" name="myhackintset" group="my_hack_permissions" phrase="myhack_int_desc"></bitfield> </group> </group> </bitfielddefs> </bitfields> Parameter product of Tag bitfields should be the identifier of your Product Paramater name of Tag group must match the column name in table usergroup. The Parameters for Tag bitfield are:
The value of <bitfield> is the decimal value of the bit (eg. 1 for the first, 2 for the second, 4 for the third, and so on). In case of an Integer Option this is the default value. If you want to hide certain permission groups for some usergroups, for example from Guests as they don't make sense for them: HTML Code:
<ignoregroups> <group name="myhackpermissions" ignoregroups="1" /> </ignoregroups> Place this section below the <bitfielddefs>-Section. Now create the necessary phrases (in Phrasegroup Permissions) at this point. As vBulletin caches Bitfields in Datastore, you must rebuild this cache before the new usergroup permissions can be actually used (They will already show up in Usergroup Manager, but cannot be saved - you will get an error). To do so, point your browser to admincp/index.php?do=buildbitfields. You can also use the following Code (in a Custom Installer or Install-Code of a Product) to update the Bitfield Cache: PHP Code:
This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent. |
#22
|
|||
|
|||
I've had a look and I see that it also adds a field in the usergroup permissions area.
However, I'd like to know how I could add some extra permission fields in the forum area (admincp/forum.php). |
#23
|
||||
|
||||
Not possible without editing the File.
|
#24
|
|||
|
|||
Ah, okay, thanks.
It was driving me crazy. |
#25
|
|||
|
|||
Can anyone please explain to me the forumpermissions bits, how will I get the permissions out of there... thank you...
|
#26
|
|||
|
|||
Here's my bitfield_vbgarage.xml and here's the error I get once my custom permissions are in place:
HTML Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <bitfields product="vBulletin"> <bitfielddefs> <group name="ugp"> <group name="canvbgarage"> <bitfield name="canenter" group="canvbgarage" phrase="can_enter_vbgarage" install="">1</bitfield> </group> </group> </bitfielddefs> </bitfields> If the file is there and active I get this error when I try to save the permissions. The newly added permissions are not saved and they remain 'no'.. |
#27
|
||||
|
||||
Make sure you don't have any Plugins enabled and try again.
Edit: install="" might also cause this error |
#28
|
|||
|
|||
It's a fresh install without any plugins.. I also removed install="" with no success
I added another group and here's the sql error I get now: HTML Code:
### UPDATE QUERY GENERATED BY fetch_query_sql() ### `title` = 'Administrators', `description` = '', `usertitle` = 'Administrator', `opentag` = '', `closetag` = '', `passwordexpires` = '180', `passwordhistory` = '360', `canvbgarage` = '', `canvbgarage2` = '', `forumpermissions` = '1048575', `attachlimit` = '0', `pmquota` = '50', `pmpermissions` = '3', `pmsendmax` = '5', `calendarpermissions` = '63', `wolpermissions` = '31', `adminpermissions` = '3', `genericpermissions` = '205520831', `genericoptions` = '31', `profilepicmaxwidth` = '100', `profilepicmaxheight` = '100', `profilepicmaxsize` = '65535', `avatarmaxwidth` = '80', `avatarmaxheight` = '80', `avatarmaxsize` = '20000' WHERE usergroupid=6; I edited the usergroup #6 via phpmyadmin and changed canvbgarage to 1 and the usergroup manager still says no and my scripts are still not working |
#29
|
||||
|
||||
Did you rebuild the Bitfield Cache?
Btw: I'd use a XML like Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <bitfields product="garage"> <bitfielddefs> <group name="ugp"> <group name="vbgaragepermissions"> <bitfield name="canenter" group="vbgarage_permissions" phrase="can_enter_vbgarage" install="">1</bitfield> </group> </group> </bitfielddefs> </bitfields> |
#30
|
|||
|
|||
Verdammt, ich wusste doch das ich was vergessen hatte *vordenkopfschlag*
No I didn't Next question: If Iam using the XML like you suggested, what does this has to look like: PHP Code:
|
#31
|
||||
|
||||
Well, it's just variable Names so it's not really important, but IMHO it makes Code more readable
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|