- •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
Upgrading vBulletin
This has two advantages:
•It spreads the word about updates quickly and easily.
•It encourages people to upgrade licenses!
Clicking on the link takes you to the members' download area. (You will need your customer number and password to access this area.) From there, you'll be able to download the latest vBulletin installation package (in the form of a compressed Zip file about 1.5Mb in size).
Preparing for Upgrade
Before you upgrade anything, you need to backup your database with the data for the forum. We saw how to do this in Chapter 5.
As well as a database backup, make an up-to-date copy of the files on the server—preferably a full server backup of all files and folders, just in case something goes wrong or you upload the files to the wrong location and overwrite non-vBulletin files.
Backup motto
It's better to have made a backup and not need it than not to have made one and find that you do!
The next stage is to extract the files from the compressed archive that you downloaded. Extract them to a separate folder on your system.
Once you have done this, locate the folder called upload, and rename it to match the name of the existing vBulletin folder on your server (in our case vb).
Migrating Changes
Before you upload the files to the server, stop and think for a moment. Have you carried out any changes to the core PHP files of vBulletin? (We saw how to customize a bulletin board in Chapter 4.) If you have made any changes, uploading the new files will obliterate these changes. Most
140
Chapter 6
people want to keep any changes they made to their vBulletin installation, and this often keeps them from carrying out upgrades.
If there is only one change, then it may be easier just to make the same change again after the upgrade. However, if there are many changes, repeating them will be much more complicated and will need a lot more time and effort, and of course, there will always be scope to get things wrong. What you want is a file compare utility that highlights the differences between two files.
In Chapter 4, we saw how to modify the PHP code so that PayPal treats a subscription as a goods transaction. We will use this example to show how a file compare utility can be used to easily migrate changes to a new version of your bulletin board.
File Compare Utilities
There are a variety of such file compare utilities available. Two of the best are UltraCompare by the makers of UltraEdit (http://www.ultracompare.com) and DiffDog by Altova (http://www.altova.com). These are both commercial applications, and they do an excellent job of comparing files and highlighting the differences.
Another option is taking the free route—an application called WinMerge is available for free from
http://winmerge.sourceforge.net.
We can now run WinMerge on both versions of the file that was hacked (includes/ functions_subscriptions.php). This will highlight the differences between the two files. Some differences are to be expected while others are hacks.
141
Upgrading vBulletin
In WinMerge open the two files (the new version and the old version that we hacked).
When you open the two files, the lines that contain differences are highlighted. Also, on the left-hand side, there is a location pane that shows a schematic of the documents and places lines in them to show where there are differences.
When a new version of vBulletin is released, not all the files will have been changed. In fact, only a few of the files will contain actual code changes. However, there will be changes in the headers and footers of all the files. In the header, the version number will have been changed, in this case from version 3.5.2 to 3.5.4. In the footer, the changes will be to the date that the package was downloaded and, if the file has been updated, to the version number.
142
Chapter 6
The only other change to the code represents that hack that we installed earlier. Migrating this hack is simply a case of using the buttons on the menu to copy the change from the left-hand window (the original file) to the right-hand window (containing the new file).
To make this hack easier to spot in the future, you can add a comment to the code, explaining what the hack does.
143