vBulletin WordPress integration


If you have a WordPress site and want to add a forum, vBulletin is the best way to do that. vBulletin is the best commercially available forum  software. It is well supported, very secure, and quite functional. However, if you want your forum to look like your WordPress theme as you should, you are in for quite a treat. It is not easy. There is not any good documentation on this process. This is why you need a good programmer to ensure everything works well.

I will explain how this is best achieved. I will not give a step by step process. If you don’t know what I’m talking about, you probably need to hire me to do it anyway!

The first thing you need to do is to make a duplicate of the wp-config, wp-load, and wp-settings files. Rename them vb_xxxxx. Change the lines within these files to call the new files you just created as opposed tot he original wp_xxx ones.

The next step is to call vb_load and the theme’s header file within vBulletin. This is achieved by creating a plugin and registering the appropriate variables.

ob_start();
include('../vb-load.php');
include('../wp-content/themes/rt_iridium_wp/header2.php');
$globalWPHeader= ob_get_contents();
ob_end_clean();

$preRegister['globalWPHeader'] = $globalWPHeader;
vB_Template::preRegister('header', $preRegister);

The header file from the WordPress template is also duplicated and modified to ensure that you are not loading 2 sets of DOCTYPE and other pre head actions.

Then you have add the call to the above function to the header template


{vb:raw $globalWPHeader}

The same process above is applicable to the footer file calling a duplicate for reasons outlined below.

At this point, you will have your forum loading inside of the WordPress template. Now, there will be certain CSS and PHP conflicts.

I overcome the CSS conflicts by encapsulating the vBulletin within a new <div> with a class of “vB_only”. This is defined in the duplicate header file and closed in the duplicate footer file. Then for any issues that conflict within the vB CSS, i add .vB_only to the line causing the conflict.

As for the function conflicts that is pretty much limited to the sanitize function. A simple search and replace will fix this. Find all instances of the function name, and rename each.

The final issue resides within the magic_quotes function. This will result in all of your posts within your vBulletin forum that have an apostrophe (‘) or quotation mark (“) will have escape characters added. This issue is simply resolved by commenting out the line in vb_settings.php that reads wp_magic_quotes();

I hope this helps someone save some time. It took me countless hours to get this working properly.

If you would like to see this process in action, check out www.FrontTowardsGamer.com