The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[How-To] vBulletin API Basics: Variables, Functions, Objects
vBulletin API Basics: Variables, Functions, Objects This How-To should serve as a reference to coders, who have a basic knowledge of PHP and who want to make their own mods. $vbulletin (Type: Object) Contains vBulletin data that has been in separate variables in vB 3.0.x. Below you can find a translation table of changed variables and functions. This is an expanded version of the list that you can find in vBulletin's source code (functions_legacy.php). vBulletin 3.0.3 locations are on the left hand side, and the corresponding vBulletin 3.5.0 locations are on the right hand side. Legacy locations can be enabled by running legacy_enable(), although this is officially not recommended for long term compatibility. Code:
* $vboptions['x'] --> $vbulletin->options['x'] * $iforumcache --> $vbulletin->iforumcache * $forumcache --> $vbulletin->forumcache * $usergroupcache --> $vbulletin->usergroupcache * $datastore['wol_spiders'] --> $vbulletin->wol_spiders * $smiliecache --> $vbulletin->smiliecache * $stylechoosercache --> $vbulletin->stylecache * $datastore['x'] --> $vbulletin->x * $bbuserinfo['x'] --> $vbulletin->userinfo['x'] * $session['x'] --> $vbulletin->session->vars['x'] * * $_BITFIELD['usergroup'] --> $vbulletin->bf_ugp * $_BITFIELD['usergroup']['x'] --> $vbulletin->bf_ugp_x * $_BITFIELD['usergroup']['x']['y'] --> $vbulletin->bf_ugp_x['y'] * $_BITFIELD['calmoderatorpermissions']['x'] --> $vbulletin->bf_misc_calmoderatorpermissions['x'] * $_BITFIELD['moderatorpermissions']['x'] --> $vbulletin->bf_misc_moderatorpermissions['x'] * $_BITFIELD['languageoptions']['x'] --> $vbulletin->bf_misc_languageoptions['x'] * $_USEROPTIONS['x'] --> $vbulletin->bf_misc_useroptions['x'] * $_FORUMOPTIONS['x'] --> $vbulletin->bf_misc_forumoptions['x'] * $_INTPERMS --> $vbulletin->bf_misc_intperms * $_INTPERMS['x'] --> $vbulletin->bf_misc_intperms['x'] * * ------------------------------------------------------------------------------ * Variables and Functions below are NOT affected/re-enabled by legacy_enable() * ------------------------------------------------------------------------------ * * $_GET/$_POST/$_REQUEST/$_COOKIE/$_FILES --> $vbulletin->GPC['x'] * $DB_Site->x() --> $vbulletin->db->x() * $url --> $vbulletin->url * $nozip --> $vbulletin->nozip * $script --> $vbulletin->script * $scriptpath --> $vbulletin->scriptpath * * HTML_SELECTED --> not defined anymore in vB 3.5 * HTML_CHECKED --> not defined anymore in vB 3.5 * * bbcode_parse() --> $bbcode_parser->parse * iif($condition, $r_true, $r_false) --> obsolete, use ($condition ? $r_true : $r_false) instead;
$db (Type: Object) As you might have judged from the Table 1 in this tutorial, the database object in vB3.5 is $vbulletin->db. However, $db is another way to access that object; it is the way that used everywhere unless you call it from within a function. In functions, use $vbulletin->db. Obviously, the purpose of the database method is to perform various operations on the database. Most common methods are described below.
Data Managers Data Managers (DMs) are an interface to various data objects used within vBulletin. They enforce necessary constraints and administrator-set options on the data to ensure that the data is valid. You can read more about Data Managers in vBulletin's online manual. Also, you can read specifically about the User DM in this KirbyDE's How-To, and about Thread DM here. Authentication Storage The authentication data is stored in the following way (thank to Kirby for this info): $_COOKIE: {cookiepfx}userid - plain(userid) {cookiepfx}password - md5(md5(md5('PlaintextPassword') . salt) . 'LicenseNo'). TABLE user: password - md5(md5('PlaintextPassword') . salt) Note that for cookie, {cookiepfx} is your board's cookie prefix. It is configurable via admincp and is accessible via the COOKIE_PREFIX constant. Important Functions
>> EOD |
#12
|
|||
|
|||
Quote:
|
#13
|
|||
|
|||
Quote:
Pass it on as a link to this thread. |
#14
|
|||
|
|||
Quote:
If I was gonna have a vbulletin 3.5 change tutorial on my site I would definatly make my own. |
#15
|
|||
|
|||
Quote:
|
#16
|
|||
|
|||
Quote:
Anyway thanks for the great tutorial |
#17
|
|||
|
|||
Quote:
Quote:
|
#18
|
|||
|
|||
I need to make a query (from the table user) that returns an array and the key of the array would be the userid and the value would be the value of another field in the database (eg referrerid).
For example if the array is $array and the users with userid 100, 200, 300 have a referrerid of 1,1 and 50 respectively that array should have the values $array[100]=1 $array[200]=1 $array[300]=50 Is that hard? How can I do it without adding many queries? Thanks a lot in advance edit: [offtopic] OMG I just saw you are 16!!! Wow! I'd never had expected that! I thought you were about 25+! OMG, most 16 year olds in Greece do not know how an opening tag of php is and generally they only care about playing games... Of course there are exeptions, like my bf which is in that age but still there is a huge difference... OMG, I still can't believe it! [/offtopic] Nevermind, I figured out another way to get the results I wanted |
#19
|
|||
|
|||
That could be done with just one query.
PHP Code:
Quote:
EDIT: Quote:
|
#20
|
|||
|
|||
Something similar but WAY more messy than yours
However the 100,200,300 where just examples, in an actual forum it should go through all the userids Well, that's not very hard to change, I'll just put instead of your WHERE a WHERE referrerid>0 (cause I want it to only return the users with a referrer) Thanks so much!! That's much more organized than my code. I'm still trying to figure out how those SQL things work, it's quite hard :nervous: edit: And it works too! Woo hoo!! Thanks, thanks, thanks!!! |
#21
|
|||
|
|||
np, and what are you trying to make, if it's not a secret?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|