Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Radijo panele.

Parašė Mantux94· 2009 Sau. 6 22:01:18
#1

Na stai nebuvo ka veikt padariau radijo panele :D
Kai turesiu daugiau laiko padarysiu V2 ;)
Pazimetus reikia keisti!!
Atrodo:


Nekaip bet gal kam prireiks ant greicio dariau reiks kada graziai :)

openside("Radijas");

error_reporting(0);
$scdef = "Radijas"; // Default station name to display when server or stream is down
$scip = "JUSUIP"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = "JUSUPORTAS"; // port of shoutcast server
$scpass = "JUSUPASS"; // 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, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' greit veiksime';
}
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"))
$$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));
//end song info

fclose($scfp);
}

//display stats
if($streamstatus == "1"){
switch ($aim) {
case 'WiNALL': $aimlogo = "Serveris"; break;
case 'Serveris': $aimlogo = "Serveris"; break;
case 'Minix': $aimlogo = "Minix"; break;
default: $aimlogo = "dj";
}
$_SESSION['djus'] = $aim;
echo'
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (Untitled-7) -->
<table id="Table_01" width="193" height="305" border="0" cellpadding="0" cellspacing="0">
   <tr>
      <td colspan="7" background="http://mantux94.xz.lt/radijui/images/radija_01.gif" width="193" height="30" alt=""></td>
   </tr>
   <tr>
      <td rowspan="7" background="http://mantux94.xz.lt/radijui/images/radija_02.gif" width="23" height="274" alt=""></td>
      <td colspan="5" background="http://mantux94.xz.lt/radijui/images/radija_03.gif" width="152" height="13" alt="">Daina: '.$daina.'</td>
      <td rowspan="7" background="http://mantux94.xz.lt/radijui/images/radija_04.gif" width="18" height="274" alt=""></td>
   </tr>
   <tr>
      <td colspan="3" background="http://mantux94.xz.lt/radijui/images/radija_05.gif" width="57" height="55" alt=""></td>
      <td width="95" height="55" colspan="2" valign="top" background="http://mantux94.xz.lt/radijui/images/radija_06.gif" alt=""><pre class="pirmas">Eteryje:'.$aim.'
</pre></td></span>
   </tr>
   <tr>
      <td colspan="5" background="http://mantux94.xz.lt/radijui/images/radija_07.gif" width="152" height="14" alt=""></td>
   </tr>
   <tr>
      <td rowspan="4" background="http://mantux94.xz.lt/radijui/images/radija_08.gif" width="1" height="192" alt=""></td>
      <td colspan="4" background="http://mantux94.xz.lt/radijui/images/radija_09.gif" width="151" height="13" alt="">Laida: '.$icq.'</td>
   </tr>
   <tr>
      <td colspan="4" background="http://mantux94.xz.lt/radijui/images/radija_10.gif" width="151" height="35" alt=""></td>
   </tr>
   <tr>
      <td rowspan="2" background="http://mantux94.xz.lt/radijui/images/radija_11.gif" width="15" height="144" alt=""></td>
      <td colspan="2"><a href="http://JUSUIP:PORTAS/listen.pls"><img src="http://mantux94.xz.lt/radijui/images/radija_12.gif" width="118" height="109" alt=""></a></td>
      <td rowspan="2" background="images/radija_13.gif" width="18" height="144" alt=""></td>
   </tr>
   <tr>
      <td colspan="2" background="http://mantux94.xz.lt/radijui/images/radija_14.gif" width="118" height="35" alt=""></td>
   </tr>
   <tr>
      <td>
         <img src="http://mantux94.xz.lt/radijui/images/spacer.gif" width="23" height="1" alt=""></td>
      <td>
         <img src="http://mantux94.xz.lt/radijui/images/spacer.gif" width="1" height="1" alt=""></td>
      <td>
         <img src="http://mantux94.xz.lt/radijui/images/spacer.gif" width="15" height="1" alt=""></td>
      <td>
         <img src="http://mantux94.xz.lt/radijui/images/spacer.gif" width="41" height="1" alt=""></td>
      <td>
         <img src="http://mantux94.xz.lt/radijui/images/spacer.gif" width="77" height="1" alt=""></td>
      <td>
         <img src="http://mantux94.xz.lt/radijui/images/spacer.gif" width="18" height="1" alt=""></td>
      <td>
         <img src="http://mantux94.xz.lt/radijui/images/spacer.gif" width="18" height="1" alt=""></td>
   </tr>
</table>';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Šiuo metu radija yra išjungta.</font>';


}
closeside();



Redagavo Mantux94· 2009 Sau. 6 22:01:46