Help fixing PHP error in PhpBB

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
I recently installed the "simple credits" MOD onto my forum.
It went wrong.
The backup is corrupt.
It's an old version, so I can't get support on PhpBB.com. The reason for this is because the new one doesn't have a donate function.

I get the following errors:

When I go into a profile I get the error:
Parse error: syntax error, unexpected $end in /home/alexmac/public_html/forum/includes/template.php(175) : eval()'d code on line 222

Also when a member posts they don't get credits. The MOD is meant to give them the credits.
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
A) Do you have Version 2 of PHP?
B) Try searching for "$end" on line 175 of template.php
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
A) Do you have Version 2 of PHP?

Yes. It was working fine before.

B) Try searching for "$end" on line 175 of template.php

Not there, but the eval is:

Code:
eval(' ?>' . $this->compiled_code[$handle] . '<?php ');
 

clyde4210

New Member
Messages
7
Reaction score
0
Points
0
what is the exact name of the mod (it's not simple credits)? where did you get it?
 
Last edited:

woiwky

New Member
Messages
390
Reaction score
0
Points
0
PHP doesn't name variables in an error, it would say something like 'unexpected T_VARIABLE' in that case. $end refers to the end of the script, and unfortunately it can be hard to find the cause of this error. Most likely you have an open code block which isn't closed somewhere. If you could post the entire script, that'd be most helpful.
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Simple Points System 0.4.0c

No longer available unless you look very hard. I'll email it to anyone who wants it.

woiwky:

I have never edited /includes/template.php
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
Yeah, it's coming back to me now -- my hate for phpbb that is :p

I found the mod pretty easily actually, it was like the 6th or 7th down on google.

Anyway, I believe the problem is being caused by phpbb's rather unstable template system. It could be the template for the donate part, or perhaps this mod is interfering with another. I'm not an expert with phpbb, though, as I only worked with it once about 2 years ago.

My advice would be to try removing the <!-- BEGIN ... --> and <!-- END ... -->'s from the donate template since I don't think they're being used. The only appearance of them I saw in the php code was in the donate.php script in /root:

Line 47:
$template->assign_block_vars('administer_points', array());

Line 96:
$template->assign_block_vars('donate_points', array());

It looks like they're declared as loops but with nothing inside them. You may also want to delete those lines once you remove the BEGIN and END's.

If that doesn't solve it then you can try bringing it up in Scripts & 3rd Party Apps to see if someone with more phpbb experience can help you. You may also be able to get help from the phpbb forums since I think this is more of a problem involving the template system rather than the mod.
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
No, that's just mucked up the donate/edit points function
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
No, that's just mucked up the donate/edit points function

Well, in that case try leaving in the BEGIN and END's and deleting the $template->assign_block_var()'s. Then change the code starting on line 77 to:

PHP:
$template->assign_block_vars('administer_points', array(
    "USER_NAME"        => get_username_string('full', $u_id, $user_points['username'], $user_points['user_colour']),
    "USER_POINTS"        => $user_points['user_points'],
    "POINTS"        => $config['points_name'],
    "U_USER_LINK"        => append_sid("{$phpbb_root_path}memberlist.".$phpEx."?mode=viewprofile&amp;u=".$u_id),
    "L_POINTS_MODIFY"    => sprintf($user->lang['POINTS_MODIFY'], $config['points_name']),
    "L_MOD_POINTS_TITLE"    => sprintf($user->lang['DONATE_POINTS_TITLE'], $config['points_name']),
    "L_USERNAME"        => $user->lang['USERNAME'],
    "L_SET_AMOUNT"        => $user->lang['NEW_AMOUNT'],
    "S_ACTION"        => append_sid("{$phpbb_root_path}donate.".$phpEx."?adm_points=1"),
    "S_HIDDEN_FIELDS"    => $hidden_fields,
));

and the code on line 157 to:

PHP:
$template->assign_block_vars('donate_points', array(
    "USER_NAME"        => get_username_string('full', $u_id, $user_points['username'], $user_points['user_colour']),
    "USER_POINTS"        => $user_points['user_points'],
    "POINTS"        => $config['points_name'],
    "YOUR_POINTS"        => $user->data['user_points'],
    "U_USER_LINK"        => append_sid("{$phpbb_root_path}memberlist.".$phpEx."?mode=viewprofile&amp;u=".$u_id),
    "L_POINTS_DONATE"    => sprintf($user->lang['POINTS_DONATE'], $config['points_name']),
    "L_MOD_POINTS_TITLE"    => sprintf($user->lang['MOD_POINTS_TITLE'], $config['points_name']),
    "L_USERNAME"        => $user->lang['USERNAME'],
    "L_YOUR_POINTS"        => $user->lang['YOUR_POINTS'],
    "L_AMOUNT_TO_DONATE"    => $user->lang['AMOUNT_TO_DONATE'],
    "S_ACTION"        => append_sid("{$phpbb_root_path}donate.".$phpEx."?mode="),
    "S_HIDDEN_FIELDS"    => $hidden_fields,
));

If that doesn't work then I'm not sure what it could be. You'll either have to try to get help on phpbb's forums or download the newer version of the mod and add in the donate function, which shouldn't be too hard.
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
I have an idea.
Reverse all steps you did before and save a backup.
Then try it again.
That is all my advice. :)
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Parse error: syntax error, unexpected ';', expecting T_PAAMAYIM_NEKUDOTAYIM in /home/alexmac/public_html/forum/donate.php on line 76

Thanks for your help, I'll try the PhpBB forums.

Didn't notice: DeadBattery:

Yeah, I'll try that first. Thanks.
Edit:
I am now annoyed. I discovered why it wasn't working: I got to the very last stage of uninstalling it: deleting the uploaded files. Where is language/en/mods/donate.php...?

I'm glad I backed it up before I uninstalled it all :)
 
Last edited by a moderator:
Top