Parse error :(

Ask questions, request features, or just complement us about our software and services.
Post Reply
Geoffrey
Posts: 4
Joined: Sun Mar 07, 2004 6:04 pm

Parse error :(

Post by Geoffrey »

Well, i have installed the radio tool box package ... then the catcher.php and it seems to have a slight problem.
When there is more than one server and the song include a ' ... i just get a parse error ... he doesn't seems to addslashes() to server2.
Any infos around ? :)

N.B: look at the second $server[2]['current_song']='NO DOUBT - Don't speak'; ... he doesn't add \ in front of 't speak

Code: Select all

<?php
$server[0]['ip']='www.gamearena-radio.com:8000';
$server[0]['type']='SHOUTcast';
$server[0]['listeners']='2';
$server[0]['max_listeners']='10';
$server[0]['bitrate']='128';
$server[0]['status']='Online';
$server[0]['desc']='GameArena-Radio -o- LA webradio des Gamers qui déchire le web -o- www.GameArena-Radio.com';
$server[0]['current_song']='NO DOUBT - Don\'t speak';
$server[1]['ip']='www.roxorgamers.com:8000';
$server[1]['type']='SHOUTcast';
$server[1]['listeners']='';
$server[1]['max_listeners']='';
$server[1]['bitrate']='';
$server[1]['status']='Offline (Connection Failed)';
$server[1]['desc']='';
$server[1]['current_song']='';
$server[2]['ip']='193.24.229.4:9020';
$server[2]['type']='SHOUTcast';
$server[2]['listeners']='2';
$server[2]['max_listeners']='100';
$server[2]['bitrate']='128';
$server[2]['status']='Online';
$server[2]['desc']='GameArena-Radio -o- LA webradio des Gamers qui déchire le web -o- www.GameArena-Radio.com';
$server[2]['current_song']='NO DOUBT - Don't speak';

$current_song='Précédemment: ZAZIE - Zen';
$listeners='4';
$max_listeners='110';
$touch_interval='30';
?>
User avatar
Jay
Will work for food (Administrator)
Posts: 3029
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

thanks for the report, I'll check into it.
- Jay
Geoffrey
Posts: 4
Joined: Sun Mar 07, 2004 6:04 pm

Post by Geoffrey »

Yep ... thanx you very much ... /me hopes a fast update :)
Geoffrey
Posts: 4
Joined: Sun Mar 07, 2004 6:04 pm

Post by Geoffrey »

Any news ? ... because it's just pissing me off :p
User avatar
Jay
Will work for food (Administrator)
Posts: 3029
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

am not able to reproduce. Make sure you are running the latest version of Radio Toolbox and use the catcher script packaged with it.
- Jay
clarkie
Posts: 1
Joined: Tue Sep 07, 2004 7:55 am

Post by clarkie »

I'm running into the exact same issue with songs that have "n't" in the title. I do have the latest version of RTB installed and used the catcher script that was included.
compwhiz212
Posts: 4
Joined: Thu Sep 30, 2004 9:58 pm
Location: Johnstown, PA
Contact:

Same Problem

Post by compwhiz212 »

Hey, I'm also having the same problem with my radio toolbox on m site. Every time there is a song played that contains a singe apostrophe, things go haywire. The only way it gets fixed is if I go in and manually edit the includes.php files manually. Hopefully he gets this fixed.
User avatar
gdradio
Posts: 132
Joined: Thu Jun 24, 2004 9:03 pm
Contact:

Post by gdradio »

I get the same reults with titles that have quotes in them

annoying, just a bit
Image
User avatar
Jay
Will work for food (Administrator)
Posts: 3029
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

ok, it must be an issue of magic quotes or something, I'll check into it again.
- Jay
compwhiz212
Posts: 4
Joined: Thu Sep 30, 2004 9:58 pm
Location: Johnstown, PA
Contact:

I Think I Might Have Fixed It...

Post by compwhiz212 »

Hey Jay, I think I might have found the problems:

Code: Select all


	for($i=0; $i<$list_size; $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";

			$rtb_array[$i][$server_vars[$j]] = $server[$i][$j];

		}

	}

	$data.="\r\n";

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

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

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

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

		$rtb_array['default'][$total_var_name[$j]] = $$total_var_var[$j];

	}
On the lines

Code: Select all

$rtb_array[$i][$server_vars[$j]] = $server[$i][$j];
and

Code: Select all


$rtb_array['default'][$total_var_name[$j]] = $$total_var_var[$j];

there needs to be the addslashes() function on the variables that the arrays are equal to. So it would look something like this:

Code: Select all

$rtb_array[$i][$server_vars[$j]] = addslashes($server[$i][$j]);
and

Code: Select all

$rtb_array['default'][$total_var_name[$j]] = addslashes($$total_var_var[$j]);
User avatar
Jay
Will work for food (Administrator)
Posts: 3029
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

ok can you guys uncheck send server details in the option panel and let me know if the parse error goes away?

Make sure you let Radio Toolbox touch a few times before testing your scripts.
- Jay
compwhiz212
Posts: 4
Joined: Thu Sep 30, 2004 9:58 pm
Location: Johnstown, PA
Contact:

same errors

Post by compwhiz212 »

still getting the same errors with or without the server details
User avatar
Jay
Will work for food (Administrator)
Posts: 3029
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

try updating your scripts with these files

http://www.radiotoolbox.com/downloads/r ... er_php.zip
- Jay
compwhiz212
Posts: 4
Joined: Thu Sep 30, 2004 9:58 pm
Location: Johnstown, PA
Contact:

Post by compwhiz212 »

hey thanks
User avatar
Jay
Will work for food (Administrator)
Posts: 3029
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

Radio Toolbox 1.1.0 is out so grab that too ;)
- Jay
Post Reply