openside(""); error_reporting(0); $scdef = "Serveris neveikia"; // Default station name to display when server or stream is down $scip = "s3.viastreaming.net"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port) $scport = "7660"; // port of shoutcast server $scpass = "*****"; // password to shoutcast server //End configuration error_reporting(0); $scsuccs = NULL; $page = NULL; include('config_radio.php'); //you may edit this path to fit your server environment otherwise leave it alone $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 80); if(!$scfp) { $scsuccs=1; echo''.$scdef.' is Offline'; } if ($scsuccs != 1) { fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); while(!feof($scfp)) { $page .= fgets($scfp, 1000); } ###################################################################################################################### /////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //define xml elements $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "AIM"); $y=0; while (isset($loop[$y])) { $pageed = ereg_replace(".*<$loop[$y]>", "", $page); $scphp = strtolower($loop[$y]); $$scphp = ereg_replace("$loop[$y]>.*", "", $pageed); if (($loop[$y] == "SERVERGENRE") || ($loop[$y] == "SERVERTITLE") || ($loop[$y] == "SONGTITLE") || ($loop[$y] == "SERVERTITLE") || ($loop[$y] == "CURRENTLISTENERS") ||($loop[$y] == "AIM")) $$scphp = urldecode($$scphp); // uncomment the next line to see all variables // echo'$'.$scphp.' = '.$$scphp.''; $y++; } //end intro xml elements ###################################################################################################################### ###################################################################################################################### /////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //get song info and history $pageed = ereg_replace(".*", "", $page); $pageed = ereg_replace(".*", "", $pageed); $songatime = explode("", $pageed); $r=1; while (isset($songatime[$r])) { $t=$r-1; $playedat[$t] = ereg_replace(".*", "", $songatime[$r]); $playedat[$t] = ereg_replace(".*", "", $playedat[$t]); $song[$t] = ereg_replace(".*", "", $songatime[$r]); $song[$t] = ereg_replace(".*", "", $song[$t]); $song[$t] = urldecode($song[$t]); $dj[$t] = ereg_replace(".*", "", $page); $dj[$t] = ereg_replace(".*", "", $pageed); $r++; } $daina = str_replace('_',' ',substr ($song[0],0,90)); //end song info fclose($scfp); } //display stats if($streamstatus == "1"){ switch ($aim) { case 'DJTalia': $aimlogo = "DJTalia"; break; case 'Serveris': $aimlogo = "Serveris"; break; case 'exe666': $aimlogo = "exe666"; break; case 'GAGAnas': $aimlogo = "GAGAnas"; break; default: $aimlogo = "dj"; } $_SESSION['djus'] = $aim; echo' Eteryje: '.$aim.' Groja: '.$daina.' Klauso: '.$currentlisteners.' '; } if($streamstatus == "0") { echo'OFF (Fuck Off :D )'; } echo" 10 Grojusiu CIA "; closeside();
Eteryje: '.$aim.'
Groja: '.$daina.'
Klauso: '.$currentlisteners.'