here's the error I keep getting:
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in .../Themes/default/Dis开发者_Go百科play.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.
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.
精彩评论