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 |
#22
|
|||
|
|||
I'm trying to make a mod to display referrer statistics, so that a forum can have referrer contests etc. I've seen this requested many times in the modification requests and I would also like it for my forum.
I have lots of learning to do though in order to make it, but I'm determined |
#23
|
|||
|
|||
Quote:
EDIT: Yes, I thought so. They have it, but they do not release it anymore: http://www.talkloud.net/forums/vbsta...on=memberrefer |
#24
|
|||
|
|||
Thanks so much!!!
How can I ask you if I have a question? In this thread or via pm? :nervous: I wish I could code for hours today, I am really eager to do it but I have a trip so I have to start packing in about an hour, so I'll continue working at night when I arrive (it's 6:46 in the morning here) Anyway, when I really want to make something I can sit at the computer for hours till I make it, lol I made smilie maker in one night and for my (low) level of knowledge that's an achievement Quote:
Anyway mine will be better OMG I am totally insane! I postponed my trip 5 hours so I can work at the script! LOOOOOOOOOOL!!! |
#25
|
||||
|
||||
Quote:
Quote:
Quote:
Quote:
Update: Added "Authentication Storage" section, based on a random Kirby's post that I've found. |
#26
|
|||
|
|||
I hope someone here can help me I have a hack that stopped working after upgrading to 3.5.1. I have already made the change for "db" from "DB_site", but this page seems to still be having a problem:
http://www.familycorner.com/forums/contest.php3 You will see if you scroll down to where it says "Posts Today" in a purple box that the total number of posts are missing. This is what the post count is calling from: PHP Code:
THANK YOU! Sorry, I should have posted this as well. This code is at the top of the page, just under the body tag: PHP Code:
PHP Code:
|
#27
|
|||
|
|||
Some screenshot please?
|
#28
|
|||
|
|||
Not exactly related to the first post but some things I find very very useful when coding.
At the bottom of includes/functions.php I have the following: PHP Code:
All of the above were taken off user comments at php.net Usages: PHP Code:
Extremely useful for seeing what vB knows at any point, especially if you need to call some of that data. A tip: don't pre($vbulletin), it's really messy. PHP Code:
PHP Code:
PHP Code:
PHP Code:
These are all bound to your IP or localhost to save unnecessary outputting to the board. |
#29
|
|||
|
|||
Quote:
|
#30
|
|||
|
|||
Thank you for pointing that out. Corrected.
|
#31
|
||||
|
||||
Thanks for taking the time to put this together anthony, i have been using it as a reference quite frequently.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|