Помогите пожалуйста, есть 2 файла php.
1й - Файл конфигурации
<?php
//Configuration
$scdef = "Имя радио";
$scip = "85.234.7.112";
$scport = "8000";
$scpass = "vash parol";
//End configuration
?>
2й - Сам файл мониторинга shoutcast
<?php
function unhtmlentities($string)
{
$trans_tbl=array();
for($i=32;$i<=255;$i++)
$trans_tbl['&#x'.strtoupper(dechex($i)).';']=chr($i);
return strtr($string, $trans_tbl);
}
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// hardcore coded by daniel brown aka xbrowniex
include('rconfig.php'); //you may edit this path to fit your server environment otherwise leave it alone
$scfp = @fsockopen("$scip", $scport, &$errno, &$errstr, 10);
if(!$scfp) {
$scsuccs=1;
// echo''.$scdef.' est hors ligne. Consultez le programme';
echo'';
}
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", "MAXLISTENERS");
$y=0;
while($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)
$$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($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] = unhtmlentities($song[$t]);
$dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
//end song info
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo'
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="refresh" content="60; url=radiocheb.php">
<title>'.$scdef.'</title>
</head>
<body bottommargin="0" rightmargin="0" leftmargin="0" topmargin="0" bgcolor=#ffffff text="#000000">
<font size="2">Состояние:</font><font size="2"> <font color="#00FF00"><b>On-line</b></font><br>
Слушателей: <b><font color="#000000">'.$currentlisteners.'</font></b><br>
Битрейт: <b><font color="#000000">'.$bitrate.'</font> кБит/сек</b><br>
Сейчас играет:</b><br>
</font>
<center><font size="2"><marquee scrolldelay=20 scrollamount=1 truespeed width=100%><font color=#00FF00 style="font-size:12px;font-family: tahoma;"><b><font color=#000000>'.$song[0].'</font></b></font></marquee><br>
</font>
<b><a href="http://mycheb.com/radio.html" target="_blank"><span style="text-decoration: none; font-weight:700">
<font size="2" color="000000">(((Слушать)))</font></span></a></center></b>
</body>
</html>';
}
else
{
echo'<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="refresh" content="60; url=radiocheb.php">
<title>Off</title>
</head>
<body bottommargin="0" rightmargin="0" leftmargin="0" topmargin="0" bgcolor=#ffffff text="#000000">
<font size="2">Состояние:</font></b><font size="2"> <font color="red"><b><span lang="en-us">Off-line</span></b></font><br>
Мест:</b> <b><font color="#000000">0</font></b><br>
Битрейт: <b><font color="#000000">0</font></b><br>
Сейчас играет:
</font>
<center><font size="2"><marquee scrolldelay=20 scrollamount=1 truespeed width=100%><font color=#00FF00 style="font-size:12px;font-family: tahoma;"><b><font color=#000000>Станция отключена</font></b></font></marquee><br>
</font>
<b><font size="2" color="#000000">Слушать</font></center></b>
</body>
</html>';}
?>
Как это вставить в блок?В дле это было все просто {include file='.../radio.php'} , а тут так прокатит?
Добавлено через 4 минут, 32 секунд:Извиняюсь, но уже сам разобрался =)