Saturday, May 20, 2006

vbDrupal: Drupal + vBulletin

vbDrupal is a fork of the CMS Drupal. It uses the forum software vBulletin as it's base for user accounts and a couple of other things.

The first version of vbDrupal was based on Drupal 4.6, a lot of changes were made to the original code making it actually quite difficult to keep it up to date with newer Drupal versions.

At the end of 2005 I found out about vbDrupal and it was exactly what I needed as front page for my little big adventure community: Magicball Network (MBN). At that point vbDrupal was already a couple of months old. After installing vbDrupal on the MBN I developed a couple of modules to implement certain features I wanted. After a while I got a bit more involved with vbDrupal, a special website was made for vbDrupal and it was put on sourceforge. As soon as the sourceforge project was online I came aboard as a developer for vbDrupal. I added a couple of new vBulletin related modules and also did some maintenance. After a while I released a new version of vbDrupal, it was a dumpy release, images were corrupt, some development code wasn't properly inlined as vBulletin plugins. Not one of my better software releases.

Almost a month ago Drupal 4.7 was finally released, quite some things have changed between Drupal 4.6 and 4.7 so I decided we started vbDrupal 4.7 from scratch. Taking into account some mistakes that were made in the previous version of vbDrupal. One of the major goals in vbDrupal Next Generation (NG) was to keep the modifications to the original Drupal code as small as possible and try to keep it as much as possible compatible with all Drupal modules. In the previous vbDrupal version the user table was completely removed, this caused quite some issues with modules that relied on this table. With NG we decided to keep the user table and simply mirror the database between both user tables.

So far the modifications to Drupal's core are quite limited. However a couple of things needed to be replaced. First of all the bootstrapping of Drupal needed to be modified to initialize the vBulletin environment so that Drupal can reuse parts of it. As of Drupal 4.7 the bootstrapping is much cleaner allowing easier modifications. Pretty much all bootstrapping code has been moved to functions. In vBulletin this is not the case, therefor creating a global variable hell. The vBulletin initialization can't be started from within a function. Besides some little modifications here and there we also need to replace a few things. For example we completely replace the session code from Drupal to make use of the existing vBulletin session. And the user module needs to be modified a lot. Also the comment module needs some modifications here and there. It should be split into two parts, the default Drupal behavior or the functionality to use vBulletin for comments.

Another thing I'm keeping in mind while working on NG is to make sure it's possible to seperate Drupal and vBulletin in the future. I haven't tested it yet, but a bit of effort it should be fairly easy to replace vbDrupal with a stock Drupal. This wasn't possible with the current stable release. I'm also going to look into a Drupal -> vbDrupal conversion script.