Je ne considère pas ça comme une MOD à part entière digne de figurer dans les MOD’s officielles, mais c’est une petite modification du code html qui permets d’avoir la séparation entre les différents forums sur l’index.
Je ne veux pas utiliser non plus la fiche MOD standard, mais expliquer comment faire et pourquoi faire pour éviter de faire bêtement un copier – coller et pour que cette explication serve aussi pour l’apprentissage.
Dans tous les fichiers .tpl des styles vous trouverez les commentaires un peu bizarres qui en fait n’en sont pas, mais qui sont interprétés par le forum en vue de modification d’affichage.
Dans notre cas et dans le fichier index_body.tpl c’est sont les commentaires :
| Code: |
<!-- BEGIN catrow -->
<!-- END catrow -->
<!-- BEGIN forumrow -->
<!-- END forumrow --> |
Normalement, dans le style de base (subSilver) les tables commencent par les titres :
| Citation: |
| Forum Sujets Messages Derniers Messages |
ensuite il y a la description des catégories ( catrow ) et les descriptions des forums disponibles ( forumrow )
Dans notre cas il faut que la description des forums se répète à chaque fois. Il faut donc déplacer le commentaire BEGIN catrow au dessus de cellules de description :
trouvez
| Code: |
| <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th> <th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th> <th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th> <th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th> </tr> |
et déplacez le begin catrow pour qu’il se trouve juste avant le début du tableau.
Vous devez aussi déplacer le END catrow de façon à ce qu’il se retrouve juste après la fin de ce tableau. De cette façon quand le script phpBB tombera sur une catégorie de forum il affichera le tableau en entier.
La majeure partie de la modif est terminée, mais vous constaterez que les forums sont accolés les un aux autres. Soit ça vous plaît et vous pouvez laisser comme ça, soit vous voulez vraiment décoller les catégories et pour cela il suffit de faire un saut de ligne à la fin de la catégorie, donc juste après END forumrow.
Voici à quoi doit ressembler le code en entier :
| Code: |
<!-- BEGIN catrow --> <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th> <th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th> <th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th> <th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th> </tr> <!-- position normale de begincatrow //--> <tr> <td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td> <td class="rowpic" colspan="3" align="right"> </td> </tr> <!-- BEGIN forumrow --> <tr> <td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="45" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td> <td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br /> </span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br /> </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td> <td class="row2" 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="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td> </tr> <!-- END forumrow --> <br /> </table> <!-- END catrow -->
|
Ceci est valable pour les styles strictes genre subSilver, mais en comprenant comment ça fonctionne rien ne vous empêche de modifier n’importe quel style