Click A Life

~ where coding happens ~

There comes a time when a developer is faced with a situation where there is a need to integrate third party applications (e.g Wordpress, Drupal, VBulletin, Joomla, Mambo, etc) with another third party application or even a custom built application. I myself is always faced with such situations and based on my experience, the implementation of web service is still the best option rather than hacking through codes of these applications.

One such scenario is when I was asked to use VBulletin’s membership system (using the ‘users’ table) and integrate it with Wordpress, the most popular blogging engine. Since the requirement is to use the VBulletin’s users table, the best option I can think of is to implement a web service on VBulletin. I started the project by creating a SOAP server using NuSOAP (our server farm is all on PHP4) which queries the database of VBulletin directly. Below is an example of a web service that I created for the project:

This web service will then be consumed by any other third-party applications. Let’s say ws_CheckMember for example checks the validity of the user in VBulletin’s users database. It returns 0 if the username doesn’t exist, 1 if it exists but password is not correct, and 3 if the username and password are both correct.

Next step is to create a plugin for Wordpress to override the login process. What I did is create the plugin and override the wp_login function in the pluggable.php file. Just copy and paste the entire function and customize it as a web service client. In my case, I just need to get the user’s details (username, password, and email) from VBulletin and insert it into the Wordpress’ users table upon logging in. This will make the overall wordpress process (write and manage contents, ACL, comments) smooth as it is without the integration.

On the long run, this implementation will also make the upgrading of these third-party applications easy and possible since there are no codes modified in the core. Also take note that this integration can be implemented even when your applications are hosted on different servers. That’s the beauty of web service.

For those who are curious on how to fix the problem of the Illacrimo theme not displaying the visual editor when writing new contents on the wordpress admin panel. Here is a quick solution that works:

1. Edit your functions.php file inside the Illacrimo theme folder with a text editor like notepad.
2. Remove the extra ?><?php between the // Widget Settings and /* Plugin Name: Recent Comments
3. Voila! Your Illacrimo should work by now!

  • 0 Comments
  • Filed under: PHP, Wordpress
  • Recent Comments

      What I'm Doing...

      Posting tweet...

      The bossHappy familyLuge @ SentosaPeace!Waiting.. Tool's town dayMustafa Center-Little India SingaporeStudyingDrupal Cheat Sheet on my deskHappy family