deathemperor
14 Feb 2005, 10:20
Quick 1st Tip:
Inserting new Vbulletin Settings by running a php script.
sample code:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
To run this function use:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Setting title: The tile of the setting.
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
ABOVE THIS, ADD:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This is for a absolute new permission, if you need a new permission for "permissionname" just add a new value like 'onemore' => 64, you can notice that the number get double.
in admincp/Usergroup.php find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Add above:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
of course this can be change for the place of the permission if you know what to do.
to check for permission in php vb files, use:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
OR
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Either of the way will check the usergroup permission that if you candothis or not, if not show the no permission page. Same for other, with candownloadthat you can use either candownloadthat or 32.
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This is optional to add default permission for some usergroup:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
in usergroup permission find
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
ADD BELOW
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The above example add a new permission: candoeverything in calendarpermissions
I hope I am not just trying to be complex.
Next: Forum permission.
Inserting new Vbulletin Settings by running a php script.
sample code:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
To run this function use:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Setting title: The tile of the setting.
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
ABOVE THIS, ADD:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This is for a absolute new permission, if you need a new permission for "permissionname" just add a new value like 'onemore' => 64, you can notice that the number get double.
in admincp/Usergroup.php find:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Add above:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
of course this can be change for the place of the permission if you know what to do.
to check for permission in php vb files, use:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
OR
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Either of the way will check the usergroup permission that if you candothis or not, if not show the no permission page. Same for other, with candownloadthat you can use either candownloadthat or 32.
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This is optional to add default permission for some usergroup:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
in usergroup permission find
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
ADD BELOW
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The above example add a new permission: candoeverything in calendarpermissions
I hope I am not just trying to be complex.
Next: Forum permission.