brettbrewer.com

Programming + Design

Home
vBulletin/Wordpress Integration Plugin PDF Print E-mail
Written by Brett Brewer   
Wednesday, 01 August 2007

I've seen several methods of integrating WordPress and vBulletin, but none of them really seemed to solve my problems, so I've created yet another integration method for Wordpress and vBulletin using their plugin APIs. It basically allows you to use your vBulletin forum as the comment system for posts on your Wordpress blog, but does not integrate the Wordpress and vBulletin user systems as I have no need of that and other plugins already exist to do just that.

vBulletin offers a neat built-in feature to populate a particular forum that you specify via an XML feed at various intervals run as a pseudo cron job. This is a great way to bring stories from your WordPress blog into a particular forum which you might be using as a discussion area for your blog. Unfortunately, there's no good way to link the imported stories back to the original blog post, and no good way to link the original blog post back to the thread that was created for it via the XML feed. So, I spent the past day learning enough about the Wordpress and vBulletin plugin systems to create some plugins for both systems that work together to map specific blog posts to specific vBulletin forum threads automagically. I had already done a a simple vBulletin plugin before, but I had to do some research before I could write a WordPress plugin. 

My goal was to create these plugins in such a way that there would be zero modification of Wordpress or vBulletin source files. So far so good. The vBulletin plugin will let you specify the db info for WordPress a (in case you have a separate DB for WP) and will then automatically create a vbulletin_mappings table in your Wordpress database. Any time a new thread is added to the forum you specify and that thread was posted by the user you have specified as your feed user, it will add an entry to the vbulletin_mappings table to relate the Wordpress post to the proper vBulletin thread.

 For they system to work right, you must include the wordpress postid somewhere in the Wordpress feed that you are sending to vBulletin, so I wrote a small plugin for Wordpress that adds this data to all feeds. The Wordpress plugin will also display any posts that already exist in the mapped thread below the story, along with a link to post a new comment to the forum. You can then turn off the existing WordPress comment system, or comment it out in your single.php template in your active skin directory.    

You must also make sure you include a link to the original blog post in the template you created in your vBulletin feed settings. The automatic linking depends on finding a link in the post body fitting the proper format so it can parse out the wordpress postid. So in your vBulletin feed body template you will want to include something like:

[RIGHT][URL=http://www.mywebsite.com/wordpress/?p={rss:postid}]View the full post[/URL][/RIGHT]

The plugin can then look for a string matching the format "/?p=1234" to discover the original WordPress postid. I tried inserting this into a comment in the post body, but vBulletin strips out comments and transforms links into BBCode, so since I wanted links from the forum thread back to the original post anyway, I just parse the id from the link. 

The basic plugins are done, but I still need to package them and set up some admin configuration screens for them so they are easier to install and configure. Once that is done I will release them via the vBulletin plugin repository and make an announcement here. 

Last Updated ( Wednesday, 01 August 2007 )
 
< Prev

Search

Who's Online

We have 1 guest online

© 2017 www.brettbrewer.com
Joomla! is Free Software released under the GNU/GPL License.