Writing a CMS

*** Preface: For those who want to further read about what a CMS is click here

A content management system (CMS) is a computer application used to create, edit, manage, and publish content in a consistently organized fashion

So the last website design I cooked up was pretty neat, but I’m remaking it (see my previous post to understand why). The other thing I’m focusing on is the script that drives the site. Last time it was a rudimentary PHP script that just spit out content. This time I’ve taken a step back and decided to do it RIGHT.

I’m going to write it myself from the ground up. Its easy enough to go with some prepackaged script some nerds put together, but then I’ll end up hacking the shit out of it to make it do what I want… so whats the point in using it in the first place? The other reason to write this myself is because the website interacts with the game server so much; I want to make sure I have as much control over this as possible.

Here’s some cool things I’ve learned that you should all use at one point or another in a PHP script:

  • Classes. Use classes or you’re and idiot. Object orientated programming is your friend.
  • ob_start… look this function up and harness its power.
  • Just like any application, make your web applications modular. God kicks a puppy in the face every time you don’t.
  • Comment your code. Even if you’re the only person that’s ever going to look at it, it helps you debug and sometimes even reminds you what the fuck you were thinking.

I don’t think I’ll make a template system. I’ll just make a hybrid index.php that renders the basic site layout and calls functions to display content. I’ve tossed around the idea of making templates, but I think its a waste of time for what my needs are.

I’m still working on the new site design… I’m getting closer. One step closer I guess, but now I’m off to play some Xbox 360.