PurpleCMS v0.2

Posted by Evan at 9:40 am on April 19th, 2009

At last, after more than 8 months of waiting and working, the first fully functional prototype of my content management system is complete! Named PurpleCMS (since purple is my favorite color), this system allows me to work with posts, comments, and tags in a friendlier environment than phpMyAdmin and it has helped me learn a lot about PHP and MySQL (and even a bit more about HTML) as I faced problems I hadn't seen before and had to develop solutions.

One of the first things I had to learn about was PHP sessions. Last summer I had tried to develop an authentication system for the original prototype (which I considered to be PurpleCMS v0.1) but I ran into difficulties and was hesitant to proceed with development without having adequate security in place. I did finally manage to get the authentication system working, however, and it was about this time that I scrapped the first prototype and began development on the second (PurpleCMS v0.2).

The architecture of the second prototype deviates from the first significantly. Originally I had placed all the code (for everything from authentication to working with the data in the database) in a single PHP file, admin.php. Well, it didn't take long to realize that such an architecture would quickly become unmanageable, so in the second prototype I separated the code out into files based on what it did. If it dealt with authentication of the user (such as logging in, logging out, and verifying authentication when the user asked to do something) the source code was moved to admin-login.php. This was the first part of the new prototype which I worked on (since security is obviously a major concern when opening up the database to editing) and I completed it without much difficulty: most of the work here had already been done in the first prototype, I simply needed to do a little rearranging of the code.

The second component of PurpleCMS I worked on was admin-posts.php, which works with drafts, published posts, and tags - most of the code here had to be written from scratch. It was in this component that I first ran into many of the problems I hadn't dealt with before and so it was here that I developed a number of solutions which would eventually get reused throughout PurpleCMS. Shortly after completing this component I wrote the first post to go through the PurpleCMS process exclusively: from the first draft until it was published, Free and Open Source Software was managed entirely by PurpleCMS. It was very exciting! :)

The third component I worked on in PurpleCMS was admin-comments.php. Having already built solutions for a lot of the common problems over in admin-posts.php, admin-comments.php was remarkably easy to implement. It can now support creating, editing, and deleting comments. Yay!

It was at this point that I declared the second prototype completed, since it could do everything I had originally specified. Naturally during the course of development new features were added to the requirements specification (the practically inevitable feature-creep) and I hope to implement them sometime in the near future, but for now PurpleCMS does what I envisioned it doing. Of course, not all the enhancements were postponed until after the prototype was completed: some things were just too much fun to pass up! Like incorporating Ajax into the posts' menu pagination system, that was a fun distraction!

Among the improvements I would like to make in future prototypes is a redesign of the architecture. While the architecture of the second prototype is significantly better than the first, I still find it messy and somewhat confusing at times. As I gain experience working with PHP I've gained a better understanding of how to set up PHP scripts and how to organize the code, but I'm still a long way behind compared to source code organization in, say, Java. Hopefully the third prototype will be organized more effectively and elegantly.

Another feature I would like to add is the ability to work with creating and updating users, both for unguku.com as well as PurpleCMS itself. This would require modifying the PurpleCMS source to make use of "access levels" in order to protect data and keep people from changing things they shouldn't, but the ability to give "tours" of PurpleCMS to guests would be cool. I would also like to add features to unguku.com which could make use of logged in users, in particular allowing for personalization (such as setting times to the proper timezone) and automating tasks (such as pre-filling the comment fields).



There are no comments.



Leave a comment



 Name (required)

 Email (will not be published) (required)

 Website