|
v7 Radija. Help!
|
| Tommy_ |
parašyta 2010-11-02 18:09
|
Naujokas

Reputacija:
0
Pranešimai: 3
Įstojo: 2010-11-02
|
Kad ir ka bandau, niekaip negaliu padaryti kad rodytu kad radija online ir kad kas groja. Visada "serveris isjungtas" Kaip pataisyti? Beja, prasau, nekalbekitaukstom frazem ;D as naujas php :D
Code
error_reporting(0);
$scdef = \"Radijas neveikia\"; // Default station name to display when server or stream is down
$scip = \"83.142.230.165\"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = \"28754\"; // port of shoutcast server
$scpass = \"nesakysiu xD\"; // password to shoutcast server
$maxusers = \"100\"; //Kiek vienu sykiu klausosi zmoniu
//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(!$scip) {
$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);
cia visas kodas. Beja, include('config_radio.php'); nezinau ar jis butinas (aplomai tokio nera pas mane beroc :/)
Redagavo Tommy_ 2010-11-02 18:10 |
| |
|
|
| gipsy |
parašyta 2010-11-02 19:26
|

Moderatorius

Reputacija:
0
Pranešimai: 585
Įstojo: 2009-10-21
|
ipo taip neplatink :] |
| |
|
|
| Tommy_ |
parašyta 2010-11-03 14:46
|
Naujokas

Reputacija:
0
Pranešimai: 3
Įstojo: 2010-11-02
|
ipas ne mano. intike radau kur galima nemokama shoutcast serva gaut. tai cia to servo IP, ne mano |
| |
|
|
| Sauliuksss |
parašyta 2010-11-03 14:49
|
Naujokas

Reputacija:
0
Pranešimai: 3
Įstojo: 2009-10-04
|
Tredalis normalaus kodo ia tik .... Ir nori, kad veikt ... |
| |
|
|
| Tommy_ |
parašyta 2010-11-03 14:50
|
Naujokas

Reputacija:
0
Pranešimai: 3
Įstojo: 2010-11-02
|
tai cia ne visas :D ne visa kopinau |
| |
|
|
| Sauliuksss |
parašyta 2010-11-03 14:50
|
Naujokas

Reputacija:
0
Pranešimai: 3
Įstojo: 2009-10-04
|
Pana?iai tai turt atrodyti:
Codeopenside(\"Radijas\");
$scip=\"xxx.xxx.xxx.xxx\";
$scport=\"8002\";
$scpass=\"xxxxxx\";
//$ip=\"$s\"; //localhost
$scfp = fsockopen($scip, $scport);
//$scfp = fsockopen(\"$scip\", $scport, &$errno, &$errstr, 30);
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\", \"CURRENTLISTENERS\");
$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)
$$scphp = urldecode($$scphp);
// $servert[$y] = ereg_replace(\".*\", \"\", $servert[$y]);
// $servert[$y] = ereg_replace(\".*\", \"\", $servert[$y]);
// uncomment the next line to see all variables
// echo'$'.$scphp.' = '.$$scphp.' ';
$y++;
}
//end intro xml elements
######################################################################################################################
######################################################################################################################
/////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//get song info and history
$pageed = ereg_replace(\".*\", \"\", $page);
$pageed = ereg_replace(\".*\", \"\", $pageed);
$songatime = explode(\"\", $pageed);
$pageed = ereg_replace(\".*\", \"\", $page);
$pageed = ereg_replace(\".*\", \"\", $pageed);
$servert = explode(\"\", $pageed);
$r=1;
while($songatime[$r]!=\"\"){
$t=$r-1;
$playedat[$t] = ereg_replace(\".*\", \"\", $songatime[$r]);
$playedat[$t] = ereg_replace(\".*\", \"\", $playedat[$t]);
$song[$t] = ereg_replace(\".*\", \"\", $songatime[$r]);
$song[$t] = ereg_replace(\".*\", \"\", $song[$t]);
$song[$t] = urldecode($song[$t]);
$r++;
}
//end song info
// $obisk = explode(\"\", $obisk);
fclose($scfp);
}
//display stats
if($streamstatus == \"1\"){
//you may edit the html below, make sure to keep variable intact
echo\"
Daina:
Eteryje: $servert[0]
Klausytoju: $currentlisteners
Bit Reitas $bitrate kbps
>>> Klausyk <<<
> Prasyk Dainos <
|
\";
}
closeside();
?>
|
| |
|
|
| gipsy |
parašyta 2010-11-05 08:11
|

Moderatorius

Reputacija:
0
Pranešimai: 585
Įstojo: 2009-10-21
|
tai gal tas nemokamss shaucastas neduoda info? gal kai nemokamas tai ir jokiu navaratu? |
| |
|