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. |
#72
|
|||
|
|||
Hi,
I cannot get this work ;( I made the following bitfield: Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <bitfields product="vbulletin"> <bitfielddefs> <group name="ugp"> <group name="teampermissions"> <bitfield name="caneditteam" group="team_permissions" phrase="can_edit_team" install="">1</bitfield> <bitfield name="candeleteteams" group="team_permissions" phrase="can_delete_teams" install="">2</bitfield> </group> </group> </bitfielddefs> </bitfields> Tobi |
#73
|
|||
|
|||
Does noone have an idea what is wrong in my coding?!
|
#74
|
||||
|
||||
Did you rebuild the bitfield cache?
@MrBlunt Well, as said - just directly use the XMLReader and set your bits accordingly. Or fake the product being installed and call the bitfield builder. |
#75
|
|||
|
|||
Quote:
Regards, Tobi |
#76
|
||||
|
||||
If you already have a thread there or create on - sure
|
#77
|
|||
|
|||
hi,
Thanks for your explanation verry usefull.One question through.My permissions show up fine the only thing that annoys me a little is that that little help icon that refuses to shoowup nexto my permissions ? i bet it got something todo with the adminhelp manager you see in debug mode ? buh i hate XML most of the time i doesn't work for me HTML Code:
<?xml version="1.0" encoding="iso-8859-1"?> <bitfields product="myproduct"> <bitfielddefs> <group name="ugp"> <group name="myproductpermissions"> <bitfield name="canview" group="myproduct_permissions" phrase="can_view" install="2,5,6,7">1</bitfield> <bitfield name="canmanage" group="myproduct_permissions" phrase="can_manage" install="2,5,6,7">2</bitfield> </group> </group> </bitfielddefs> </bitfields> Code:
"ALTER TABLE " . TABLE_PREFIX . "usergroup ADD myproductpermissions INT(10) UNSIGNED NOT NULL DEFAULT 0"; |
#78
|
||||
|
||||
posted in wrong thread ...
|
#79
|
|||
|
|||
Just an FYI, for those interested in having custom forum permissions that correspond with custom usergroup permissions, you may want to check out my hack discussed in the following thread:
Custom Usergroup Forum Permissions |
#80
|
||||
|
||||
There is a reason why there is no built-in support for custom forum permissions
|
#81
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|