Parašė Nepas· 2009 Bal. 18 00:04:59
#3
openside(" FM");
//Configuration
$server2 = "IP"; //IP des Shoutcast Servers
$server2port = "port"; //Port des Shoutcast Server - Bsp.: 8000
$server2pass = "reklamuok1"; //Passwort des Shoutcast Servers
$dateix = fsockopen("$server2", $server2port, &$errno, &$errstr);
if( !$dateix )
{
echo "";
fclose($dateix);
}
else
{
fputs($dateix,"GET /admin.cgi?pass=$server2pass&mode=viewxml HTTP/1.0\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT;)\r\n\r\n");
$fm = 0;
while (!(feof($dateix)))
{
$fm .= fgets($dateix, 4096);
}
fclose($dateix);
}
$tmpx = explode("<CURRENTLISTENERS>", $fm);
$tmpx = explode("</CURRENTLISTENERS>", $tmpx[1]);
$server2lauscher = $tmpx[0];
error_reporting(0);
$scdef = "Serveris neveikia"; // Default station name to display when server or stream is down
$scip = "79.98.26.138"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = "8000"; // port of shoutcast server
$scpass = "jpafm1990"; // 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.'<br>';
$y++;
}
//end intro xml elements
######################################################################################################################
######################################################################################################################
/////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//get song info and history
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$r=1;
while (isset($songatime[$r])) {
$t=$r-1;
$playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);
$playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);
$song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);
$song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);
$song[$t] = urldecode($song[$t]);
$dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
$daina = str_replace('_',' ',substr ($song[0],0,90));
$test = $currentlisteners + $server2lauscher;
//end song info
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
switch ($aim) {
case 'DJTest': $aimlogo = "djtest.jpg"; $skype = "skype:namez_lt?chat"; break;
case 'Serveris': $aimlogo = "aimlogo.jpg"; break;
case 'DJManas': $aimlogo = "manas.jpg"; $skype = "skype:djmanass?chat"; break;
case 'Katinas': $aimlogo = "katinas.jpg"; $skype = "skype:flipuks?chat"; break;
case 'PauliuKas': $aimlogo = "paulius.jpg"; $skype = "skype:pulezzz1?chat"; break;
case 'Rinve': $aimlogo = "rinve.jpg"; $skype = "skype:rinvix?chat"; break;
case 'Marius': $aimlogo = "kuilys.jpg"; $skype = "skype:kuilys1?chat"; break;
case 'DjKestas': $aimlogo = "kestas.jpg"; $skype = "skype:kestis.222?chat"; break;
case 'Paulius': $aimlogo = "pauliuss.jpg"; $skype = "skype:oooops3?chat"; break;
case 'DJFuXaS': $aimlogo = "fuxas.jpg"; $skype = "skype:saltainis?chat"; break;
case 'Juste': $aimlogo = "juste.jpg"; $skype = "skype:jooste.?chat"; break;
case 'Kilbasas': $aimlogo = "kilbasas.jpg"; $skype = "skype:audrius826?chat"; break;
case 'Winston': $aimlogo = "winston.jpg"; $skype = "skype:creative7881?chat"; break;
case 'YooWeeZ': $aimlogo = "yooweez.jpg"; $skype = "skype:weezooz?chat"; break;
case 'Muonika': $aimlogo = "monika.jpg"; $skype = "skype:muonciuks...?chat"; break;
case 'Iewutja': $aimlogo = "ieva.jpg"; $skype = "skype:ievutesz?chat"; break;
default: $aimlogo = "aimlogo.jpg"; $skype = "http://jpa.lt/fm";
}
$_SESSION['djus'] = $aim;
echo'<div align="center">
<table cellpadding="0" cellspacing="0" width="1">
<!-- MSTa*keiksmai*ype="nolayout" -->
<tr>
<td height="36" bgcolor="">
<p align="center">
<a href="'.$skype.'"><img border="0" src="http://www.fm.jpa.lt/DJ/'.$aimlogo.'" width="140" heigth="100"></a></td>
</tr>
<tr>
<td height="17" valign="bottom" bgcolor="">
<div align="center">
<table cellpadding="0" cellspacing="0" width="111">
<tr>
<td height="17">
<p align="center">
<font face="Tahoma" style="font-size: 10pt" color="#3E1710"><b><small>Eteryje:<small></b></font>
<font face="Tahoma" style="font-size: 10pt" color="#000000"><small>'.$aim.'<small></font></td>
</tr>
<tr>
<td height="17">
<p align="center">
<font face="Tahoma" style="font-size: 10pt" color="#3E1710"><b><small>Groja:</small></b></font>
<font face="Tahoma" style="font-size: 10pt" color="#000000"><MARQUEE direction="left" loop="20" width="160"><small>'.$daina.'</small></MARQUEE></font></td>
</tr>
<tr>
<td height="17">
<p align="center">
<font face="Tahoma" style="font-size: 10pt" color="#3E1710"><b><small>Klauso:</small></b></font>
<font face="Tahoma" style="font-size: 10pt" color="#000000"><small>'.$test.'</small></font></td>
</tr>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Serveris laikinai neveikia</font>';
}
echo"
<center>
<a href='http://79.98.26.138:8000/listen.pls'><img border='0' src='http://jpa.lt/wp-content/plugins/sc_widget/winamp.png' title='Winamp/AAC+'></a>
<a href='icyx://79.98.26.138:8000/' ><img border='0' src='http://jpa.lt/wp-content/plugins/sc_widget/wma.png' title='Windows Media Grotuvas/MP3'></a>
<br>
<a href='http://fm.jpa.lt/viewpage.php?page_id=6' >Grojusios dainos</a>
<br>
<a href='http://fm.jpa.lt/viewpage.php?page_id=9' >Padėk JPA FM</a>
<br>
<a href='http://fm.jpa.lt/viewpage.php?page_id=18' >Negroja?</a>
</center>
";
closeside();
Veikia nes bandziau kaskada ;)
ir beje cia kiek zinau daryta kaskas kad is dvieju servu skaiciuotu kiek klauso tipo kaip winamp ir windows media player :D na nesupratau as cia nes ne as dariau tik ilindau ir pajamiau :)
Redagavo Nepas· 2009 Bal. 18 00:04:55