Gal zinot kaip iterpti i paneles toki koda:
<?php
error_reporting(0);
$scdef = "Radijas perkraunamas,ruosiamas tvarkarastis."; // Kai serveris isjungtas rodo
$scip = "..."; // shoutcast serverio IP be porto
$scport = "8020"; // shoutcast serverio portas
$scpass = "..."; // shoutcast serverio pasvordas
$maxusers = "50"; //Kiek vienu sykiu klausosi zmoniu
//End configuration
error_reporting(0);
$scsuccs = NULL;
$page = NULL;
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 01);
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);
}
#############Pagamino Dj_Dede, www.upofm.wu.lt##...
#####################konfiguracija 01#####################
$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] == "AIM"))
$$scphp = urldecode($$scphp);
// echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
#####################///konfiguracija 02#####################
$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++;
}
$Grojo = str_replace('_',' ',substr ($song[1],0,200));
$Grojo2 = str_replace('_',' ',substr ($song[2],0,200));
$Grojo3 = str_replace('_',' ',substr ($song[3],0,200));
$Grojo4 = str_replace('_',' ',substr ($song[4],0,200));
$Grojo5 = str_replace('_',' ',substr ($song[5],0,200));
//end song info
fclose($scfp);
}
#####################//Muzikos rikevimas#####################
if($streamstatus == "1"){
$_SESSION['songtitle'] = $song;
echo'<div align="left">
<table cellpadding="0" cellspacing="0" width="1">
<!-- MSTaašype="nolayout" -->
<font face="Tahoma" style="font-size: 8pt" color="#fffff"><b>1.</b></font><b>
<font face="Tahoma" style="font-size: 8pt" color="#ffffff">'.$Grojo.'</font></td>
<br>
<font face="Tahoma" style="font-size: 8pt" color="#ffffff"><b>2.</b></font><b>
<font face="Tahoma" style="font-size: 8pt" color="#ffffff">'.$Grojo2.'</font></td>
<br>
<font face="Tahoma" style="font-size: 8pt" color="#fffff"><b>3.</b></font><b>
<font face="Tahoma" style="font-size: 8pt" color="#ffffff">'.$Grojo3.'</font></td>
<br>
<font face="Tahoma" style="font-size: 8pt" color="#ffffff"><b>4.</b></font><b>
<font face="Tahoma" style="font-size: 8pt" color="#ffffff">'.$Grojo4.'</font></td>
<br>
<font face="Tahoma" style="font-size: 8pt" color="#fffff"><b>5.</b></font><b>
<font face="Tahoma" style="font-size: 8pt" color="#ffffff">'.$Grojo5.'</font></td>
</table>';
}
?>
Plz padekit :D nelabai su tais iterptimais pas mane
Www.Degradacija.Lt - Naujas požiūris į demotyvaciją
Redagavo FanatiC 2009 Vas. 28 13:02:54 |