How to leverage open source content management systems beyond their original purpose

by Stephen Fluin 2009.03.07

There are a lot of good open source CMSes out there, whether it is Wordpress, PHPBB, etc.

A lot of software projects ignore these CMSes because they aren't targetted for purposes beyond the simple. In other words, people only think about Wordpress when they think about blogs, people only think about PhpBB when they think about forums, etc. For those out there who think this way, there is a whole other world of possibility for leveraging existing applications. These examples and instructions are intended for software developers, and involve development of new web pages, and learning existing code.

Example 1 - Repurposing a Forum as a User Management System

My experience with doing this was with the Invision Board, but the same instructions would work with any forum written in any language. The first step was to begin looking at the database layout. The Invision Board had a normal looking users table storing usernames, user profile information, and a password hash. Based on this, and the forum's ability to create new users, allow users to manage their own account and password, I decided that the existing code was suitable enough to extend as my own user management system.

The next step I took was to figure out the password hashing mechanism. Typically a CMS will use something simple like MD5, MySQL's PASSWORD() method, encrypt, or SHA. I attempted to manually hash my password using each of these, and nothing matched the contents in the database, so I needed to dig deeper. Luckily, I had the code for the CMS, so I opened the source and found the spot where passwords were checked for new logins. It turned out that in this case, the system was using a salt and multiple passes of MD5. Once I understood the hashing algorithm used, I simply needed to reproduce this in my code, and I was able to check usernames and passwords to create my own login system.

I could have integrated with the login session management of the forum, but I determined that their system was too complex for what I was trying to do, so I created one from scratch. The negative side effect of this is that users will have to log in twice if they want to use my system as well as the forum.

Example 2 - Repurposing a Blog as a Website CMS

I have done this with a couple of pieces of blog software, including WordPress. There are a lot of ways of going about this, and this one might not work for you, so make sure you consider your goals before choosing a piece of software to modify.

I will only describe generally the purpose I would follow if I had to do this again today, because things have most likely changed a lot since I have done this.

Step one would be to determine the look of the site I was going for and implement it. This would most likely involve removing any "blog-like" features that I don't want, such as blogrolls, calendars, etc. Most Blog software will allow you to do this without modifying the code at all, just modifying the templates.

Once the site matches the desired look, the next step is to add any extra capabilities you need. One example of this would be to convert the blog's tagging system into a site segmentation. For example, if you want your site to have "News", "PC", "Mac", and "Linux" sections, you could simply associate each article with one of these words, and then add a piece of custom software to the display of the template and general layout so that it iterates over the tags, and displays them as section titles.


permalink