
- •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

Changing the Look of vBulletin
Making the New Style into the Default
OK, you've created a new style, and you want to make it available as the default. How do you do this? Easy! You may have noticed some checkboxes at the top left of the Style Manager window.
The style currently in use is checked. To change the style in use, just swap the check marks around, and click on the button marked Save Display Order.
The new style will now be available, and the old style won't be available. If you want to make both styles available, check both options and click on Save Display Order.
This will now make both styles available to the users of the board, and they can choose which one they want to use.
Distributing a Style
You've made a great style, and you think that others might like to use it. You can choose to make it available for free, or you could decide to sell it. (Remember though that selling a style usually means having to provide the buyer with installation support.)
164

Chapter 7
But how do you package it?
A style consists of the following elements:
•An XML file containing the changes
•All the custom images that go with it
To create a distribution package for a style, first take the custom XML file that you created and place it in a folder. (Call the folder the same name as the style.)
Then, download all the folders that contain custom images for the style from the web server. Make sure that you get the folders and the images. So, for our earlier example, we'd need to download the following folders:
•images/custom/buttons
•images/custom/statusicon
•images/custom/attach
•images/custom/misc
•images/custom/editor
•images/custom/polls
•images/custom/rating
•images/custom/reputation
Place these folders and their contents into the folder containing the XML file and you're done. You can package up the whole thing into a zip file for convenience if you want—it also helps to keep all the files together in one place.
Installing a New Style
Installing a new style is simple. Follow these simple steps:
•First, find the style that you want to use.
•If the style has been packaged, extract the contents of the zip file.
•Upload the folders containing images into the images folder on the web server. Do not upload the XML file.
•Next, click on Styles & Templates in the left-hand menu, and then click on
Download/Upload Styles.
•This takes you to the interface that you saw earlier when downloading the XML file. This time, we're interested in uploading it.
165

Changing the Look of vBulletin
•Click on the Browse… button, and go in search of the XML file.
•Make sure that (Create New Style) is selected in the Merge Into Style drop-down box.
•Scroll to the bottom of the page and click on Import.
•The import process will run and import the style into vBulletin.
And that's all there is to it!
Summary
In this chapter we've looked at how to style a vBulletin installation. If you're like most people, this is something you're likely to want to take your time over and work on to get right. It's a good idea not to rush things and to work methodically, checking often that the changes result in the look that you expect.
Also, remember to save regularly and make regular backups—don't rely on the web host to do this for you. If you've spent time making modifications and changes. then take the time to keep them safe!
Finally, you might also want to consider making your style available to others—this is both quick and simple with vBulletin.
Happy styling!
166

8
Developing a Hack
In this chapter we'll be looking at how you go about developing a hack for a vBulletin installation. Being based on the PHP language and on MySQL database infrastructure makes vBulletin very versatile, so we're going to have to limit our scope. Almost anything that you would want to do with vBulletin is possible if you know how to leverage PHP and MySQL!
In particular we will look at:
•How to hack a discussion board by changing one of the template files
•How to distribute a hack by giving other programmers clear instructions about the code changes
Hacking vBulletin
Let's take a look at how to create a vBulletin hack. The hack we're going to be developing here is one that allows you to control how vBulletin handles private message receipts. As we saw in Chapter 3, private messages, known as PMs, are messages that one member can send to another member of the board.

Developing a Hack
The member types a message into the private message window and then clicks on the
Submit Message button.
The recipient can collect the message the next time they log in (or, if they are already logged in, the next time they request a new page from the board).
But there's one feature that seems to annoy some members (especially if it's a popular board where the members make a lot of use of the PM facility). This is the read receipt feature. When a PM is submitted, a message box is displayed asking the sender whether they want to request a read receipt.
Read receipts are a useful feature, but the problem is the message box displayed—people find it gets in the way and often they won't want to send a read receipt with every message. You as the administrator can do something about this—you can hack your vBulletin installation to give your members greater control over how read receipts are handled.
You have the power …
… to disable private messaging read receipts altogether. In the left-hand menu in the AdminCP, click on Usergroups followed by Usergroup Manager. Then for each usergroup you don't want to have this feature, click on Edit Usergroup and set
Can Use Message Tracking and Can Deny Private Message Read Receipt Request to No. Doing this, however, will remove the ability for members to request a read receipt. It would be much better to simply change how the request works.
168