- •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
Administering Your Forum
Add the user IDs inside the single quotes. Separate multiple user IDs with a comma.
With great power, comes great responsibility
Be very careful with this. The ability to run queries is a very powerful tool that we will come to later. Running queries can easily damage or destroy your discussion board and any other data in the database. For the safety and security of your board, you may want to remove all user IDs from this list and allow queries to be run only through phpMyAdmin or through a shell.
Undeletable and Unalterable Users
You might want your administrators (or other members) to be undeletable and unalterable. (This refers to the profile settings.) This setting can be handy, because it prevents you from deleting or demoting administrators (including yourself!) by accident.
The line of code you will need to edit is this:
$undeletableusers = '';
Maintaining the Database
Without the data, your community is gone. Not only will you lose all the forums that have been set up (along with any customizations and changes you made), but you will also lose all the people. By this, I mean you will lose all the members—lose the database and their accounts. Usernames, passwords, everything will be lost.
Running a forum without taking care of the database is asking for trouble. Not only might you run into problems and difficulties when you make a change to the forum (such as adding new features or upgrading vBulletin), but also your data is vulnerable to damage if the server hosting your community encounters problems. Small database problems can quickly grow into major issues, and the best defense against problems is to keep a backup.
vBulletin has a lot of features to allow you to protect your precious data from damage, corruptions, and loss. These tools can be accessed through the Import & Maintenance menu on the left of the AdminCP.
126
Chapter 5
Backing Up the Database
vBulletin makes this job quite easy as long as your database isn't too big. How big is too big depends on a variety of factors, but if your database is under 250 Mb, you should be able to use this feature just fine.
Back to basics
For large databases, saving the database via the command line is recommended. This is done using the following command:
shell> mysqldump --tab=/path/to/some/dir --opt db_name
The backup interface is easy to use. It shows you all the tables that are available in the database that contains vBulletin (including non-vBulletin tables).
You should choose the tables you want to back up (it's probably best to choose all the tables initially) and then select at the bottom of the screen the location to save the backup to. This has to be a folder on the server that vBulletin can write to, so its chmod permission should be set to 777.
After you have done this, click on Save. The backup will then be carried out.
You can also back up single database tables into a CSV (comma separated variable) file, which is handy if you plan on making changes to the database.
127
Administering Your Forum
Restoration of this database is carried out through the phpMyAdmin interface.
Command-line recovery
Recovery of a database through the command line is a two-step process. First, create a database to receive the data.
$ mysql -h localhost -u XXXXXX -p YYYYYY
Here XXXXXX is the username of the database and YYYYYY is the password.
Then move the data to the new database:
$ mysql -h localhost -u XXXXXX -p YYYYYY restored < db_name
Repairing and Optimizing the Database
Again, this process gives you access to all the tables in the database, not just the tables relating to vBulletin. You can choose to repair and optimize some of the tables, or you can repair and optimize all the tables.
At the bottom of the page choose whether you want to optimize the tables, repair the tables, or carry out both operations.
When you have selected the required options, click on Continue.
128