Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Coding in Vbulletin 3.x Tips
deathemperor
Join Date: Jul 2003
Posts: 1,270

HOL
by deathemperor deathemperor is offline 14 Feb 2005

Quick 1st Tip:

Inserting new Vbulletin Settings by running a php script.

sample code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


To run this function use:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

ABOVE THIS, ADD:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add above:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

OR



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



This is optional to add default permission for some usergroup:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

in usergroup permission find


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ADD BELOW


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The above example add a new permission: candoeverything in calendarpermissions

I hope I am not just trying to be complex.

Next: Forum permission.

Last edited by deathemperor; 23 Mar 2005 at 19:03..
Views: 2934
Reply With Quote
Comments
  #2  
Old 14 Feb 2005, 22:56
Guy G Guy G is offline
 
Join Date: Nov 2004
Nice... would be cool if you could extend it a little bit.
Reply With Quote
  #3  
Old 15 Feb 2005, 05:30
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Real name: Lucius Hunk
Thanks for the kind word, Usergroup permission tips added.
Reply With Quote
  #4  
Old 15 Feb 2005, 09:57
Guy G Guy G is offline
 
Join Date: Nov 2004
Originally Posted by deathemperor
Thanks for the kind word, Usergroup permission tips added.
Even better.... cool guide.
Reply With Quote
  #5  
Old 23 Mar 2005, 18:04
husain's Avatar
husain husain is offline
 
Join Date: Feb 2005
Just what I was looking for. Thank you!
Reply With Quote
  #6  
Old 23 Mar 2005, 18:40
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Real name: Fillip
Originally Posted by deathemperor
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Syntax error

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #7  
Old 23 Mar 2005, 19:04
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Real name: Lucius Hunk
fixed

thanks Revan
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:23.

Layout Options | Width: Wide Color: