The Radio ‘On Air’ Script

Over the past few months I’ve developing the One Media Group (OMG) website for Staffordshire University Students’ Union.

The theme was ‘out of the box’ from ThemeForest and what I’ve done is add some of the functionality and change how it looks a bit.

The main function that I wanted to add to the site was who was on air and how that was displayed on the site.

I’ve worked my good friend and colleague Christopher Smith for several years and what has become known to us as the ‘on air’ script has helped us both massively.

The basis of the script is a text file which contains each day’s schedule. Each line consists of the time the show is on air and the presenter/show name , all separated by pipes. A PHP file then reads this text file and uses the pipes to divide the information up and assigns it to a string which is printed. There are several different files which do different things; one to see what’s on air now and then ones to display a particular day’s schedule.

When we started using the script we would just simply include the relevant files where we wanted them, but now we both work with WordPress and wanted to integrate it a bit better.

Something I wanted to do was use some AJAX to update the on air information without the user refreshing the page. Christopher found the AJAX which the radio station he was working with used to update their now playing song. We modified it slightly and now on the OMG website it is used in the header to display the on air now and next show information.

My code is different from Christopher’s as I wanted to display it slightly differently. The AJAX is reloading a PHP file which has the listen and webcam button as well as includes for the on air now and next PHP files, which read the schedule text file. This file is reloaded on any OMG page every 60 seconds.

Now for the schedule page of the website. I didn’t want to include an iframe in a page entry (like I did last year for Cre8 Radio) as it wasn’t very tidy and was a pain to maintain! So Christopher and I worked together on creating a page template that we could apply to our schedule pages. All I did on the template was include the seven ‘day’ PHP files and styled them so they looked good.

To edit the text file that would contain all the on air information I wanted something that was easy and plain. So I installed CMS from Scratch in a directory and created a single text file that those with the client password could edit. It does take users outside of  WordPress to edit a single file, but I felt this was easier than trying to direct people to the theme editor page within WordPress (mainly because I didn’t want to give them Admin rights to do so!).

However, I wanted to see if there was anything I could add to this. On websites such as BBC Radio 1, where it tells you who is currently on air in the header, it’s also a link to their show page. What if I could do this as well in the header of the OMG website?

I dived back in to the PHP files which were figuring out what the on air text file meant. I was easily able to add another pipe for it to read, which would contain a URL to print. Originally the button span was printed in the file which the AJAX was reading, but I needed to change it so that the span was printed in the on air now PHP file. It was a bit messy for a while as I tried to figure out where things were being printed.

My next thought was ‘what if that presenter/show doesn’t have a page we can link to?’ This required much more work as I figured out what PHP function to use to see if a string was empty. I eventually used the empty function and told it that if it was empty to point the link to the schedule page. On the schedule page, the show links would also display in the presenter and show names.

Another use that I hope to use the show links for is when the news and sports shows are on, is that the link can point to the news and sports pages. Also when we cover Varsity in a couple of months time, those links can all point to our live blogs and Varsity homepage.

  

That’s pretty much what I did over Christmas to enhance the OMG website! I will also be using much of that code and integration for the Cre8 Radio website when it comes back on air in May/June.

All of these changes will be activated once the new branding comes in (which should be within a week or two of writing this).

The OMG Rebrand

At the start of the 2011 academic year, the incoming management team of Staffordshire University Students’ Union’s One Media Group (OMG) decided that it was time for a rebrand.

According to reports from students and people around the university, OMG has a ‘rebrand’ almost every two years. But this year, the team didn’t want to completely lose the brand that had already been built up.

The team’s aim for the rebrand is to make it more appealing to students. The main thrust of this will be the redesigned logo which shows more creativity, as we are a creative group on campus. The old logo didn’t reflect this.

My part in this was helping to redesign the website. I was asked at the beginning of the summer if it was possible and necessary to move the OMG website off the Staffs Union website and content management system, MSL. I suggested WordPress straight away. When the rebrand idea was announced, I immediately knew that the website could be an integral part of this.

The new website is hosted by a professional company and I am able to do what I want with it. The website is simply WordPress with a theme on it. Since the hosting being available, I’ve been able to play with it until there was something that I and the management were happy with. I’ve also worked with the Promotions team to ensure that it has the best effect possible.

One big thing that I’m excited about with moving to WordPress is that it means we can continually develop the website. Also it means that the students that are going to be using it to post articles should be familiar with it, as broadcast journalist students who post to StaffsLive use WordPress very regularly.

The theme that I’m using has some great features such as additional review information, YouTube and SoundCloud embed short codes and also built in share options.

The new website will be on www.omgstaffs.com and as part of the rebrand we are not using any other variations of the website address, including in our studio email address.