Template index_box qui indique une erreur..
2 participants
Forum gratuit : Le forum des forums actifs :: Entraide & Support... :: Problème avec un script, un code :: Archives des problèmes avec un code
Page 1 sur 1 • Partagez
Template index_box qui indique une erreur..
Détails techniques
Version du forum : phpBB2
Poste occupé : Fondateur
Navigateur(s) concerné(s) : Google Chrome
Personnes concernées par le problème : Tous les utilisateurs
Lien du forum : http://imperia-rpg.lebonforum.com/
Description du problème
Bonjour !Alors voilà j'ai essayé de faire mes catégories mais je me trouve toujours avec ce message : "La balise a été fermée avant d'avoir été ouverte ou la balise n'a pas été ouverte."
Cependant dans mon code rien n'est en rouge et tout me semble correctement fermé.
J'ai cependant enlevé toutes les boucles, je ne sais pas si c'est important...
Voici mon template :
- Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<span class="gensmall">{LAST_VISIT_DATE}<br />
{CURRENT_TIME}<br />
</span>
<!-- END switch_user_logged_in -->
<div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
</td>
<td class="gensmall" align="right" valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
<a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
<!-- END switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
</td>
</tr>
</table>
<!-- BEGIN catrow --><!-- BEGIN tablehead -->
<table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr><th colspan="4" nowrap="nowrap" width="100%" class="secondarytitle"> <h2>{catrow.cathead.CAT_TITLE}{catrow.cathead.U_VIEWCAT}</h2> </th></tr>
<tr>
<td class="row1 over" colspan="2" valign="top" width="100%" height="50">
<h3 class="hierarchy"><span class="forumlink"><a class="forumlink"><div class="titre-forum">{catrow.forumrow.U_VIEWFORUM}{catrow.forumrow.FORUM_NAME}</div></a>
</span></h3>
<span class="genmed"><table border="0" cellpadding="1">
<tr>
<td align="left">
<div class="icon">
<img src="http://img11.hostingpics.net/pics/924533PASICONSLIEUX.png" alt="" style="border-radius: 0px; width: 115px; padding: 3px; border: 1px #cacaca solid;" border="0" />
</div>
</td>
<td align="left">
<div class="cadrecate">
<div style="height: 75px; overflow: auto; border: px #000 solid;">
{catrow.forumrow.FORUM_DESC}
</div>
</div>
</td>
</tr>
<tr>
<td>
</td>
<td align="right">
<div class="textecate">{catrow.forumrow.LINKS}</div>
</td>
</tr>
</table><br /></span>
<span class="gensmall">
<td class="row1" align="center" valign="middle">
<td style="min-width: 140px; height: 50px;" class="row3 over" align="center" valign="middle" height="50">
<img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
<span class="gensmall">
<div class="sujets_messages">{catrow.forumrow.TOPICS} - {catrow.forumrow.POSTS}</div>
<div class="derniers_sujets">
<span>{catrow.forumrow.LAST_POST}</span></div></span></td></td></span>
</td></tr></table>
Merci d'avance !
Dernière édition par Kiraxa le Jeu 16 Avr 2015 - 18:34, édité 1 fois
Re: Template index_box qui indique une erreur..
Bonjour,
Oui les boucles sont importantes ! ^^ Elles font partie intégrante des variables des templates.
Par exemple, tout ce qui est entre <!-- BEGIN catrow -->...<!-- END catrow --> correspond à une catégorie : la boucle permet de savoir que ce passage doit être répété pour chaque catégorie à afficher sur le forum !
Autre exemple, le passage entre <!-- BEGIN avatar -->...<!-- END avatar -->correspond à l'affichage de l'avatar du dernier posteur sur l'index : la boucle permet de n'afficher ce passage que si l'option dans le panneau d'administration est activée.
Bref, ce sont bien les boucles retirées qui provoque cet affichage d'erreur à l'enregistrement de votre template. ^^
Il y a également un peut de fouillis dans les balises de tableau à la fin de votre template : des balises td à l'intérieur d'autres balises td, sans qu'on comprenne bien si c'est sensé être un nouveau tableau (il manque alors les balises table et tr) ou bien si c'est la cellule précédente qui n'est pas fermée, ou autre...
Voilà une tentative de correction (dans le sens où le code est correct mais je ne suis pas certaine que c'est ce que vous vouliez faire en premier lieu ^^"), reste à remettre les boucles... :
Oui les boucles sont importantes ! ^^ Elles font partie intégrante des variables des templates.
Par exemple, tout ce qui est entre <!-- BEGIN catrow -->...<!-- END catrow --> correspond à une catégorie : la boucle permet de savoir que ce passage doit être répété pour chaque catégorie à afficher sur le forum !
Autre exemple, le passage entre <!-- BEGIN avatar -->...<!-- END avatar -->correspond à l'affichage de l'avatar du dernier posteur sur l'index : la boucle permet de n'afficher ce passage que si l'option dans le panneau d'administration est activée.
Bref, ce sont bien les boucles retirées qui provoque cet affichage d'erreur à l'enregistrement de votre template. ^^
Il y a également un peut de fouillis dans les balises de tableau à la fin de votre template : des balises td à l'intérieur d'autres balises td, sans qu'on comprenne bien si c'est sensé être un nouveau tableau (il manque alors les balises table et tr) ou bien si c'est la cellule précédente qui n'est pas fermée, ou autre...
Voilà une tentative de correction (dans le sens où le code est correct mais je ne suis pas certaine que c'est ce que vous vouliez faire en premier lieu ^^"), reste à remettre les boucles... :
- Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<span class="gensmall">{LAST_VISIT_DATE}<br />
{CURRENT_TIME}<br />
</span>
<!-- END switch_user_logged_in -->
<div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
</td>
<td class="gensmall" align="right" valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
<a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
<!-- END switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
</td>
</tr>
</table>
<!-- BEGIN catrow --><!-- BEGIN tablehead -->
<table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<th colspan="4" nowrap="nowrap" width="100%" class="secondarytitle">
<h2>{catrow.cathead.CAT_TITLE}{catrow.cathead.U_VIEWCAT}</h2>
</th>
</tr>
<tr>
<td class="row1 over" colspan="2" valign="top" width="100%" height="50">
<h3 class="hierarchy">
<span class="forumlink">
<a class="forumlink">
<div class="titre-forum">
{catrow.forumrow.U_VIEWFORUM}{catrow.forumrow.FORUM_NAME}
</div>
</a>
</span>
</h3>
<table border="0" cellpadding="1" class="genmed">
<tr>
<td align="left">
<div class="icon">
<img src="http://img11.hostingpics.net/pics/924533PASICONSLIEUX.png" alt="" style="border-radius: 0px; width: 115px; padding: 3px; border: 1px #cacaca solid;" border="0" />
</div>
</td>
<td align="left">
<div class="cadrecate">
<div style="height: 75px; overflow: auto; border: px #000 solid;">
{catrow.forumrow.FORUM_DESC}
</div>
</div>
</td>
</tr>
<tr>
<td></td>
<td align="right">
<div class="textecate">
{catrow.forumrow.LINKS}
</div>
</td>
</tr>
</table>
<br />
</td>
<td style="min-width: 140px; height: 50px;" class="row3 over" align="center" valign="middle" height="50">
<img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
<div class="sujets_messages gensmall">
{catrow.forumrow.TOPICS} - {catrow.forumrow.POSTS}
</div>
<div class="derniers_sujets gensmall">
{catrow.forumrow.LAST_POST}
</div>
</td>
</tr>
</table>
MlleAlys- Membre actif
- Messages : 5767
Inscrit(e) le : 12/09/2012
Re: Template index_box qui indique une erreur..
Bon, j'ai essayé de remettre les boucles mais on dirait que je suis pas vraiment douée :/
-> http://imperia-rpg.lebonforum.com/
Le template modifié est à présent celui-ci :
-> http://imperia-rpg.lebonforum.com/
Le template modifié est à présent celui-ci :
- Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<span class="gensmall">{LAST_VISIT_DATE}<br />
{CURRENT_TIME}<br />
</span>
<!-- END switch_user_logged_in -->
<div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
</td>
<td class="gensmall" align="right" valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
<a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
<!-- END switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
</td>
</tr>
</table>
<!-- BEGIN catrow --><!-- BEGIN tablehead --><table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
<!-- BEGIN cathead --><tr>
<th colspan="4" nowrap="nowrap" width="100%" class="secondarytitle">
<h2><a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a></h2>
</th>
</tr><!-- END cathead -->
<!-- END tablehead -->
<!-- BEGIN forumrow -->
<tr>
<td class="row1 over" colspan="2" valign="top" width="100%" height="50">
<h3 class="hierarchy">
<span class="forumlink">
<a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">
<div class="titre-forum">
{catrow.forumrow.FORUM_NAME}
</div>
</a>
</span>
</h3>
<table border="0" cellpadding="1" class="genmed">
<tr>
<td align="left">
<div class="icon">
<img src="http://img11.hostingpics.net/pics/924533PASICONSLIEUX.png" alt="" style="border-radius: 0px; width: 115px; padding: 3px; border: 1px #cacaca solid;" border="0" />
</div>
</td>
<td align="left">
<div class="cadrecate">
<div style="height: 75px; overflow: auto; border: px #000 solid;">
{catrow.forumrow.FORUM_DESC}
</div>
</div>
</td>
</tr>
<tr>
<td></td>
<td align="right">
<div class="textecate">
{catrow.forumrow.LINKS}
</div>
</td>
</tr>
</table>
<br />
</td>
<td style="min-width: 140px; height: 50px;" class="row3 over" align="center" valign="middle" height="50">
<img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
<div class="sujets_messages gensmall">
{catrow.forumrow.TOPICS} - {catrow.forumrow.POSTS}
</div>
<div class="derniers_sujets gensmall">
{catrow.forumrow.LAST_POST}
</div>
</td>
<!-- END forumrow -->
</tr>
</table>
<!-- BEGIN catfoot -->
<tr>
<!-- BEGIN inc -->
<td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
<!-- END inc -->
<td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>
</tr>
<!-- END catfoot -->
<!-- BEGIN tablefoot -->
<img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot --><!-- END catrow -->
Re: Template index_box qui indique une erreur..
Alors, le début est correct, ça se corse à <!-- END forumrow --> :
"forumrow" est la ligne qui correspond à un forum. C'est une ligne de tableau, d'ailleurs, juste après <!-- BEGIN forumrow -->, on a la création d'une ligne avec la balise <tr> : cette ligne, il faut la fermer à la fin de l'affichage d'un forum, c'est à dire juste avant <!-- END forumrow --> et non pas juste après ! Sinon, cela voudrait dire que chaque forum dans une catégorie crée une nouvelle ligne de tableau alors que la précédente n'a pas été terminée... autant dire que le navigateur n'y comprend pas grand chose ^^"
Et, une fois la ligne fermée, il ne faut pas fermer le tableau (la balise </table>) car d'autres forums peuvent être affichés ensuite, la catégorie ne se finit pas là ! ^^ Le tableau de la catégorie doit se fermer juste après <!-- BEGIN tablefoot --> ("début du pied de tablaeau"), de la même façon qu'il a été ouvert au tout début de la catégorie juste après <!-- BEGIN tablehead --> ("début de l'en-tête du tableau")
Ce qui donne finalement le template :
"forumrow" est la ligne qui correspond à un forum. C'est une ligne de tableau, d'ailleurs, juste après <!-- BEGIN forumrow -->, on a la création d'une ligne avec la balise <tr> : cette ligne, il faut la fermer à la fin de l'affichage d'un forum, c'est à dire juste avant <!-- END forumrow --> et non pas juste après ! Sinon, cela voudrait dire que chaque forum dans une catégorie crée une nouvelle ligne de tableau alors que la précédente n'a pas été terminée... autant dire que le navigateur n'y comprend pas grand chose ^^"
Et, une fois la ligne fermée, il ne faut pas fermer le tableau (la balise </table>) car d'autres forums peuvent être affichés ensuite, la catégorie ne se finit pas là ! ^^ Le tableau de la catégorie doit se fermer juste après <!-- BEGIN tablefoot --> ("début du pied de tablaeau"), de la même façon qu'il a été ouvert au tout début de la catégorie juste après <!-- BEGIN tablehead --> ("début de l'en-tête du tableau")
Ce qui donne finalement le template :
- Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<span class="gensmall">{LAST_VISIT_DATE}<br />
{CURRENT_TIME}<br />
</span>
<!-- END switch_user_logged_in -->
<div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
</td>
<td class="gensmall" align="right" valign="bottom">
<!-- BEGIN switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
<a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
<!-- END switch_user_logged_in -->
<a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
</td>
</tr>
</table>
<!-- BEGIN catrow --><!-- BEGIN tablehead --><table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle"> {catrow.tablehead.L_FORUM} </th>
<th nowrap="nowrap" width="50">{L_TOPICS}</th>
<th nowrap="nowrap" width="50">{L_POSTS}</th>
<th nowrap="nowrap" width="150"><div style="width:150px;">{L_LASTPOST}</div></th>
</tr>
<!-- END tablehead -->
<!-- BEGIN cathead -->
<tr>
<!-- BEGIN inc -->
<td class="{catrow.cathead.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
<!-- END inc -->
<td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%">
<h{catrow.cathead.LEVEL} class="hierarchy">
<span class="cattitle">
<a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a>
</span>
</h{catrow.cathead.LEVEL}>
</td>
<td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"> </td>
</tr>
<!-- END cathead -->
<!-- BEGIN forumrow -->
<tr>
<!-- BEGIN inc -->
<td class="{catrow.forumrow.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" alt="." /></td>
<!-- END inc -->
<td class="{catrow.forumrow.INC_CLASS}" align="center" valign="middle">
<img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
</td>
<td class="row1 over" colspan="{catrow.forumrow.INC_SPAN}" valign="top" width="100%" height="50">
<h{catrow.forumrow.LEVEL} class="hierarchy">
<span class="forumlink">
<a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a><br />
</span>
</h{catrow.forumrow.LEVEL}>
<span class="genmed">{catrow.forumrow.FORUM_DESC}</span>
<span class="gensmall">
<!-- BEGIN switch_moderators_links -->
{catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
<!-- END switch_moderators_links -->
{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
</span>
</td>
<td class="row3" align="center" valign="middle" height="50">
<span class="gensmall">{catrow.forumrow.TOPICS}</span>
</td>
<td class="row2" align="center" valign="middle" height="50">
<span class="gensmall">{catrow.forumrow.POSTS}</span>
</td>
<td class="row3 over" align="center" valign="middle" height="50">
<!-- BEGIN avatar -->
<div style="width: 200px;"></div>
<span class="lastpost-avatar">{catrow.forumrow.avatar.LAST_POST_AVATAR}</span>
<!-- END avatar -->
<span class="gensmall">{catrow.forumrow.LAST_POST}</span>
</td>
</tr>
<!-- END forumrow -->
<!-- BEGIN catfoot -->
<tr>
<!-- BEGIN inc -->
<td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
<!-- END inc -->
<td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>
</tr>
<!-- END catfoot -->
<!-- BEGIN tablefoot -->
</table><img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot --><!-- END catrow -->
MlleAlys- Membre actif
- Messages : 5767
Inscrit(e) le : 12/09/2012
Re: Template index_box qui indique une erreur..
Ah ça fonctionne très bien !
Merci beaucoup (encore une fois) !
Merci beaucoup (encore une fois) !
Sujets similaires
» Google Search Control indique une erreur su mon site
» Erreur dans un template
» (#3557) Erreur sur le template overall_footer_end, par défaut
» Erreur lors de la publication d'un template
» Nom du forum disparu (erreur dans le template)
» Erreur dans un template
» (#3557) Erreur sur le template overall_footer_end, par défaut
» Erreur lors de la publication d'un template
» Nom du forum disparu (erreur dans le template)
Forum gratuit : Le forum des forums actifs :: Entraide & Support... :: Problème avec un script, un code :: Archives des problèmes avec un code
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum