tags:

views:

27

answers:

1

here's the error I keep getting:

Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in .../Themes/default/Display.template.php on line 170

Here's the code:

'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(Â¥'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . 'Â¥');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),

I've checked to see if all of the parentheses are closed and they seem to be. I'm not sure what to do.

+3  A: 

You've got unbalanced single quotes starting at the 'custom => 'onclick=... where you insert some PHP array variables into the javascript.

'notify' => array(
    'test' => 'can_mark_notify',
    'text' => 125,
    'image' => 'notify.gif',
    'lang' => true,
    'custom' => 'onclick="return confirm(Â¥'' . ($context['is_marked_notify'] ? 
                                         ^^^^^ right here
          $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . 'Â¥');"',
    'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),

As well, you should be very careful inserting what appears to be text into those onclick handlers. What if $txt['notification_disable_topic'] and the rest contain a single quote (e.g. "O'Brien"). You'll end up with a javascript syntax error.

Marc B
I know nothing about coding. How do I fix that? Sorry for the lack of understanding.
Phill
Oh there it goes. Thank you!
Phill
you must close that string Marc wrote at the beginning of his comment
Tomasz Kowalczyk