Happy Saturday!

HELLO

This site is no longer being updated. May I direct you to the shiny, new site?

Below is an archive of all the posts from this site over the years.

Building your own CMS » February 15th, 2008 · See comments

Building your own content management system (CMS) can be both a very tricky and a very rewarding experience. I’m in the process of building one of my own, and whilst it’s going fairly well so far, there’s still a lot of work to be done.

So how do you get started with building you own CMS?

Well, the first thing you have to do is decide exactly what you want your CMS to do. What sort of content are you going to have? Is it going to be a basic blogging script? News updates? A list of your favourite bands? Reviews of the latest films? Before you can get started on your CMS, you need to know what the “C” will be.

Once the “C” is sorted, you can start planning the “MS”. How will you store your content? Will it be in a database, or will it be in a plain ol’ text file? What sort of database will it be? What language are you strongest with? Whilst PHP / MySQL is a very common pairing to use, it is not the only option and you might like to think about that.

I find it normally helps to abandon the computer and get out a pen and paper for the next part. Make a list of everything that you need to think about when it comes to your CMS. How will you structure your database? What types of information will you be storing? The stronger you can build the back end of your CMS, the easier the front end will be.

Once you’ve decided on the structure for your database, you can set about creating the ‘install’ script which will create the tables in the database for you, and allow you to concentrate on the rest of your CMS. The biggest part will be writing all the code to put all the features you’ve decided you’re going to include into practice.

After you’ve got the back end ‘down’ for your CMS, you can start working on the front end, which is the part your visitors will see. How do you want to pull the information from the database and display it? Which information are you going to display where? How are you going to format that information? Again, this will take a large chucnk of the time.

Now that you have the back end and the front end sorted, you may think that you are done. You’re not.

Security!

The biggest weakness that many content management systems have is their security. What will you have in place to stop people hacking into your admin panel? What will you have in place to stop people deleting all the content from your database? No one knows absolutely everything there is to know about security, but there are hundreds upon hundreds of articles about it on the Internet. A bit of googling will help you identify more things you need to worry about, because, yes, you should definitely be worried.

Spam!

If your CMS has the facility for visitors to leave comments / fill in a feedback form etc., you’re going to need to worry about spam. What steps will you take to ensure it’s a human filling in a form, and not a spambot? Some spam worries come hand in hand with security worries. What’s to stop spambots using your forms to send unsolicited email to hundreds of people? Even if you deal with the security issues, spam can still be incredibly annoying! What are you going to do to stop yourself from logging into your admin panel and seeing dozens of spam comments?

Security and spam are big things to worry about, but don’t let them intimidate you too much. There are steps that can be taken to overcome the most common problems. Do not also be intimidated by the thought of building your own CMS. It can be done, and it has been done.

There are tutorials out there that will guide you through each step of a CMS and provide you with large sections of code to use. However, it’s much more rewarding and will give you a much better understanding if you do all your code yourself. Otherwise, you won’t actually be building your own CMS, you will be recreating someone else’s.

Building your own CMS is a massive task, and I’ve only skimmed the surface with this blog entry. It’s not going to be easy, but equally, it’s not going to be impossible. Be strong, do lots of research, and have fun!

14 lovely persons have commented

Leave your own comment »

  1. Chien Yee says:

    *starts on research*

  2. Clem says:

    I’d love to build my own CMS someday, but I only have basic knowledge of PHP, so for now it’s pretty much out of the question. I’ve been looking at articles and tutorials, though I don’t want to follow a tutorial, because, like you said, it’s not as fun if it’s not really yours.

  3. Aisling says:

    Er… yes. Wordpress is my friend. I certainly do not have the attention span to do all of THAT. Ha ha. (I’ve taken to using “I don’t have the attention span…” instead of “I’m too much of an idiot.” Because… I’m NOT too much of an idiot, I’m just too lazy to focus. :P )

  4. Jenny says:

    I’m legendary, my CMS took like thirty minutes to build.

    Of course, I have no visitor facilities, but that’s OK.

    lol :P I imagine with extras included it’d take more … x)

  5. Lene says:

    My laziness forbids be from ever even attempting anything that resembles creating my own CMS. I’m pretty happy with Wordpress. In an alternate universe where I’m not lazy, I’d totally give it a try at creating my own CMS. Then I’d take so much pride on it, hehe.

    Seems like you have a good idea of what you are talking about though, and hopefully your CMS will turn out to be very good. Good luck with that :3

  6. Gabrielle says:

    I would never build a blog-centric CMS. :P I am building a CMS for something else. It’s like work on top of work… it feels like I’ll never be done! I haven’t even gotten to the blog part or a feed.

  7. Kristina says:

    It sounds so difficult o__O
    There’s no way I’d be able to sit down for hours and just… code.

    I love wordpress ^^;

  8. Regine says:

    Well, I don’t see the point of writing my own CMS again when it takes a long time to get it done, and there’s always something else to add. I stopped using my own and “converted” to Expression Engine. Recommended!

    My question is: have you tried writing your own CMS or did you just research in case you wanted to? Where did you come up with this from?

  9. Rachael says:

    ^ This comes from working on a basic blogging script, working on my own CMS for a project, reading about other people’s CMS, and common sense.

  10. Duck says:

    Very nice breakdown in simple terms of that it is an how to do it. Im really liking your site Rachael! – it must take up alot of your time no?

    Duck.

  11. Matt Wilcox says:

    Having built my own four or five years ago, I know aaall about it. In fact I’m still (a year later) only mid-way through a third ground-up re-write of my blog and CMS. But when you get a job in the industry the last thing you want to do after work is more of the same, which accounts for the terrible lack of progress on my own CMS (and front-end).

    I think the first thing anyone should be asking themselves is “why am I making my own CMS?”. For me, it was because I was learning PHP/MySQL from a book at the time, and WordPress wasn’t out yet. I would strongly urge people to think about whether they are going to have the time and passion in the future to update, modify, enhance, or re-write their custom CMS. If you guess not, then go with a third party tool because someone else will be doing all those things for you. And trust me, no matter how pleased you are with your own CMS, at some point you will want it to do new things (tagging for example was a killer new idea I had to have for my second CMS), and you’ve got to spend the time to do it yourself if you’ve rolled your own – instead of upgrading to the latest version of your blogging/cms software and finding it all done for you.

    On the other hand, there’s a great satisfaction in baking your own CMS – you know exactly how it works, and why it works in the way it does. Plus you can do anything you want with it, and not have to try working around someone else’s code in order to hack functionality in.

    Ask ‘why’ before you ask ‘how’.

  12. Matt Wilcox says:

    dammit! tiny keyboard and I hit the wrong key and submitted the comment before I’d finished. Doh.

  13. Richard says:

    Clever girl, Rachael!

    I’m still struggling with Joomla!

  14. James says:

    When you’re building a CMS try to break it down into small bits, it will make it a hell of a lot easier.

    For example for a login I would think:
    - Create a form to collect the users info
    - Check the fields are filled out
    - Check they haven’t put anything nasty in (mysql_real_escape_string)
    - Encrypt the password (salt & md5)
    - Compare it to what’s in the db
    - If there isn’t a match, tell them and go back to the login page
    - If there is, set a session and take them to the page they wanted

    And that’s it!

    Coding is simple if you can break what you need to do down to small chunks.