Status ....

Ask questions, request features, or just complement us about our software and services.
Post Reply
Kane
Posts: 13
Joined: Sat Jan 18, 2003 6:37 pm
Location: Keflavík - Iceland
Contact:

Status ....

Post by Kane »

I'm trying to use the $status command in my server to show if it's online or not, So I add $status in my now plying like so:

Code: Select all

My server is currently <?php echo $status; ?> and is now playing <?php echo $current_song; ?>
But it always returns like so: My server is currently and is now playing Sepultura - Polotricks ....

What to I need to do so $status works ?

I have found out that it has something to do with catcher.php and include.php so I changed my catcher.php to:

Code: Select all

Copyright RadioToolBox.com  another great application from Jay Krivanek<br>

<?php

include("config.php");


// If register globals is off, then we get are vars this way.
if (isset($_REQUEST)) {
    while(list($varname, $varvalue) = each($_REQUEST)) { $$varname = $varvalue; }
}
if (isset($_SERVER)) { 
    while (list($varname, $varvalue) = each($_ENV)) { $$varname = $varvalue; }
    while (list($varname, $varvalue) = each($_SERVER)) { $$varname = $varvalue; }
}


// Addslashes (if nessacary) and fix any characters (&,<,>,etc.) that may break stuff down the road.

for($i=0; $i<count($server); $i++){

	for($j=0; $j<count($server[$i]); $j++){

		if (!get_magic_quotes_gpc()){

			$server[$i][$j]=addslashes($server[$i][$j]);

		}

				$server[$i][$j]=htmlspecialchars($server[$i][$j], ENT_QUOTES);

	}

	$other_variables=array('status', 'tit', 'l', 'ml', 'ti');

	for($i=0; $i<count($other_variables); $i++){

		if (!get_magic_quotes_gpc()){

			$$other_variables[$i]=addslashes($$other_variables[$i]);

		}

		$$other_variables[$i]=htmlspecialchars($$other_variables[$i], ENT_QUOTES);

	}

}



// Verify that info is from trusted source.

if ($pass != $rtb_pass || $user != $rtb_user)

{

	echo 'BADPASSWORD';

	exit;

}

$mode='flat_file';

if($mode=="flat_file"){

	@include($includes_path."includes.php");

	$data="<?php\r\n";

	for($i=0; $i<count($server); $i++){

		$server_vars=array('ip', 'type', 'listeners', 'max_listeners', 'bitrate', 'status', 'desc', 'current_song');

		for($j=0; $j<count($server_vars); $j++){

			$data.="\$server[$i]['$server_vars[$j]']=";

			$data.='\''.$server[$i][$j].'\';';

			$data.="\r\n";

		}

	}

	$data.="\r\n";

	$total_var_name=array('status', 'current_song', 'listeners', 'max_listeners', 'touch_interval');

	$total_var_var=array('status', 'tit', 'l', 'ml', 'ti');

	for($j=0; $j<count($total_var_name); $j++){

		$data.="\$$total_var_name[$j]='${$total_var_var[$j]}';\r\n";

	}

	

	if(("$tit"==addslashes($lastsong[0])) || ($tit=='')){

		$offset=0;

		$lastsong_rep[0]=addslashes($lastsong[0]);

		$lasttime_rep[0]=$lasttime[0];

	}

	else{

		$offset=1;

		$lastsong_rep[-1]=$tit;

		$lasttime_rep[-1]=round(time()-$time_zone*3600);

	}

	for($j=0; $j<$song_history; $j++){

		$replace_num=$j-$offset;

		if($j>0){

			$lastsong_rep[$replace_num]=addslashes($lastsong[$replace_num]);

			$lasttime_rep[$replace_num]=$lasttime[$replace_num];

		}

		$data.="\$lastsong[$j]='$lastsong_rep[$replace_num]';\r\n\$lasttime[$j]='$lasttime_rep[$replace_num]';\r\n";



	}	

	

	$data.="?>";

	$fp = fopen($includes_path."includes.php", "w");

	fwrite($fp, $data);

	fclose($fp);

}





?>
and then my includes.php turns like this:

Code: Select all

<?php

$server[0]['ip']='212.30.203.201:8000';

$server[0]['type']='SHOUTcast';

$server[0]['listeners']='0';

$server[0]['max_listeners']='16';

$server[0]['bitrate']='56';

$server[0]['status']='Online';

$server[0]['desc']='Radio Danni';

$server[0]['current_song']='Cannibal Corpse - Sanded Faceless';



$status='';

$current_song='Cannibal Corpse - Sanded Faceless';

$listeners='0';

$max_listeners='16';

$touch_interval='30';

$lastsong[0]='Cannibal Corpse - Sanded Faceless';

$lasttime[0]='1045931995';

$lastsong[1]='Sepultura - Ratamahatta   Kaiowas';

$lasttime[1]='1045931695';

$lastsong[2]='Megadeth - Psychotron';

$lasttime[2]='1045931605';

$lastsong[3]='Cradle Of Filth - Of Mist And Midnight Skies';

$lasttime[3]='1045931515';

$lastsong[4]='System of a Down - Defy You';

$lasttime[4]='1045931365';

$lastsong[5]='Korn - Blame';

$lasttime[5]='1045931305';

$lastsong[6]='Sepultura                      - Escape to the void';

$lasttime[6]='1045931245';

$lastsong[7]='Audioslave - Cochise';

$lasttime[7]='1045931095';

$lastsong[8]='In Flames - Free Fall';

$lasttime[8]='1045931004';

$lastsong[9]='Cannibal Corpse - Hatchet To The Head';

$lasttime[9]='1044827183';

$lastsong[10]='Megadeth - Coundown To Extinction';

$lasttime[10]='1044826910';

$lastsong[11]='Megadeth - Architecture Of Agression';

$lasttime[11]='1044826700';

$lastsong[12]='Cannibal Corpse - Grotesque';

$lasttime[12]='1044826490';

$lastsong[13]='Metallica - Devil\\'s Dance (S&M)';

$lasttime[13]='1044826463';

$lastsong[14]='Metallica - Devil\\'s Dance (S&M)';

$lasttime[14]='1044826460';

$lastsong[15]='Metallica - Devil\\'s Dance (S&M)';

$lasttime[15]='1044826433';

$lastsong[16]='Metallica - Devil\\'s Dance (S&M)';

$lasttime[16]='1044826430';

$lastsong[17]='Metallica - Devil\\'s Dance (S&M)';

$lasttime[17]='1044826403';

$lastsong[18]='Metallica - Devil\\'s Dance (S&M)';

$lasttime[18]='1044826400';

$lastsong[19]='Metallica - Devil\\'s Dance (S&M)';

$lasttime[19]='1044826373';

?>
Now, what to do ?!?!?
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

beta 4 does not support server status in the script url, it's going to be in the final version.
- Jay
Kane
Posts: 13
Joined: Sat Jan 18, 2003 6:37 pm
Location: Keflavík - Iceland
Contact:

Post by Kane »

And now I Can't wait for the final version :) Any predictions for when it comes ?
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

soon, very soon
- Jay
Post Reply