Welcome to WebmasterWorld Guest from 54.227.214.52

Forum Moderators: coopster & jatar k

[Urgent] Parse Error

Shoutbox causing sporadic errors

   
9:22 pm on Feb 21, 2006 (gmt 0)

5+ Year Member



Hi, I am new at this whole php & phpbb thing. I have PhpBB 2.x for my board (forums) and last night I tried to install a shoutbox mod...

My admin panel has an error on the left side of it (where the feature list goes)... the error is below:

Parse error: parse error, unexpected T_VARIABLE in /home/vigilant/public_html/board/admin/admin_db_utilities.php on line 702

Here is line 702 in admin/admin_db_utilities.php:

$additional_tables = (isset($HTTP_POST_VARS['additional_tables']))? $HTTP_POST_VARS['additional_tables'] : ( (isset($HTTP_GET_VARS['additional_tables']))? $HTTP_GET_VARS['additional_tables'] : "" );$backup_type = (isset($HTTP_POST_VARS['backup_type']))? $HTTP_POST_VARS['backup_type'] : ( (isset($HTTP_GET_VARS['backup_type']))? $HTTP_GET_VARS['backup_type'] : "" );

Any ideas on how to fix this?

Any help appreciated and needed ASAP!

Thanks.

9:52 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It looks to me like you have too many parentheses. I marked them in red. Try removing them.

$additional_tables = (isset($HTTP_POST_VARS['additional_tables']))? $HTTP_POST_VARS['additional_tables'] : ( (isset($HTTP_GET_VARS['additional_tables']))? $HTTP_GET_VARS['additional_tables'] : "" );

$backup_type = (isset($HTTP_POST_VARS['backup_type']))? $HTTP_POST_VARS['backup_type'] : ( (isset($HTTP_GET_VARS['backup_type']))? $HTTP_GET_VARS['backup_type'] : "" );

10:01 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I prefer an approach like below myself. It's easier to understand.

if ( isset($HTTP_POST_VARS['additional_tables']) )
{
$additional_tables = $HTTP_POST_VARS['additional_tables'];
} elseif ( $HTTP_GET_VARS['additional_tables'] ) {
$additional_tables = $HTTP_GET_VARS['additional_tables']
} else {
$additional_tables = '';
}

Also, I found another mistake while reformatting the code. You(or they?) start out using all single quotes to around strings, then switch to doubles at the very end. That could very well be your error.

Notice the doubles below:

$additional_tables = (isset($HTTP_POST_VARS['additional_tables']))? $HTTP_POST_VARS['additional_tables'] : ( (isset($HTTP_GET_VARS['additional_tables']))? $HTTP_GET_VARS['additional_tables'] : "" );$backup_type = (isset($HTTP_POST_VARS['backup_type']))? $HTTP_POST_VARS['backup_type'] : ( (isset($HTTP_GET_VARS['backup_type']))? $HTTP_GET_VARS['backup_type'] : "" );

10:21 pm on Feb 21, 2006 (gmt 0)

5+ Year Member



When I replaced line 702 with your revised one (top code of your 2nd post or post #3 in here), the error becomes:

Parse error: parse error, unexpected T_IF in /home/vigilant/public_html/board/admin/admin_db_utilities.php on line 702

Should I have not replaced it with that code?

I'm a bit lost!

10:28 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



maybe look at the line above and see if it is missing anything

what happens with some of these parse errors is a mismatch of () or {} or even a missing ; causes the error to be reported farther down in the code.

It's what we call 'trickle down'. It may even have occured much farther up. Do you have a copy of the file before you added the mod? You could compare the 2 and see where the changes are.

10:33 pm on Feb 21, 2006 (gmt 0)

5+ Year Member



Unfortunately I don't... I'll send lines 696 through 706 of admin/admin_db_utilities.php --- here they are below:

$tables = array(
'auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm');
// Start add - Fully integrated shoutbox MOD
$tables[] = 'shout'
// End add - Fully integrated shoutbox MOD

$additional_tables = (isset($HTTP_POST_VARS['additional_tables']))? $HTTP_POST_VARS['additional_tables'] : ( (isset($HTTP_GET_VARS['additional_tables']))? $HTTP_GET_VARS['additional_tables'] : "" );$backup_type = (isset($HTTP_POST_VARS['backup_type']))? $HTTP_POST_VARS['backup_type'] : ( (isset($HTTP_GET_VARS['backup_type']))? $HTTP_GET_VARS['backup_type'] : "" );

$gzipcompress = (!empty($HTTP_POST_VARS['gzipcompress']))? $HTTP_POST_VARS['gzipcompress'] : ( (!empty($HTTP_GET_VARS['gzipcompress']))? $HTTP_GET_VARS['gzipcompress'] : 0 );

$drop = (!empty($HTTP_POST_VARS['drop']))? intval($HTTP_POST_VARS['drop']) : ( (!empty($HTTP_GET_VARS['drop']))? intval($HTTP_GET_VARS['drop']) : 0 );

Any idea on how to get the following error fixed?...

Parse error: parse error, unexpected T_VARIABLE in /home/vigilant/public_html/board/admin/admin_db_utilities.php on line 702

Remember, this error appears in the left side of my phpBB 2.x admin panel.

Help appreciated-- thanks.

10:34 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



$tables[] = 'shout'

that line is missing the ; should be

$tables[] = 'shout';

10:35 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oooops! My bad! I left a semicolon out.

if ( isset($HTTP_POST_VARS['additional_tables']) )
{
$additional_tables = $HTTP_POST_VARS['additional_tables'];
} elseif ( $HTTP_GET_VARS['additional_tables'] ) {
$additional_tables = $HTTP_GET_VARS['additional_tables'];
} else {
$additional_tables = '';
}

10:36 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



just as future reference as well

whenever installing mods

keep copies of all changed files before you change anything
always look at the code you added for the mod before anything else

I am guessing that is added code since it says

// Start add - Fully integrated shoutbox MOD
// End add - Fully integrated shoutbox MOD

;)

10:56 pm on Feb 21, 2006 (gmt 0)

5+ Year Member



Sorry guys... but both of your suggestions give new errors!

Thanks!

Details:

Birdman's recent suggestion gives me this error (same place I'm receiving the error for both of your suggestions):

Parse error: parse error, unexpected T_IF in /home/vigilant/public_html/board/admin/admin_db_utilities.php on line 702

jatar_k's suggestion with the ';' gives me this:

Parse error: parse error, unexpected T_DOUBLE_ARROW, expecting ')' in /home/vigilant/public_html/board/admin/admin_board.php on line 200

I'm convinced that jatar_k's suggestion gets me out of the trouble with admin_db_utilities... and moves me on to the other file errors...

What a mess I am in!

11:01 pm on Feb 21, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



try using both together then

add the ; first, which gives you the second error

then replace line 702 with Birdman's code and that might help

11:44 pm on Feb 21, 2006 (gmt 0)

5+ Year Member



Thanks for the help guys, it worked...

But now I face this error...

Parse error: parse error, unexpected T_DOUBLE_ARROW, expecting ')' in /home/vigilant/public_html/board/admin/admin_board.php on line 200

admin/admin_board.php below --- lines 198 through 204:

"L_ENABLE_GZIP" => $lang['Enable_gzip'],
"L_ENABLE_PRUNE" =>// Start add - Fully integrated shoutbox MOD
' L_PRUNE_SHOUTS' => $$lang['Prune_shouts ' ];
' L_PRUNE_SHOUTS_EXPLAIN' => $$lang['Prune_shouts_explain ' ],
// End add - Fully integrated shoutbox MOD
$$lang['Enable_prune ' ],
"L_ALLOW_HTML" => $lang['Allow_HTML'],

Hint: Line 200 is ' L_PRUNE_SHOUTS' => $$lang['Prune_shouts ' ];

Any ideas on how to get me out of this mess?

Thanks!

12:27 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It looks like something got cut from the previous line:

"L_ENABLE_PRUNE" => 'here', //Start add - Fully integrated shoutbox MOD

12:36 am on Feb 22, 2006 (gmt 0)

5+ Year Member



By 'here', should I add that exact word or was it an example... if it was an example, I do not know what to add to it...
1:55 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



looks like a bad paste

"L_ENABLE_PRUNE" =>// Start add - Fully integrated shoutbox MOD
' L_PRUNE_SHOUTS' => $$lang['Prune_shouts ' ];
' L_PRUNE_SHOUTS_EXPLAIN' => $$lang['Prune_shouts_explain ' ],
// End add - Fully integrated shoutbox MOD
$$lang['Enable_prune ' ],
"L_ALLOW_HTML" => $lang['Allow_HTML'],

you seem to have pasted it in between a statement, the above should be

"L_ENABLE_PRUNE" =>$$lang['Enable_prune'],
// Start add - Fully integrated shoutbox MOD
' L_PRUNE_SHOUTS' => $$lang['Prune_shouts'];
' L_PRUNE_SHOUTS_EXPLAIN' => $$lang['Prune_shouts_explain'],
// End add - Fully integrated shoutbox MOD
"L_ALLOW_HTML" => $lang['Allow_HTML'],

are you sure those are supposed to $$ and not a single $

3:14 am on Feb 22, 2006 (gmt 0)

5+ Year Member



That gives me this:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/vigilant/public_html/board/admin/admin_board.php on line 202

Any idea what that means?

3:21 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



seems they have another error in there

'L_PRUNE_SHOUTS' => $$lang['Prune_shouts'];

shouldn;t have a ; ahould be a , like so

'L_PRUNE_SHOUTS' => $$lang['Prune_shouts'],

4:40 am on Feb 22, 2006 (gmt 0)

5+ Year Member



No more errors! Thanks guys!

The problem I face now is:

I have no shoutbox!

Maybe it is somewhere, hiding from me...

6:11 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



rflmao

that's the funniest post I have read in a while

well, I can only suggest to walk through the installation instructions to see if anything was missed. Don't change anything, just look.

another thing, I don't think these are supposed to be $$ they should probably be single $

"L_ENABLE_PRUNE" =>$$lang['Enable_prune'],
// Start add - Fully integrated shoutbox MOD
' L_PRUNE_SHOUTS' => $$lang['Prune_shouts'];
' L_PRUNE_SHOUTS_EXPLAIN' => $$lang['Prune_shouts_explain'],
// End add - Fully integrated shoutbox MOD
"L_ALLOW_HTML" => $lang['Allow_HTML'],

also, look under the bed, I find all kinds of things there ;)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month