This How-To is mainly meant for Hack-Developers, if you are only planning to use Hacks just read the End-User section.
Developers
vBulletin 3.5.0 RC1 introduces a new concept for customizing/modifying vBulletin: Products.
With Products, you can manage Plugins, Phrases, Settings and Templates in just one XML File.
Furthermore it supports Install/Uninstall Codes (for running queries, etc.), it also covers updating existing Hacks as you can add Codes for different Versions.
To start, you first have to turn on debug mode:
Put
PHP Code:
$config['Misc']['debug'] = true;
in config.php.
Then go to ACP / Plugin System / Manage Products.
Click Add/Import Product.
In the second Form (Add New Product) fill in the Details for your Hack:
Product ID should be a unique ID for you Hack; it must not start with vb and should be lowercase only, not contain spaces or other special characters. Attention: The Product ID must not be longer then 15 characters.
Title should be the Title for your Hack
Version should be the Version.
The Format shoud be Mainversion Subversion Subrelease
Example: Myhack 1.0.0 Beta 1
Description should be a short description for you Hack, eg. what it does.
Afterwards, create all the Plugins, Phrases, Templates and Settings your Hack requires and make sure you select the Product you just created. Important: Templates must be placed in the MASTER Style, Phrases in the MASTER Language
When you are finished, go to ACP / Plugin System / Manage Products and select Edit from the Dropdown next to your Product.
In the Form (Add New Install/Uninstall Code) add all Code necessary to install/uninstall your Hack (eg, Queries, etc.).
If you are updating an existing Hack, add new Install/Uninstall Codes for the new Version that just make the changes necessary to upgrade the previous Version; Product Management will make sure that all necessary Codes will be run.
If your Hack includes Usergroup Permissions/Bitfields, add the following Code to Install and Uninstall to rebuild the Bitfield cache:
PHP Code:
if (is_newer_version('3.5.1', $vbulletin->options['templateversion']))
{
// Rebuild Bitfields
// Do this for vBulletin < 3.5.1 *ONLY*; later versions rebuild
// automatically and calling the builder in install code causes
// the bitfields NOT to be rebuild correctly
require_once(DIR . '/includes/class_bitfield_builder.php');
vB_Bitfield_Builder::save($db);
build_forum_permissions();
}
When everything is done, go to ACP / Plugin System / Manage Products again and export the Product as XML; this will then include all Plugins, Templates, Phrases, Settings and Install/Uninstall Codes required.
End-Users
Go to ACP / Plugin System / Manage Products.
Click Add/Import Product, select the product XML File for the Hack you want to install.
If you are upgrading an existing Hack, make sure that Allow Overwrite is set to Yes
This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent.