Subject: shoutcast/icecast radio block

Posted on: 01/10/07 01:25pm
By: nobese

we started to broadcast a web radio on our website www.mulksuzler.net

but i need a block to listen on the any page on my site

i found a code and tried but it dosnt work

is there any idea?

thanks

Re: shoutcast/icecast radio block

Posted on: 01/10/07 03:30pm
By: Dazzy

If you post the code you're trying to use something may be able to fix it for you!

Re: shoutcast/icecast radio block

Posted on: 01/10/07 09:02pm
By: nobese

Function phpblock_radio () {

// Fill in your own server information here:
$host = "89.149.217.39";
$port = "8001";
$listenlink = 'http://89.149.217.39:8001/mulksuz.m3u'; //make link to stream

$fp = fsockopen("$host", $port, &$errno, &$errstr, 30); //open connection
if(!$fp) {
$success=2; //se-t if no connection
}
if($success!=2){ //if connection
fputs($fp,"GET /7.html HTTP/1.0rnUser-Agent: XML Getter (Mozilla Compatible)rnrn"Wink; //get 7.html
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp); //close connection
$page = ereg_replace(".*<body>", "", $page); //extract data
$page = ereg_replace("</body>.*", ",", $page); //extract data
$numbers = explode(",",$page); //extract data
$currentlisteners=$numbers[0]; //set variable
$connected=$numbers[1]; //set variable

if($connected==1) //if DSP is connected
$wordconnected="yes"; //set variable
else //if no DSP connection
$wordconnected="no"; //set variable
$peaklisteners=$numbers[2]; //set variable
$maxlisteners=$numbers[3]; //set variable
$reportedlisteners=$numbers[4]; //set variable
}



if($success!=2 && $connected==1){

// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
$song=explode(" - ",$numbers[6]);

// strings can of course be replaced with your own bla
$display .= "Mulksuzler Radyo dinlemektesiniz<br>";
$display .= "Artist: ". $song[0] . "<br>";
$display .= "Song: ". $song[1] . "<br>";
$display .= "[$currentlisteners/$maxlisteners users]"."<br> <a target='_new' href=' " . $listenlink ."'>[click to listen]</a> ";
}
else {
$display .= "Mulksuzler Radyoda simdi";
$display .= "Yayin Yok.";
$display .= "Sonra gene deneyin.";
$display .=":::";
}

return $display;

}

Re: shoutcast/icecast radio block

Posted on: 01/10/07 09:15pm
By: nobese

Even though I am listening to the Radio, it states that the Radio is Offline..

Re: shoutcast/icecast radio block

Posted on: 08/10/07 07:53am
By: Anonymous

You have to use curl to get server status, playlist etc. from Icecast servers.
This code has nothing to do...


Re: shoutcast/icecast radio block

Posted on: 10/10/07 12:53pm
By: koalasoft

not working Frown

Re: shoutcast/icecast radio block

Posted on: 28/12/07 05:39pm
By: Anonymous

Hi,

use this: http://shoutcast.sodah.de/#/House/6668/

PHP Formatted Code
<object width="240" height="200" type="application/x-shockwave-flash">
<param name="movie" value="http://shoutcast.sodah.de/shoutcast.swf?swfgenre=House&swfchannel=6668"/>
</param>
<embed src="http://shoutcast.sodah.de/shoutcast.swf?swfgenre=House&swfchannel=6668"
type="application/x-shockwave-flash"width="240" height="200"></embed></object>



Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=78731