Parašė namo· 2009 Lie. 14 18:07:55
#1
Sveiki, turiu radijos eterio panele, ja dedu i .php failiuka, ir keliu i saita per iframe.
Kaip man padaryti, kad foto rodytu kaireje, o visa eterio info butu desineje, kaip cia:
www.ertin.lt
kodas:
<?php
error_reporting(0);
$scdef = "Vykdomi serverio atnaujinimai"; // Default station name to display when server or stream is down
$scip = "IP"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = "8010"; // port of shoutcast server
$scpass = "PASS"; // password to shoutcast server
$maxusers = "100"; //Kiek vienu sykiu klausosi zmoniu
$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.' ';
}
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);
}
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "AIM", "ICQ");
$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] == "AIM"))
$$scphp = urldecode($$scphp);
// uncomment the next line to see all variables
// echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
//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));
fclose($scfp);
}
///display stats
if($streamstatus == "1"){
switch ($aim) {
case 'NA': $aimlogo = "NA"; break;
case 'Auto DJ': $aimlogo = "Auto DJ"; break;
case 'DJ Gabana': $aimlogo = "DJ Gabana"; break;
case 'DJ A.D.T': $aimlogo = "DJ A.D.T"; break;
case 'Dzekis': $aimlogo = "Dzekis"; break;
case 'Fanatikas': $aimlogo = "Fanatikas"; break;
case 'Auto DJ': $aimlogo = "Auto DJ"; break;
default: $aimlogo = "aimas";
}
$_SESSION['djus'] = $aim;
echo'<div align="left">
<table cellpadding="0" cellspacing="0" width="1">
<!-- MSTa*keiksmai*ype="nolayout" -->
<tr>
<td height="36" bgcolor="">
<p align="center">
<a href="http://betafm.xz.lt/infusions/suggestion_box/suggestion_box.php"><img border="0" src="http://betafm.xz.lt/images/'.$aim.'.jpg" width="160" heigth="70"></a></td>
</tr>
<tr>
<td height="17" valign="bottom">
<div align="center">
<table cellpadding="0" cellspacing="0" width="130">
<tr>
<td height='17'>
<p align='center'>
<font face='Tahoma' style='font-size: 8pt' color='#000000'><b>Laida:</b></font>
<font face='Tahoma' style='font-size: 8pt' color='#000000'>".$icq."</font><br>
<font face='Tahoma' style='font-size: 8pt' color='#000000'><b>Eteryje:</b></font>
<font face='Tahoma' style='font-size: 8pt' color='#000000'>".$aim."</font>
</p>
</td>
</tr>
<tr>
<td height='17'>
<p align='center'>
<marquee behavior='right'> <font face='Arial' style='font-size: 8pt' color='#000000'>".$daina."</font></marquee>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>\n";
}
if($streamstatus == "0"){
echo "<table cellpadding='0' cellspacing='0' align='center><tr><td><font size='2' face='tahoma' color='#000000'>Technine profilaktika.</font></td></tr></table>";
}
$pavadinimas = ""; //pavadinimas
echo " <center><b>".$pavadinimas."</b>
<font size='1'><center>Club Hit Radio</center></font>
<a href='http://shoutcast.volna.lt:8050/listen.pls'><img src='".THEME."images/klausykis.jpg' border=0' alt='Winamp' /></a><br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
</table>\n";
closeside_panel();
?>
Kas pades, tam +10 ;)