Seeing as this is a brand new blog for a brand new me I think it’s only fair I let you know about some of the things I’ve been working on in recent weeks. Since about March this year I have been looking in to setting up a new website backed off of the success of other sites I have worked on such as Johns306 and Club-306. The idea was to launch a Peugeot car website where visitors could upload pictures of their cars and then others could rate them.

Now I can almost hear the comments in my head, “not another rate my photo site”and at first I thought exactly the same. Stubborn minded as I am I thought why not so I started to look for a decent script that did everything I wanted a “rate my photo” site to do. Due to constraints of the web hosting I had available to home this site I was looking for a script that would work on a PHP system backed on to a MySQL database. Much to my surprise there were not many scripts that had all the features I was looking for that worked within the constraints so my plans changed again and I decided to code my own.

Having worked with PHP for about 3 years now I was more than happy to work this out from scratch, but then realising exactly how much work would be involved I needed to look for a framework. I am a keen fan of Modx and in the past I have made all kinds of websites “fit” in to a Modx installation. As I wanted this script to be as lightweight as possible though I decided against building another Modx site and instead went looking for a PHP framework. A quick search on Google revealed a few suggestions including CakePHP and Prado but the one I chose in the end was CodeIgniter.

CodeIgniter has the almost industry-standard model-view-controller approach and having just got used to using MVC at work in the form of Struts for Java I decided to give MVC a try in PHP. An added bonus of using CodeIgniter is that there are two very good video demonstrations on the CodeIgniter website and a quick Google search revealed a few more. From these videos it was clear to me that CodeIgniter could do what I needed to do without the tedium of coding an entire web application from scratch.

Just three weeks later and I am now in the final stages of coding my version of the “rate my photo” app. Considering I spend at most 1 hour per weekday on this I think that’s pretty quick. I am looking to release the first version to the public next week, on Sunday 23rd September 2007. I would do it sooner however I’m writing this post just before I leave to go on holiday for a few days and there won’t be time to release the code before I go.

At the moment the web application has the following visitor features:

  • Upload a photo
  • View a specific photo
  • View a random photo
  • Rate a photo
  • Comment on a photo
  • Report a photo

It also has a host of admin features to keep things tidy:

  • Approve a photo
  • Remove a photo
  • Rebuild images
  • Password Changes

As a very quick overview a user visits the site and can choose to upload a photo. This can be up to a certain resolution and file size as per the application config file. The file is then resized using the GD2 library features provided within CodeIgniter and the details entered into the database (thumbnail and display image sizes are set in the config file). If automatic approval is set it will show on the site straight away otherwise it will sit there until an administrator approves the photo. Once approved the photo can be voted and commented on by any visitor. To avoid abuse the upload form and comments section use captcha codes.

I have a whole host of future improvements but at the moment the code I have will go live next week at RateMyPug, where I will be keeping an eye on things to work out where improvements are needed. I will also make the code available here so that people can try it out and make suggestions. I plan to make this an ongoing project, so any suggestions for future features would be appreciated.

Thats all for now!