Getting Plugins and Products for vBulletin

an article added by: Linda Gould at 05312007


In: Root » Internet and online » Forums » Getting Plugins and Products for vBulletin

French Spanish Portuguese Italian German Japanese Chinese Korean Russian Arabic

Plugins and Products
One of the new features available in vBulletin 3.5 is plugins and products. Plugins and products are a new and easy way to add new features to a vBulletin installation.

There are some differences between a plugin and a product. A plugin allows new features to be added to a core vBuletin installation. In other words, it is a code snippet imported into vBulletin and executed by specific hooks. This is an easy way to extend functionality without making changes to the underlying PHP files of vBulletin.
A product is a downloadable package that contains notonly plugins but also templates, options, phrases, help files, and control panel entries. This means that these are a bigger, more integrated types of plugins.
Hooks are what drives plugins. These are locations within the PHP code of vBulletin that trigger events. These events can be used to run code contained in plugins. You can view these hooks from the AdminCP by clicking on Plugin Systemfollowed by Add New Plugin, and then clicking on the Hook Location drop-down box.

Getting Plugins and Products


Plenty of plugins and products that are designed to carry out a multitude of tasks are available for download. In fact, many hacks and board modifications have been converted to plugins and products because of the ease of installation.
The best place to begin your search for plugins is http://www.vbulletin.org.

Adding a Plugin
Adding a plugin to a vBulletin installation is much easier. From the AdminCP, click on Plugin System followed by Add New Plugin .

In this screen you can cut and paste the code from the instructions you have, and choose the necessary hook to execute the plugin.
After making all the changes, click on Save, and the plugin will be added to vBulletin and be ready to use.
What If Things Go Wrong?
Whenever you add any new code to a vBulletin installation, there is a chance that things may go wrong. The worst-case scenario is that you bring down the whole vBulletin board and make it totally inaccessible.
Fortunately, there's a global way to disable plugins, and it doesn't require access to the vBulleting interface, only FTP access to the server.
All you need to do is find the includes/config.php file and add the following code:
Define('DISABLE_HOOKS', true);
Save the file and upload it to the server. Now vBulletin will run without plugins, and this gives you a chance to remove the offending product or plugin using Manage Products or Manage Plugins from the AdminCP.
Once you have removed the offending plugin, you can reactivate the plugin system by removing that line of code from includes/config.php.

Summary
In this article we've looked at another code modification, but this time instead of concentrating on the hack itself we paid attention to the process of making a hack to the code of a vBulletin board. You are likely to want to carry out a number of hacks to your board, and with each one you will increase your knowledge and understanding of how the board works. With time you will get an understanding of how the different templates and PHP files interact, and this is when you are most likely to start to think about creating your own hacks.
Take your time when creating your own hacks don't rush it. Take advantage of the vBulletin licensing policy, and work on a test-bed installation of the discussion board that way, if things go badly wrong, you don't bring your whole forum down!

Here are the default usergroup settings for these usergroups.

Default Usergroup Settings
vBulletin comes pre-configured with seven default usergroups and one custom usergroup.

Programmer's Reference
This article has information that you may need if you are going to delve deeper into your vBulletin installation, and make changes, tweaks, and other hacks.
In this article we will look at:

  1. • The settings for the default usergroups
  2. • The default database tables created by a vBulletin installation
  3. • How to migrate to a new server
  4. • How graphics work in vBulletin
  5. • How to find and replace text in posts
  6. • Some tips on how to program for vBulletin

Default Usergroup Settings
vBulletin comes pre-configured with seven default usergroups and one custom usergroup.

Moving Servers in Six Easy Steps
If your discussion board grows beyond the capabilities offered by your current host, then you can migrate the whole vBulletin installation from one server to another with the minimum of fuss and effort. In this section we will look at how to do this.
We can break down the server move into six easy steps.

  1. • Cookie check
  2. • Back up database
  3. • Download the vBulletin installation
  4. • Transfer to new server
  5. • Restore database
  6. • Back online!

Cookie Check
The first thing to do is check on the current cookie settings. Setting a specific cookie domain and cookie paths can cause problems for you when moving servers or even changing the URL of the discussion board. To prevent these problems, reset your cookie path to / and remove any cookie domain value that might be present before carrying out the server move.
A warning about cookies!
An incorrectly set cookie domain or path can prevent you from accessing your control panel!
Back up Database
The next step is to back up the database. Refer to Article 5 for full details on how to do this. Make sure that you use an up-to-date backup and that you've locked the forum prior to carrying out the backup so that there can be no changes made to the data.
Download the vBulletin Files
Using an FTP program, download your current vBulletin installation to your PC. You could reinstall vBulletin onto the new server, but you will lose any changes you made.
Transfer to New Server
The quickest and easiest way to transfer the database to a new server is using SSH or Telnet.

New Host Tips
Make sure that your new host allows you to have such shell access. (They might not allow it as standard, but check to see if they will allow it temporarily to allow you to carry out the move.)
Follow this simple transfer process.

  1. 1. Telnet into your existing server.
  2. 2. Type the following: ftp NEWSERVER Where NEWSERVER is the hostname or IP address of your new server. You will be prompted for a username and password to login.
  3. 3. Next, type: bin cd /PATH/TO/NEW/DIRECTORY put /PATH/TO/DATABASE/DUMP.SQL replacing /PATH/TO/NEW/DIRECTORY by the path to the directory where you want to place the database backup and /PATH/TO/DATABASE/DUMP.SQL by the path to the database dump. If you omit this step, the backup will be put into the root of the server.
  4. 4. This process will now transfer the database.
  5. 5. When completed, type: close quit
  6. 6. Verify that the database has been transferred.

Database Restoration

  1. 1. On the new server, create the database in which your vBulletin data will be installed.
  2. 2. Telnet/SSH into the new server.
  3. 3. Type: mysql -USERNAME -p NEWDATABASENAME < PATH/TO/DUMP.SQL

replacing USERNAME by the username to access the database, NEWDATABASENAME by the name of the new database, and /PATH/TO/DUMP.SQL by the path to the database backup file.
Back Online
Upload your vBulletin files (the ones you downloaded earlier) remembering first to edit the includes/config.php file. Edit $servername, $dbusername, $dbpassword, and $dbname with the values that correspond with the new server.

Finally, log into the forum. Everything should be working as normal.
If, during the server change, you changed the URL used to access the community, then you'll also need to change BB URL value. Log in to the administrator control panel, go to the vBulletin Options section, and change you BB URL to correspond to the new URL.
Graphics
The graphics that you see in a standard vBulletin installation are not standard graphics. They started life as 3D objects and scenes created in an application called Lightwave 3D. The resulting rendered images were then post-processed using Adobe Photoshop.
3D graphics work differently from normal graphics the edges of the images do not end in a sharply defined pixel border. Instead they are matted to a specific background color. If you use the default background colors in vBulletin, then everything will be fine. However, if you change the background colors of the page, then you may need to do some work on the graphics. To make this easy the vBulletin developers have made available two versions of the Graphics Developer Kit. (You can download them from the vBulletin Members' Area.) The first kit contains fully prepared images, and all you need to do is choose the matte color and save the images. The second kit contains much larger layered images that allow you to make numerous changes to the look of the graphics before saving them.


Lightwave 3D and Adobe Photoshop
For more details on Lightwave 3D visit http://www.newtek.com/lightwave, and for more details on Adobe Photoshop visit http://www.adobe.com/products/photoshop.
Be aware, neither of these applications is cheap!


Global Post Text Find and Replace
This is something that many board administrators want to do but aren't sure how messing with the database directly seems dangerous to many. It is quite simple though, and you can do it all through the AdminCP.
Log into the AdminCP, and in the left-hand menu click on Import & Maintenance followed by Execute SQL Query. If you are greeted with a message that says: You are not authorized to execute SQL queries you will need to add your user ID number to the line: $canrunqueries = ''; in the includes/config.php file. For example, if your user ID is 1, this line will become: $canrunqueries = '1';

Now you can run queries. To carry out a find and replace on all the post data in your board, you will need to run an SQL query like this: UPDATE post SET pagetext = REPLACE (pagetext,'Vbulletin','vBulletin') WHERE pagetext LIKE '% Vbulletin%';

This SQL query looks through the posts for instances of Vbulletin and replaces them with vBulletin. The WHERE clause is used to optimize the find and replace as this allows MySQL to take advantages of indexes, which speeds things up.
If you get an error running this query then check to see if you are using a table prefix in the database for the tables (such as vb_) and add this to the query. This would change the query to the following: UPDATE vb_post SET pagetext = REPLACE (pagetext,'Vbulletin','vBulletin') WHERE pagetext LIKE '% Vbulletin%';
If you wanted to carry out a similar find and replace within PMs, you'd use the following query: UPDATE pmtext SET message = REPLACE (message,'Vbulletin','vBulletin') WHERE message LIKE '%Vbulletin%';
By using MySQL queries you are taking total control over the data held in the database. We don't have the time or scope here to cover MySQL queries in detail, so for more information visit http://dev.mysql.com. Alternatively, you can read Mastering phpMyAdmin for Effective MySQL Management by Marc Delisle, published by Packt Publishing (ISBN 1-904811-03-5).
Programming Standards
Good programming is clear, unambiguous programming. Let's run through a few tips to help make your code more readable, easier to debug, and easier to make changes to later on.
Braces
For clarity each brace should be placed on its own line in the code:
if ($condition)
{
// code goes here
}
Don't be tempted to condense code like this:
if ($condition)
{ // code goes here }
Indenting
Indent code between braces:
if ($condition)
{
// code goes here

}
Code between braces within braces should have deeper indenting:
if ($condition)
{
if ($condition2)
{
// code goes here
}
// some more code goes here
}

Give Operators Space
All operators (except -- and ++) should have a space either side.
$a = $b + $c;
String Quoting
All strings should be quoted with single quotes when they don't contain variables or control characters. Otherwise always use double quotes:
$a = 'Hello, World!';
$b = "Hello,\nWorld!";
$c = "$hello,\nWorld!";
Return Values
Use only lower-case true and false for return values. Upper-case should be reserved for custom constants.
if ($condition)
{
return true;
}
else
{
return false;
}
AND and OR
Always use AND rather than and or &&, and OR rather than or or || in your code.
if ($num1 AND $num2 OR $num3)
AS
Similarly, AS in foreach statements should be capitalized.
foreach ($array AS $num => $var)
{
// code goes here
}
SQL Queries
Under all circumstances, make sure that you double quote all SQL queries.
$DB_site->query("SELECT field FROM " . TABLE_PREFIX . "table ORDER BY field");
It may be better to write long queries on more than one line.

Summary
This article has been a rundown of information that will be of use to those who plan to do more with their vBulletin installation than just install it and leave it be. While really only scratching the surface of vBulletin, we're presented the information people request most often.

legal disclaimer

Our website is not responsible for the information contained by this article. Web-articles is a free articles resource.
Suggestion: If you need fresh, daily updated content for your website, feel free to use our service. Click here for more information.

related articles

1. vBulletin Licensing Options
vBulletin Licensing Options vBulletin is a commercial product, and you must therefore buy a license before you can use it. To offer site owners the greatest possible flexibility there are two licensing options to choose from: • Leased license • Owned license Leased License Purchasing a leased license will allow you to run vBulletin on your server for one year. During this period you will be entitled to technical support and softwa...

2. The requirements of vBulletin
In the next article we're going to be shifting our focus to the installation and configuration of vBulletin. In this article we begin at the point where most people begin with vBulletin with a copy of the software and somewhere to upload it to. If you have both of those, then you are probably eager to get going with the installation! We will look at: • The requirements of vBulletin • How to install the files • How to create the database • How ...

3. The vBulletin Control Panel
The vBulletin Control Panel Now that you have come this far, you are probably eager to access the Control Panel and get started. Click on the link on the Step 13 page to access the Control Panel. (You will need to have deleted the install/install.php file before being able to continue.) After clicking on the link you will then need to enter the username and password you assigned to the administrator during the installation of vBulletin. Once you log into the Control P...

4. Importing Data into vBulletin
If you are moving to vBulletin from another type of discussion board, then there is a good chance that you won't want to lose all the posts that you already have and start again with nothing. And it's not just the posts that are important what about all your member information usernames, passwords, profile data? You don't want to lose all that and start with aIn the right-hand pane you get information about the version notice how we are being told that there is a newer version of vBulletin available. That's a really handy feature, and...

5. The vBulletin User Experience
A Tour of vBulletin In the previous article we looked at the vBulletin installation process. This process involved downloading the installation files, making edits to the configuration files, creating or preparing a database for vBulletin, uploading the installation files, and finally going through the vBulletin installation wizard. We also looked at how to import posts and settings from another discussion board into vBulletin. Now that you have a working vBulletin board, the next thing that you need to do is famili...

6. Customizing Your vBulletin Board
  Customizing Your vBulletin Board Most of the best discussion boards on the Web have been customized in one way or another. Some have only basic customizations to give the place a specific look and feel, while others have been heavily modified and customized to look, feel, and work exactly how the owners want them to. At this stage you probably want something in the middle you want a certain level of customization but don't want to take on too much too soon, right? That's fine the g...

7. vBulletin templates
Template Modifications So far we've looked at how to modify CSS stylesheet information, which controls how vBulletin looks, and the phrases, which control the text. Both of these modifications allow you to radically change how your vBulletin board looks and feels. Template modifications allow you to do a lot more and to make much more radical changes to your vBulletin installation. In fact, templates control nearly every aspect of a vBulletin board. Each page that the end user sees is the result of one or mo...

8. Hacking a vBulletin Board
Hacks So far we've talked about making modifications to a vBulletin installation, and we've looked at four different ways to modify the installation. So far we've called the changes 'modifications', but the term that you are more likely to see used on the web is 'hacks'. Whenever a board is modified, it is said to be hacked (not to be confused with 'hacked' as in the security being compromised by a hacker), and modifications are known as hacks as in "hacks to a board"...

9. Administering Your Forum
Administering Your Forum There's a lot to do as a forum administrator. It's not just about participating in the discussions, facilitating new discussion, and making the tough decisions as to who should be moderated or banned. There's a lot to do behind the scenes the day-to-day care of the forum as well as routine maintenance. You will also run into problems from time to time, and then you will need to carry out emergency repairs to get your forum going again. This article is about the most common tasks an adminis...