Parse error: syntax error, unexpected '}'

Résolu
knakie Messages postés 23 Date d'inscription   Statut Membre Dernière intervention   -  
knakie Messages postés 23 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour tous le monde !!

J'ai un problème avec mon code, voici le message d'erreur que j'obtiens :

Parse error: syntax error, unexpected '}' in /oo/www/an/tees/enable_disable.tpl.php on line 42

Voici ma ligne 42 :

<? } else if ($page == 'config_affiliate') { ?>
<tr class="c1">
<td width="150" align="right">Enable Inviter</td>
<td><input name="enable_affil_invite" type="checkbox" id="enable_affil_invite" value="1" <? echo ($setts_tmp['enable_affil_invite']) ? 'checked' : ''; ?>></td>
</tr>

J'ai à peu près tout essayer, je sais pas pourquoi cela fait sa...

Merci d'avance!

8 réponses

Jean-François Pillou Messages postés 19261 Date d'inscription   Statut Webmaster Dernière intervention   63 277
 
C'est très simple, l'erreur parle d'elle-même : elle signifie que ton accolade fermante ligne 42 ( } ) ne correspond à aucune accolade fermante avant.

En bref : tu t'es planté dans tes accolades, il en manque ou bien il y en a en trop.
1
avion-f16 Messages postés 19252 Date d'inscription   Statut Contributeur Dernière intervention   4 507
 
Essaye avec "elseif" et pas "else if" (ça c'est du JS).
Ensuite, évite les short-tags : "<?php" et pas seulement "<?"
Si ça ne fonctionne toujours pas, regarde à la ligne d'avant si tu n'aurais pas fait une erreur ou oublié le ";".
Ton ordinateur ne fait pas ce que tu veux ... mais ce que tu lui dis de faire.
0
knakie Messages postés 23 Date d'inscription   Statut Membre Dernière intervention  
 
Non cela marche toujours pas

la ligne d'avant j'ai :

<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_CLICK_TO_ENABLE_FEATURE;?></td>
</tr>


Merci!!
0
avion-f16 Messages postés 19252 Date d'inscription   Statut Contributeur Dernière intervention   4 507
 
Montres ta condition entière, depuis le "if".
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
knakie Messages postés 23 Date d'inscription   Statut Membre Dernière intervention  
 
C'est très long :

<? } else if ($page == 'config_affiliate') { ?>
<tr class="c1">
<td width="150" align="right">Enable Inviter</td>
<td><input name="enable_affil_invite" type="checkbox" id="enable_affil_invite" value="1" <? echo ($setts_tmp['enable_affil_invite']) ? 'checked' : ''; ?>></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Check the checkbox above to enable the invite friend feature.</td>
</tr>
<tr class="c1">
<td width="150" align="right">Enable Credit Sharing</td>
<td><input name="enable_affil_donate" type="checkbox" id="enable_affil_donate" value="1" <? echo ($setts_tmp['enable_affil_donate']) ? 'checked' : ''; ?>></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Check the checkbox above to enable the Credit Sharing feature.</td>
</tr>
<tr class="c1">
<td width="150" align="right">New Listings Credit</td>
<td><input name="ref_credit_auc_nlist" type="text" id="ref_credit_auc_nlist" value="<?=$setts_tmp['ref_credit_auc_nlist'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Enter the amount of credit a referrer should receive for <strong>New</strong> Auction Listings made.<BR>
If you do not enter a value here, there will be no credit issued for new auction listings.</td>
</tr>
<tr class="c1">
<td width="150" align="right">Relisted items Credit</td>
<td><input name="ref_credit_auc_rlist" type="text" id="ref_credit_auc_rlist" value="<?=$setts_tmp['ref_credit_auc_rlist'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Enter the amount of credit a referrer should receive for listings that are <strong>Relisted</strong>.<BR>
If you do not enter a value here, there will be no credit issued for relisted auction listings.</td>
</tr>
<tr class="c1">
<td width="150" align="right">Purchased items Credit</td>
<td><input name="ref_credit_auc_purch" type="text" id="ref_credit_auc_purch" value="<?=$setts_tmp['ref_credit_auc_purch'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Enter the amount of credit a referrer should receive for listings that are <strong>purchased/won</strong>.<BR>
If you do not enter a value here, there will be no credit issued for purchased auction listings.</td>
</tr>
<tr class="c1">
<td width="150" align="right">Verification Credit</td>
<td><input name="ref_credit_verified" type="text" id="ref_credit_verified" value="<?=$setts_tmp['ref_credit_verified'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Enter the amount of credit a referrer should receive for users who become verified.<BR>
If you do not enter a value here, there will be no credit issued for users becoming verified.</td>
</tr>
<tr class="c1">
<td width="150" align="right">Store Credit</td>
<td><input name="ref_credit_store" type="text" id="ref_credit_store" value="<?=$setts_tmp['ref_credit_store'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Enter the amount of credit a referrer should receive for users who subscribe to a store.<BR>
If you do not enter a value here, there will be no credit issued for users becoming verified.</td>
</tr>
<tr class="c1">
<td width="150" align="right">Registration Credit</td>
<td><input name="ref_credit_userreg" type="text" id="ref_credit_userreg" value="<?=$setts_tmp['ref_credit_userreg'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Enter the amount of credit a referrer should receive for users who register at your site.<BR>
If you do not enter a value here, no credit will be issued for users that <strong>register & verify</strong> their account.</td>
</tr>
<tr class="c1">
<td width="150" align="right">Balance Credit</td>
<td><input name="ref_credit_balance" type="text" id="ref_credit_balance" value="<?=$setts_tmp['ref_credit_balance'];?>" size="8">  (Example: 25.00 = 25%)  (A referrer will get X % of total amount paid)</td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain">Enter the percentage amount you wish to credit to a user for clearing their account balance.<BR>
<strong>This feature should not be used if</strong> your using any of the above to prevent double dipping.<BR>
If you do not enter a value here, there will be no percentage of payment issued to the referrer as credit.</td>
</tr>

<? if ($page == 'hp_news_box') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_NB_NEWS_DISPLAYED;?></td>
<td><input name="d_news_nb" type="text" id="d_news_nb" value="<?=$layout_tmp['d_news_nb'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_NB_NEWS_DISPLAYED_EXPL;?></td>
</tr>
<? } else if ($page == 'buy_out_method') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_ALWAYS_SHOW_BUYOUT;?></td>
<td><input name="always_show_buyout" type="checkbox" id="field_value" value="1" <? echo ($setts_tmp['always_show_buyout']) ? 'checked' : ''; ?>></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_ALWAYS_SHOW_BUYOUT_EXPL;?></td>
</tr>
<tr class="c1">
<td width="150" align="right"><?=AMSG_SHOW_MAKEOFFER_RANGE;?></td>
<td><input name="makeoffer_private" type="checkbox" id="makeoffer_private" value="1" <? echo ($setts_tmp['makeoffer_private']) ? 'checked' : ''; ?>></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_SHOW_MAKEOFFER_RANGE_EXPL;?></td>
</tr>
<? } else if ($page == 'registration_terms') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_REG_TERMS_CONTENT;?></td>
<td><textarea name="reg_terms_content" style="width: 100%; height: 150px;"><?=eregi_replace('<br>', "\n", $layout_tmp['reg_terms_content']); ?></textarea></td>
</tr>
<? } else if ($page == 'sellitem_terms') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_SELLITEM_TERMS_CONTENT;?></td>
<td><textarea name="auct_terms_content" style="width: 100%; height: 150px;"><?=eregi_replace('<br>', "\n", $layout_tmp['auct_terms_content']); ?></textarea></td>
</tr>
<? } else if ($page == 'auction_sniping') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_SNIPING_DURATION;?></td>
<td><input name="sniping_duration" type="text" id="sniping_duration" value="<?=$setts_tmp['sniping_duration'];?>" size="8">
<?=GMSG_MINUTES;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_SNIPING_DURATION_EXPL;?></td>
</tr>
<? } else if ($page == 'auction_approval') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_AUCT_APPROVAL_NOTE;?></td>
</tr>
<? if (!$setts['enable_auctions_approval']) { ?>
<tr class="c1">
<td align="right"><?=AMSG_USERS;?></td>
<td>[ <a href="list_site_users.php">
<?=GMSG_SELECT;?>
</a> ]</td>
</tr>
<tr class="c2">
<td align="right"><?=AMSG_CATEGORIES;?></td>
<td><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="45%">[
<?=AMSG_ALL_CATEGORIES;?>
] </td>
<td width="10%"> </td>
<td width="45%">[
<?=AMSG_SELECTED_CATEGORIES;?>
] </td>
</tr>
<tr>
<td><?=$all_categories_table;?></td>
<td align="center"><input type="button" name="Disable" value=" -> " style="width: 50px;" onclick="MoveOption(this.form.all_categories, this.form.categories_id)" />
<br />
<br />
<input type="button" name="Enable" value=" <- " style="width: 50px;" onclick="MoveOption(this.form.categories_id, this.form.all_categories)" /></td>
<td><?=$selected_categories_table;?></td>
</tr>
</table></td>
</tr>
<? } ?>
<? } else if ($page == 'preferred_sellers') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_PREF_SELLER_EXP_DATE;?></td>
<td><input name="preferred_days" type="text" id="preferred_days" value="<?=$setts_tmp['preferred_days'];?>" size="8">
<?=GMSG_DAYS;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_PREF_SELLER_EXP_DATE_EXPL;?></td>
</tr>
<tr class="c1">
<td width="150" align="right"><?=AMSG_REDUCTION;?></td>
<td><input name="pref_sellers_reduction" type="text" id="pref_sellers_reduction" value="<?=$setts_tmp['pref_sellers_reduction'];?>" size="8">%</td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_REDUCTION_DESC;?></td>
</tr>
<? } else if ($page == 'change_duration') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_NEW_DURATION;?></td>
<td><input name="duration_change_days" type="text" id="duration_change_days" value="<?=$setts_tmp['duration_change_days'];?>" size="8">
<?=GMSG_DAYS;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_NEW_DURATION_DESC;?></td>
</tr>
<? } else if ($page == 'seller_verification') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_SELLER_VERIF_MANDATORY;?></td>
<td><input name="seller_verification_mandatory" type="checkbox" id="seller_verification_mandatory" value="1" <? echo ($setts_tmp['seller_verification_mandatory']) ? 'checked' : ''; ?>></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_SELLER_VERIF_MANDATORY_EXPL;?></td>
</tr>
<tr class="c1">
<td width="150" align="right"><?=AMSG_VERIFICATION_FEE;?></td>
<td><?=$setts['currency'];?>
<input name="verification_fee" type="text" id="verification_fee" value="<?=$fees_tmp['verification_fee'];?>" size="8">,
<?=AMSG_RECURRING_EVERY;?>
<input name="verification_recurring" type="text" id="verification_recurring" value="<?=$fees_tmp['verification_recurring'];?>" size="8">
<?=GMSG_DAYS;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_VERIFICATION_FEE_EXPL;?></td>
</tr>
<? } else if ($page == 'seller_other_items') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_SELLER_OTHER_ITEMS_EXPL;?></td>
</tr>
<? } else if ($page == 'store_only_mode') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_ENABLE_STORE_ONLY_MODE_EXPL;?></td>
</tr>
<? } else if ($page == 'second_chance') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_SELECT_INTERVAL;?></td>
<td><input name="second_chance_days" type="text" id="second_chance_days" value="<?=$setts_tmp['second_chance_days'];?>" size="8">
<?=GMSG_DAYS;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_SECOND_CHANCE_EXPL;?></td>
</tr>
<? } else if ($page == 'remove_marked_deleted') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_REMOVE_MDA_1;?> <?=$nb_marked_deleted_items;?> <?=AMSG_REMOVE_MDA_2;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_REMOVE_MARKED_DELETED_AUCTIONS_EXPL;?></td>
</tr>
<? } else if ($page == 'private_site') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_PRIVATE_SITE_EXPL;?></td>
</tr>
<? } else if ($page == 'enable_refunds') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_SELECT_INTERVAL;?></td>
<td><input name="refund_min_days" type="text" id="refund_min_days" value="<?=$setts_tmp['refund_min_days'];?>" size="8">
- <input name="refund_max_days" type="text" id="refund_max_days" value="<?=$setts_tmp['refund_max_days'];?>" size="8">
<?=GMSG_DAYS;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_REFUND_DAYS_INTERVAL_EXPL;?></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_REFUNDS_IMPORTANT_NOTE . ' <b>' . show_date($setts['refund_start_date']) . '</b>.';?> </td>
</tr>
<? } else if ($page == 'end_auction_early') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_END_AUCT_EARLY_EXPL;?></td>
</tr>
<? } else if ($page == 'fb_auctions') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_FIRST_BIDDER_AUCTIONS_EXPL;?></td>
</tr>
<? } else if ($page == 'reverse_auctions') { ?>
<tr class="c1">
<td width="150" align="right"><?=AMSG_MAX_PORTFOLIO_FILES;?></td>
<td><input name="max_portfolio_files" type="text" id="max_portfolio_files" value="<?=$setts_tmp['max_portfolio_files'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_MAX_PORTFOLIO_FILES_EXPL;?></td>
</tr>
<tr class="c1">
<td width="150" align="right"><?=AMSG_MAX_ADDL_FILES;?></td>
<td><input name="max_additional_files" type="text" id="max_additional_files" value="<?=$setts_tmp['max_additional_files'];?>" size="8"></td>
</tr>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_MAX_ADDL_FILES_EXPL;?></td>
</tr>
<? } else if ($page == 'swdefeat') { ?>
<tr>
<td class="explain" align="right"><img src="images/info.gif"></td>
<td class="explain"><?=AMSG_ENABLE_SIDEWIKI_BLOCKER_EXPL;?></td>
</tr>
<? } ?>
<tr align="center">
<td colspan="2"><input type="submit" name="form_save_settings" value="<?=AMSG_SAVE_CHANGES;?>"></td>
</tr>
</form>
</table>
0
avion-f16 Messages postés 19252 Date d'inscription   Statut Contributeur Dernière intervention   4 507
 
La condition entière, donc depuis le "if" !
Pour éviter de faire de longues pages :
http://paste.pocoo.org/
Ton ordinateur ne fait pas ce que tu veux ... mais ce que tu lui dis de faire.
0
knakie Messages postés 23 Date d'inscription   Statut Membre Dernière intervention  
 
http://paste.pocoo.org/show/187041/

Désolé je suis pas très doué !
0
knakie Messages postés 23 Date d'inscription   Statut Membre Dernière intervention  
 
Merci bien,

9heures de taff pour une accolade en trop... merci en tous cas
0