View Single Post
ישן 08-03-06, 17:20   # 1
lior_sh69
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 90

lior_sh69 לא מחובר  

צריך עזרה בקוד של "מי בשידור"...

יש לי קוד ואני לא יודע מה הבעיה....

PHP קוד:

include ("config.php");

if (
$scsuccs!=1) {
if(
$streamstatus == "1"){
if (isset(
$dj)) {
echo 
"<b>Listeners:</b> $currentlisteners&nbsp;&nbsp;&nbsp;<a href=\"http://$scip:$scport/listen.pls\">Click to listen!</a><br>
<b>Current Title</b>: $servertitle<br>
<b>Current Song:</b> $song[0]<br>
<b>Current DJ ID</b>: $dj<br>
<b>Current DJ</b>: $name<br>
"
;

if ((empty(
$aimdb)) && (isset($aim) && $aim) && ($aim != "N/A")) {
$aimdb $aim;
}

if ((empty(
$icqdb)) && (isset($icq) && $icq)) {
$icqdb $icq;
}

if (isset(
$aimdb) && $aimdb) {
echo 
"<b>AIM</b>: $aimdb<br>";
}

if (isset(
$msn) && $msn) {
echo 
"<b>MSN</b>: $msn<br>";
}

if (isset(
$yim) && $yim) {
echo 
"<b>YIM</b>: $yim<br>";
}

if (isset(
$icqdb) && $icqdb) {
echo 
"<b>ICQ</b>: $icqdb<br>";
}

if (isset(
$address) && $address) {
echo 
"<b>Song request page</b>: <a href=\"$address\">Link</a>";
}

if (
$showsetby == 1) {
echo 
"<br><br><b>This DJ was found by checking:</b> $setby";
}

} else {
echo 
"<b>A DJ is not currently signed on to the system. Please check again later.</b>";
}
} else {
echo 
"<b>A DJ is not currently connected to the radio. Please check again later.</b>";
}
} else {
echo 
"<b>The radio is currently down. Please check again later.</b>";



config


PHP קוד:

<?php


# Database
$dbhost "localhost";
$dbname "db";
$dbuser "radio";
$dbpass "1123";

# Shoutcast
$scdef "radio-ex";
$scip "127.0.0.1";
$scport "8000";
$scpass "1123";

# Admin Panel
$adminname "111";
$adminpass "111";


$version "1.8";

$filename "admin/install/index.php";

// Shoutcast Server Stats
$scfp = @fsockopen("$scip"$scport, &$errno, &$errstr10);
 if(!
$scfp) {
  
$scsuccs=1;
# echo'<strong>'.$scdef.' is Offline</strong><br>';
 
}
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($scfp1000);
 }
//define  xml elements
 
$loop = array("STREAMSTATUS""BITRATE""SERVERTITLE""CURRENTLISTENERS""AIM""ICQ");
 
$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 || $loop[$y]==AIM || $loop[$y]==ICQ)
   $
$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(
$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++;
 }
//end song info

fclose($scfp);
}

if (
file_exists($filename))  {
$nodb "1";
}

if (isset(
$nodb) == FALSE) {
include (
"dbconnect.php");
}

?>

הקוד מ- hotscripts
  Reply With Quote