- •Table of Contents
- •Preface
- •What This Book Covers
- •Conventions
- •Reader Feedback
- •Customer Support
- •Downloading the Example Code for the Book
- •Errata
- •Questions
- •What is vBulletin?
- •Why Have a Discussion Board?
- •Benefits of a Discussion Board
- •Why vBulletin?
- •History
- •Development
- •The vBulletin Advantage
- •Versatile
- •Performance
- •Customizable
- •Easy to Maintain
- •Other Features
- •vBulletin Licensing Options
- •Leased License
- •Owned License
- •Choosing a License
- •Example vBulletin Sites
- •Summary
- •Requirements
- •Disk Space
- •Bandwidth
- •System Resources
- •Shared Hosting
- •Semi-Dedicated Hosting
- •Dedicated Hosting
- •Other Options
- •Installing vBulletin
- •Tools
- •Downloading the Installation Files
- •File Extraction
- •Upload Preparation
- •Creating the Database
- •Command-Line Database Creation
- •cPanel Database Creation
- •File Editing
- •Uploading the vBulletin Files
- •Running the vBulletin Installation Script
- •Troubleshooting
- •Database Access Issues
- •Images/Styling Not Showing
- •PHP Errors
- •The vBulletin Control Panel
- •Importing Data into vBulletin
- •Downloading the ImpEx Script
- •Compatibility
- •Preparing for Upload
- •Editing the Configuration File
- •Upload the ImpEx Script
- •Running the ImpEx Script
- •Default Usergroups
- •Securing vBulletin
- •Help & Support
- •Summary
- •The vBulletin User Experience
- •How to Get to the Board?
- •What the End Users See
- •Site Logo
- •Forum Title, Login Box, and Navbar
- •Welcome Banner
- •Main Body of the Forum
- •What's Going On
- •Footer
- •Touring the Main Forum—Unregistered Users
- •No "New Threads" for Unregistered Users
- •Registering on a vBulletin Board
- •Touring the Forum—Members
- •New Threads
- •Replying
- •Editing a Message
- •Private Messages
- •BB Code
- •User Tools
- •Display Modes
- •Navbar Changes for Members
- •The vBulletin Administrator Experience
- •Forum and Thread Tools
- •The AdminCP
- •Control Panel Home
- •Latest Version Information
- •vBulletin Options
- •Forum Management
- •Editing and Adding Forums
- •Editing Existing Forums
- •Moderation Options
- •Forum Styling
- •Access Control Options
- •Forum Posting Options
- •Enable/Disable Features
- •Branding
- •Changing the Logo
- •Undoing the Change
- •Summary
- •Types of Customization
- •CSS Modifications
- •Changing the Table Title Text
- •Viewing Changes
- •Undoing the Changes
- •Phrase Modifications
- •Searching for Phrases
- •Making Changes
- •Viewing the Changes
- •Undoing Changes
- •Template Modifications
- •Accessing Templates
- •Exploring a Template
- •Template Structure
- •Adding a FORUMHOME Sidebar
- •Two Changes
- •PHP Code Modifications
- •PayPal Modification
- •File Modification
- •Hacks
- •Pros and Cons of Hacking a vBulletin Board
- •Finding a Hack
- •Installing a Hack
- •Backing Up a Hack
- •Commercial Hacks
- •Summary
- •Setting Up a Forum
- •Creating the Forum
- •Forum Permissions
- •Viewing Permissions
- •Opening the Forum
- •Super Administrators
- •Creating a Super Administrator
- •Other Changes to the config.php File
- •Admin Log Viewing Permission
- •Admin Log Pruning Permission
- •Query Running Permission
- •Undeletable and Unalterable Users
- •Maintaining the Database
- •Backing Up the Database
- •Repairing and Optimizing the Database
- •Some Maintenance Issues
- •Smilies
- •Editing a Smilie
- •Adding a New Smilie
- •Uploading a Smilie
- •Creating Your Own Smilies
- •Avatars
- •Adding Avatars
- •Storing Avatars
- •Summary
- •When to Upgrade
- •Preparing for Upgrade
- •Migrating Changes
- •File Compare Utilities
- •Uploading the Files
- •Running the Upgrade Script
- •Testing the Upgrade
- •Unveiling the Upgrade
- •Summary
- •Styling vBulletin
- •Template Lifecycles
- •Lifecycle 1—Constant Change
- •Lifecycle 2—Working Behind the Scenes
- •Editing the Default Style
- •Changing Image Paths
- •Other Editable Elements
- •Some Tips about Editing Styles
- •Adding a New Style
- •Editing the Style
- •Saving the Style
- •Downloading the Style
- •Making the New Style into the Default
- •Distributing a Style
- •Installing a New Style
- •Summary
- •Hacking vBulletin
- •Making the Changes
- •Locating the Template
- •Hacking the pm_newpm Template
- •Testing the Hack
- •Hack Distribution
- •Tips for Hack Distribution
- •Plugins and Products
- •Getting Plugins and Products
- •Adding a Product
- •Adding a Plugin
- •What If Things Go Wrong?
- •Summary
- •Default Usergroup Settings
- •(COPPA) Users Awaiting Moderation
- •Administrators
- •Moderators
- •Registered Users
- •Super Moderators
- •Unregistered / Not Logged In
- •Users Awaiting Email Confirmation
- •Banned Users
- •Default vBulletin Database Tables
- •Moving Servers in Six Easy Steps
- •Cookie Check
- •Back up Database
- •Download the vBulletin Files
- •Transfer to New Server
- •Database Restoration
- •Back Online
- •Graphics
- •Global Post Text Find and Replace
- •Programming Standards
- •Braces
- •Indenting
- •Give Operators Space
- •String Quoting
- •Return Values
- •SQL Queries
- •Naming Conventions for Functions
- •Summary
- •vBulletin Directory Structure
- •Notes
- •Official vBulletin Sites
- •Main vBulletin Hack Site
- •vBulletin Styles and Templates
- •vBulletin Add-Ons
- •Index
Developing a Hack
Hack Distribution
So now you have a hack and you want to make it available to other people. The question is, how do you do this? The license agreement prevents you from distributing whole templates, and anyway, you're only making small changes to the template so it's silly to get people to replace code that is unchanged.
The best way to distribute hacks is in the form of clear instructions that others can easily follow. There are many ways to do this but the following is an example of one way that is clear and straightforward.
MODIFICATION – PM READ RECEIPT CHECKBOX Version 1.0.2
-----------------------------------------------------
Open TEMPLATE pm_newpm
Find and DELETE/COMMENT OUT:
else if (formname.dopreview != true)
{
<if condition="$show['trackpm']">
if (confirm("$vbphrase[request_receipt_for_message]"))
{
formname.receipt.value = 1;
}
</if>
}
Find and DELETE/COMMENT OUT:
<input type="hidden" name="receipt" value="0" />
Find:
<div>
<label for="cb_parseurl">
<input type="checkbox" name="parseurl" value="1" id="cb_parseurl" tabindex="1" $checked[parseurl] />
$vbphrase[automatically_parse_links_in_text] </label>
</div>
Below code ADD:
<div>
<label for="cb_receipt">
<input type="checkbox" name="receipt" id="cb_receipt" value="1" /> Request Read Receipt?
</label>
</div>
SAVE pm_newpm and CLOSE.
Test modification.
END OF MODIFICATION
-------------------
With this hack we needed only to modify templates, but there are times when you need to document edits to settings or even to actual PHP files. Settings changes can be documented by specifying the menu navigation and the final setting change.
172
Chapter 8
Admin CP |
-> Usergroups -> Usergroup Manager -> Edit |
Usergroup |
|
Set |
"Can |
Use Message Tracking" |
|
and |
"Can |
Deny Private Message Read Receipt Request" |
to "No". |
The PHP file modification that we saw in Chapter 4 can also be documented in this way:
PAYPAL MODIFICATION Version 1.0.2
---------------------------------
Open includes\functions_subscriptions.php
Find:
<input type=\"hidden\" name=\"no_shipping\" value=\"1\" />
Replace with:
<input type=\"hidden\" name=\"no_shipping\" value=\"0\" />
SAVE and UPLOAD
Test modification.
END OF MODIFICATION
-------------------
Tips for Hack Distribution
Here are a few tips that make code distribution easier for both you and the person following the instructions:
1.Test hacks thoroughly. If possible, try them out on a test installation of vBulletin before making changes to your active board.
2.Be specific as to which file or template requires modification.
3.Replace whole lines of code—don't mess about trying to explain which bit of the line needs changing.
4.Feel free to add comments to the code you include. This will make life easier for the person using the instructions—but will also bulk out your code.
5.Be clear as to what code you want the user to find and what they should then do with it (e.g. replace it with different code or add something above or below it). Be careful to check that the code you want the user to search for isn't duplicated elsewhere in the file. If this is the case, then be more specific and display more than one line of code.
6.Don't use line numbers—these can change with updates to the software. Also, any code changes (or other hacks) above the line will cause the line numbers to be wrong.
7.Make sure that you give the proper name for the template or PHP file you want editing. In the case of PHP files, include the path within the vBulletin installation.
8.Keep version numbers updated. If you make a small change to the code (to fix a typo say or make a small modification), then change the minor version number (say from 1.0.2 to 1.0.3). For big changes or alterations that allow the code to work for a new version of vBulletin, change the major version number (say from 1.0.4 to 2.0.0).
173