Pagina 1 van 1
Parse error ?!
Geplaatst: 22 dec 2004, 21:04
door abcde
Beste phpBB-leden,
Ik krijg steeds parse errors in viewtopic.php, steeds een "unexpected" karakter of T_VARIABLE.
De fout zit rond lijn nummer 798:
}
elseif ( ($vote_percent > 0.3) && ($vote_percent <= 0.6) ){
$vote_color = 'blue';
}
elseif ( $vote_percent > 0.6 ){
$vote_color = 'red';
}
$template->assign_block_vars("poll_option", array(
'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'],
'POLL_OPTION_RESULT' => $vote_info[$i]['vote_result'],
'POLL_OPTION_PERCENT' => sprintf("%.1d%%", ($vote_percent * 100)),
'POLL_OPTION_COLOR' => $vote_color,
'POLL_OPTION_IMG' >= $vote_graphic_img,
'POLL_OPTION_IMG_WIDTH' >= $vote_graphic_length
)
}
$template->assign_vars(array(
'L_TOTAL_VOTES' => $lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum
)
else
{
$template->set_filenames(array(
'pollbox' => 'viewtopic_poll_ballot.tpl')
);
Bij het dikgedrukte, waar ik dus het bovenstaande moet afsluiten gaat het steeds mis, als ik er een ; of een { of een } is het gelijk een parse error, maar dat haakje weghalen veroorzaakt ook een fout.
Wat moet ik ermee?
Alvast Bedankt :thumb:,
abcde
Geplaatst: 22 dec 2004, 21:09
door Luuk
Achter het ) moet nog );.
De eerste ) sluit array( af en de tweede set_filenames(.
Geplaatst: 22 dec 2004, 21:45
door abcde
Oke dank je, voor je snelle reactie (en goede) het heeft een klein beetje geholpen maar ik loop een regel eronder weer vast:
$template->assign_block_vars("poll_option", array(
'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'],
'POLL_OPTION_RESULT' => $vote_info[$i]['vote_result'],
'POLL_OPTION_PERCENT' => sprintf("%.1d%%", ($vote_percent * 100)),
'POLL_OPTION_COLOR' => $vote_color,
'POLL_OPTION_IMG' >= $vote_graphic_img,
'POLL_OPTION_IMG_WIDTH' >= $vote_graphic_length
));
$template->assign_vars(array(
'L_TOTAL_VOTES' => $lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum
));
else
{
$template->set_filenames(array(
'pollbox' => 'viewtopic_poll_ballot.tpl')
);
for($i = 0; $i < $vote_options; $i++)
{
if ( count($orig_word) )
{
$vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']);
}
$template->assign_block_vars("poll_option", array(
'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'],
'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'])
);
}
Ik krijg nu namelijk een unexepted T_ELSE. Wat moet ik met dit?
Geplaatst: 22 dec 2004, 21:48
door Luuk
Nu nog een } eronder om de if af te sluiten.
Geplaatst: 22 dec 2004, 21:52
door abcde
Dan krijg ik weer de zelfde unexpected T_ELSE alleen een regel lager.
Geplaatst: 22 dec 2004, 21:57
door Luuk
Plaats eens het stuk wat daarboven staat (aantal regels).
Geplaatst: 22 dec 2004, 22:00
door abcde
Oke, regel 776 tot en met 825:
if ( $vote_percent <= 0.3 ){
$vote_color = 'green';
}
elseif ( ($vote_percent > 0.3) && ($vote_percent <= 0.6) ){
$vote_color = 'blue';
}
elseif ( $vote_percent > 0.6 ){
$vote_color = 'red';
}
$template->assign_block_vars("poll_option", array(
'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'],
'POLL_OPTION_RESULT' => $vote_info[$i]['vote_result'],
'POLL_OPTION_PERCENT' => sprintf("%.1d%%", ($vote_percent * 100)),
'POLL_OPTION_COLOR' => $vote_color,
'POLL_OPTION_IMG' >= $vote_graphic_img,
'POLL_OPTION_IMG_WIDTH' >= $vote_graphic_length
));
$template->assign_vars(array(
'L_TOTAL_VOTES' => $lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum
));
}
else
{
$template->set_filenames(array(
'pollbox' => 'viewtopic_poll_ballot.tpl')
);
for($i = 0; $i < $vote_options; $i++)
{
if ( count($orig_word) )
{
$vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']);
}
$template->assign_block_vars("poll_option", array(
'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'],
'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'])
);
}
$template->assign_vars(array(
'L_SUBMIT_VOTE' => $lang['Submit_vote'],
'L_VIEW_RESULTS' => $lang['View_results'],
'U_VIEW_RESULTS' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&vote=viewresult"))
);
Geplaatst: 22 dec 2004, 22:03
door Luuk
Zet het hele bestand eens in een txt bestand en zet hier de link. Het is nog te weinig

Geplaatst: 22 dec 2004, 22:23
door abcde
Geplaatst: 22 dec 2004, 22:26
door Luuk
Er moet denk ik nog een } achter, nu heb je
for (...)
{
text
}
else
{
Geplaatst: 22 dec 2004, 22:33
door abcde
Kan je a.u.b. aangeven waar het ligt er zijn een aantal "for" en "else"?
Geplaatst: 22 dec 2004, 22:34
door Luuk
De for wordt niet afgesloten,
Ik bedoelde zo:
Code: Selecteer alles
$template->assign_vars(array(
'L_TOTAL_VOTES' => $lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum
));
}
else
Moet
Code: Selecteer alles
$template->assign_vars(array(
'L_TOTAL_VOTES' => $lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum
));
}
}
else
worden.
Geplaatst: 22 dec 2004, 22:57
door abcde
Oke, dank je wel voor je goede en snelle reactie's! :thumb: