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. |
#12
|
|||
|
|||
Why cant this be added to bitfield_vbulletin.xml? I have tried, but it doesnt work.
|
#13
|
||||
|
||||
It can ... but you shouldn't do that, as bitfield_vbulletin.xml will be overwritten during an upgrade, which means you would have to redo the changes.
If you use your own XML file it will still be there and used after an upgrade. |
#14
|
|||
|
|||
how does one go about putting a title on the grey table header? I tried phrase="_phrase_var_" and text="phrase text" but neither worked.
|
#15
|
||||
|
||||
Quoting myself to answer your question:
Quote:
|
#16
|
|||
|
|||
yea, i read that but figured I also needed another param because it wasnt (and isnt) working
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <bitfields product="vBulletin"> <bitfielddefs> <group name="ugp"> <group name="download_permissions"> <bitfield name="canviewfiles" group="download_permissions" phrase="downloads_can_view_files" install="">1</bitfield> <bitfield name="candownloadfiles" group="download_permissions" phrase="downloads_can_download_files" install="">2</bitfield> <bitfield name="canratefiles" group="download_permissions" phrase="downloads_can_rate_files" install="">4</bitfield> <bitfield name="canlinktofiles" group="download_permissions" phrase="downloads_can_linkto_files" install="">8</bitfield> <bitfield name="canuploadfiles" group="download_permissions" phrase="downloads_can_upload_files" install="">16</bitfield> <bitfield name="canavoidpurgatory" group="download_permissions" phrase="downloads_can_avoid_purgatory" install="">32</bitfield> <bitfield name="canmanagepurgatory" group="download_permissions" phrase="downloads_can_manage_purgatory" install="">64</bitfield> <bitfield name="caneditownfiles" group="download_permissions" phrase="downloads_can_edit_own" install="">128</bitfield> <bitfield name="caneditallfiles" group="download_permissions" phrase="downloads_can_edit_all" install="">256</bitfield> <bitfield name="canviewdisabled" group="download_permissions" phrase="downloads_can_view_disabled" install="">512</bitfield> </group> </group> </bitfielddefs> </bitfields> I'll try looking over everything to see if there are errors, but I dont see how I could have messed up. |
#17
|
|||
|
|||
Have you tried phrase="download_permissions" instead of name=?
|
#18
|
||||
|
||||
Kirby - Any way to make this work with Forum Options?
Rather than editing forum.php Satan |
#19
|
||||
|
||||
there're optional ways to use the permission:
along with $permissions['myhackpermissions'] & $vbulletin->bf_ugp['myhackpermissions']['canfoo'] you can use $permissions['myhackpermissions'] & $vbulletin->bf_ugp_myhackpermissions['canfoo'] or $permissions['myhackpermissions'] & 1 the last one is the shortest one but then you won't understand what it does, 1 is the value of <bitfield> tag, just similar as the old permission settings. I found that the 'canfoo' is case sensitive, this took me almost a day to figure out lol |
#20
|
|||
|
|||
I still don't understand how I could add forumpermissions?
I've tried to play with it, I've added an xml file with the content of kirbyDE, but it didn't work. |
#21
|
||||
|
||||
Take a look at my recent Get New Posts Hack and you'll see
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|