SAM Broadcaster is a fully featured internet broadcasting program that includes everything you need to start your own Internet Radio station. From automation, playlist management, encoders, statistics and web intergration. It is made by the folks at Spacial Audio Solutions and it is one of the center pieces of software that drives Celtic Radio.
The SAM Broadcasting package comes with a few different ways to publish your radio website. One is through a HTML template system and the other is through a PHP template system. Our article will focus on the latter (PHP) as that is what we have used at Celtic Radio and is the focus of our Cookie Rating Script!
Spacial Audio has done a great job creating the SAM broadcasting Internet Radio system. The included PHP template system using our favorite scripting language was a big selling feature for us! However, this system is just a default template and is not meant to be the theme of your broadcasting website. One feature we identified rather quickly was the ability for our listeners to rate the currently playing song.
Thus was born the idea for the PHP SAM Cookie Rating Script. The purpose of this script is to allow for a cookie based rating system that works in conjunction with the default PHP template. Listeners can rate a song once every 24 hours and only when that song is playing on your broadcast. Some broadcasters have chosen to only allow one rating per song, but we believe that giving our listeners the ability to rate a song multiple times over time will create a better broadcast by playing the songs listeners want to hear. Not only does this script provide a rating system, but it also adds weight to a song based on the following formula:
Rating & Weight System Rating of 5; add 5 to the weight. Rating of 4; add 3 to the weight. Rating of 2.5; add 0 to the weight. Rating of 1; add -3 to the weight. Rating of 0; add -5 to the weight.
Additionally, listeners will be able to see the current rating and weight of the song upon a successful rating via a pop-up web page.
Because of buffering issues with web radio, sometimes the song playing will not match what shows on your website – it could be off by 5 seconds or 20 seconds. Therefore, we have built in a check that prevents rating a song that does not match what is currently playing on your broadcast.
Ok, enough with explanations, lets actually get into the working script. Open up your favorite PHP editor or development tool, our favorite is TextPad by Helios Software Solutions, and create a file named “ratesong.php”. Download the complete PHP Cookie Rating Script and follow the detailed instructions to install all necessary scripts, html and graphics.
To see a working example of the PHP Cookie Rating Script, visit Celtic Radio.
* Included with this script are the stars.gif graphic set to display rating stars on your website. Example:
* Please note that on CelticRadio.net we use a thumbnail version(100×100) to display a smaller version of the album cover in the rating script. You may need to adjust the pop-up size of the webpage to adjust to the standard size you use for displaying album covers.
Any questions at all on installing this script, ways to make it better or just to say “Hello”, give me a shout at Celtic Radio.
Download: PHP Cookie Rating Script