Coding in Vbulletin 3.x Tips
Quick 1st Tip:
Inserting new Vbulletin Settings by running a php script. sample code: PHP Code:
To run this function use: PHP Code:
Setting Descritption: The discription of the setting. varname: varname is cancloseboard => $vboptions['cancloseboard']. value: the default value. defaultvalue: MySQL default value. displayorder: the displayorder of the setting. grouptitle: if you want to have a brand new setting, then use a different value with vbulletin default grouptitle, it will be a child setting if you use a existed value. This is the most simple way to add a new setting AFAIK. just a 1st quick tips, there will be more, soon. 2nd Tip: Adding Usergroup Permission. This is simple, you need to edit 2 file: init.php and admincp/usergroup.php in init.php find: PHP Code:
PHP Code:
in admincp/Usergroup.php find: PHP Code:
PHP Code:
to check for permission in php vb files, use: PHP Code:
PHP Code:
Some notes: If you use a totally new usergroup permission like the example above you will then need to run some queries: this must be run: [sql]ALTER TABLE `usergroup` ADD COLUMN `permissionname` int(10) unsigned NOT NULL DEFAULT 0[/sql] This is optional to add default permission for some usergroup: [sql]UPDATE usergroup SET jukeboxpermissions=63 WHERE usergroupid IN (5,6,7)[/sql] this query set the admin, mod, smod usergroup to have full permission, the number 63 = 1 + 2 + 4 + 6 + 8 + 16 + 32, so if you want a usergroup to have full permission, just total all the number in that permission, and to disable any permission you extract that number. Admin will have candothis and candothat set to no if they're 60. For a exist permission you need to run no queries Simple place a new value with the correct number below the vb based permission. Example: PHP Code:
PHP Code:
ADD BELOW PHP Code:
I hope I am not just trying to be complex. Next: Forum permission. |
Nice... would be cool if you could extend it a little bit.
|
Thanks for the kind word, Usergroup permission tips added.
|
Quote:
|
Just what I was looking for. Thank you!
|
Quote:
PHP Code:
|
fixed
thanks Revan |
All times are GMT. The time now is 06:51 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|