PDA

View Full Version : Radio Status Code



HostSeth
July 30th, 2007, 00:18
Anyone have the html code for this? I used to I lost it.

Chris L.
July 30th, 2007, 02:50
Huh? Please explain.

Dan
July 30th, 2007, 03:28
I presume he means the code that shows whether your radio is on air or off.

HostSeth
July 30th, 2007, 10:23
yeah, the one you can get from http://ip:port but I don't want to have to iframe it, I want it to say offline or online, if online i want to to say listeners song playing and past 3 songs or so.

Keagle
July 30th, 2007, 14:52
Try this.


<?php

//Shoutcast Host
$host = 'radio.com';

//Port
$port = 8235;

//Timout time
$timeout = 1;

//Code to display if radio is online
$online = '<img src="Images/online.jpg">';

//Code to display if radio is offline
$offline = '<img src="Images/offline.jpg">';

if($connection = @fsockopen($host, $port, $errno, $errstr, $timeout)){
$status = "Online";
fclose($connection);
} else {
$status = "Offline";
}

if($status == "Online"){echo $online;}
if($status == "Offline"){echo $offline;}

?>


And make offline/online images.

HostSeth
July 30th, 2007, 19:55
Doesn't Work.

Decker
July 30th, 2007, 23:25
yeah, the one you can get from http://ip:port but I don't want to have to iframe it, I want it to say offline or online, if online i want to to say listeners song playing and past 3 songs or so.


We don't know what your using, and the link went a bit :eek3:

More info more help :beer:

We're all guessing here!

krakjoe
August 2nd, 2007, 02:34
Try this.


<?php

//Shoutcast Host
$host = 'radio.com';

//Port
$port = 8235;

//Timout time
$timeout = 1;

//Code to display if radio is online
$online = '<img src="Images/online.jpg">';

//Code to display if radio is offline
$offline = '<img src="Images/offline.jpg">';

if($connection = @fsockopen($host, $port, $errno, $errstr, $timeout)){
$status = "Online";
fclose($connection);
} else {
$status = "Offline";
}

if($status == "Online"){echo $online;}
if($status == "Offline"){echo $offline;}

?>


And make offline/online images.


Doesn't Work.

Theres no reason it wouldn't work, you should be more specific what doesn't work about it, and how do you normally connect to your radio ....