Free Telly Guide UK, PHP

php2.gif
Free Telly Guide UK, PHP

I had a great time with PHP and MySQL developing a page to display UK TV listings, which was at www.freetellyguide.co.uk (no longer active). You can select which TV channels to display, you can use free-text search, and look ahead day-by-day for the next week. Most programmes have associated summaries which we show in a sidebar, using a smidgeon of JavaScript.


It's always nice to collar a job through my web-site, and that's what happened when James of Akroweb in South Devon found me and put me in touch with Chris Cheverst. Chris is also based in Devon, and has been supplying TV listings for newspapers and magazines for quite a while. The logical next step is to launch something similar on the web. This used all the same back-office infrastructure that he'd put together to collate all the disparate channel listings. The end-product of that was a simple large text file in CSV format. This was straight-forward to parse with PHP using fgets and explode as the main tools.

PHP and Iterative Web Design

Chris had a good idea of what he wanted and had crafted a neat PDF of the layout. We iterated implementations for a week or two, spiralling towards an attractive and functional layout in a surprisingly short time.

Screenshot from the Free Telly Guide

We also realised the need for a few add-ons, such as administrative tools to clear out a day of data in the odd cases where duplicates were loaded. There is a facility for optional adverts slotted in at the top of the hour. We call the PHP function file_exists to see if there is a JPG or GIF in a certain folder with an hour-related name. If so then load it. This allows flexibility as the demands of advertisers wax and wane, without any code changes.

We had a slight detour using the excellent "overlib" JavaScript package to display programme summaries floating above the clicked item. But instead we settled on getting our own JavaScript to show the summary in a sidebar, where we had a bit more control on the layout. We added logos in the sidebar for the free telly guide and the channel.

HTML and CSS Validation

As always, I chiselled away to get as near-perfect HTML validation status as was possible. I just love that Green Tick when Firefox and HTML Validator pronounce that all is well with your HTML and CSS. Using our own PHP rather than a CMS meant that the route to HTML validation was a bit easier: it did not depend on synchronising the actions of lots of other software layers.

PHP, MySQL
Date: 2008

Top of page