PDA

View Full Version : Need a script to tell viewers who's on the air



DJ_Melody
02-09-2007, 08:46 AM
As many of you can tell from my ID, I am a DJ & General Manager for an internet radio station online.

The other DJ's on the station have requested that I put a feature on the website so that when one of them logs onto the server to DJ, it will say who is DJ'ing on the website.

Does anyone know of a script that could accomplish this task? I don't know enough about scripting or coding to be able to write one myself yet, so I'm hoping someone here might be able to help.

thetestingsite
02-10-2007, 01:37 AM
Can you be more specific (as far as what type of streaming media server you use [ex: Shoutcast, RealServer, etc.]). Also, how are the DJ's logging into the system (ex: what type of program/script is being used and whether or not it uses a database to store the sessions, etc). Any further details and perhaps someone here could help you out.

Hope this helps.

mburt
02-10-2007, 01:48 AM
Hmm... when your DJ's log on, is the login info stored as sessions, cookies, what? If we can get that, your question would be very easy to answer :)

DJ_Melody
02-10-2007, 04:26 PM
Can you be more specific (as far as what type of streaming media server you use [ex: Shoutcast, RealServer, etc.]). Also, how are the DJ's logging into the system (ex: what type of program/script is being used and whether or not it uses a database to store the sessions, etc). Any further details and perhaps someone here could help you out.

Hope this helps.


We use a shoutcast server from spacialnet.com. The DJ's log on via a program called SAM Broadcaster. (I use a program called Nicecast, because I use macintosh) I know very little to NOTHING about wether SAM Broadcaster uses a database to store sessions when the DJ's log on or not, but I'll tell you what I DO know and perhaps it will help.

I know that the server is here: http://sc5.spacialnet.com:18092/

I know that it has SOME sort of log file, when you go into the admin panel there. However what it logs, I do not know. I clicked "tail logfile" to see if I could get anymore information out of it, and it wouldn't load. I hope this is at least somewhat helpful... :(

thetestingsite
02-10-2007, 07:30 PM
Well, I was looking around your website, as well as the Shoutcast DNAS. The only thing that I could suggest is make your own login/logout script that keeps track of the DJ's (or something to that effect). As far as I can see, this would be one of the only options if you wanted to disply the DJ playing at the time. The second option would be to make a script that displays the DJ by an array (find the date/time see, see which DJ is supposed to be on the "air" and display that user information.

Anyways, hope this helps.

BLiZZaRD
02-11-2007, 04:54 PM
Well, I had some free time, a php book, and I liked the idea of a challenge.

So I made this script (http://cleverwasteoftime.com/blizzcorner/DJCount/index.php) for you.

Now I won't take all the credit as I had a lot of help from a friend of mine :D

Here is the idea:

It starts off with 4 files: index.php, on_air_class.php, on_air.cfg, and modify.php.

Next we enter the DJ's information (add or remove as well as edit existing DJ's names, etc) in the on_air.cfg file. It is a very simple process here. If you need to add more just follow the examples, :D

Once that is done open modify.php in an editor to find these lines:


$administrator_password = "administrator";
$dj_reset_password = "clearentries";


These are for YOU as the administrator. You can change them to whatever you like. The admin password will allow you to edit a single entry as needed. The rest password will return all values to "Off The Air" to all DJ names that have a configuration file set up.

So as a DJ they need to go to modify.php. There they will find the table again but now it has radio buttons and a password box. The first thing to do is to enter a password. If their name has a * next to it this means they don't have a config file yet. They make up their own password, enter it in the field and their configuration file will be created. Next they once again click the radio button, enter their password and the text "Off The Air" will become editable. They can change the Off to On and hit enter to update the account.

It is really less complex than I make it sound.

Go Here (http://www.cleverwasteoftime.com/blizzcorner/DJCount/modify.php) to see the editing table. I have left 2 DJ's without config files, and set up the other 2. One is currently "On The Air" and the other is "Off The Air"

Go ahead and play around with it. If you like it and think it can work for you let me know and I will zip up the files and send them to you (or attach them to a post here so you can download them as you need to) :D

Enjoy!

P.S. The 2 DJ's with config files already (skittles and biznitch) use their names without the "dj" as their password. Sorry forgot to mention that.

thetestingsite
02-11-2007, 05:30 PM
Nice script Blizzard, and from the looks of it fairly easy to integrate with an existing website.

BLiZZaRD
02-11-2007, 05:53 PM
Thanks. Yeah all you really have to do is copy the index.php code (4 lines) to which ever page you want, and then tell the modify.php to redirect there instead of index.php.

Pretty nice. I use this script for a couple things on one of my sites. It is quite handy.

BLiZZaRD
02-18-2007, 03:22 PM
Heh... is that a no? :)

tech_support
02-24-2007, 02:37 AM
I think it's a "Yay! I got it working!! Now I won't come back :D"

BLiZZaRD
02-24-2007, 03:07 PM
Appears that way doesn't it? :p

Oh well, perhaps someone else can use the script for something else?

I will attach it here just to get it off my harddrive :)

Enjoy if you use it. 4 files total, 11 KB approx in size