Rajouter une colonne "auteur" dans la liste des sujets

2 participants

Voir le sujet précédent Voir le sujet suivant Aller en bas

Résolu Rajouter une colonne "auteur" dans la liste des sujets

Message par RattusRattus Lun 1 Déc 2014 - 18:06

Détails techniques


Version du forum : PunBB
Poste occupé : Administrateur
Navigateur(s) concerné(s) : Mozilla Firefox, Google Chrome, Internet Explorer
Personnes concernées par le problème : Tous les utilisateurs
Problème apparu depuis : Depuis toujours

Description du problème

Bonjour,

J'aimerais rajouter une colonne dans la liste des sujets, au même titre que "réponse", "vue" et "dernier message", comme sur le print. Je le voudrais entre la colonne "sujet" et "réponse" et ça afficherait dans cette colonne donc, l'auteur du sujet.

Je essayé de bidouiller un peu mais je n'ai pas réussi...

Merci à vous si vous me répondez,


Dernière édition par RattusRattus le Lun 1 Déc 2014 - 19:14, édité 2 fois
RattusRattus

RattusRattus
***

Féminin
Messages : 112
Inscrit(e) le : 27/11/2014

http://forum-reptiles.forumactif.org
RattusRattus a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Rajouter une colonne "auteur" dans la liste des sujets

Message par Invité Lun 1 Déc 2014 - 18:20

Salut RattusRattus,

il faudrait déjà voir la capture , impossible d'ouvrir le spoiler Wink .
a++
Anonymous

Invité
Invité


Invité a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Rajouter une colonne "auteur" dans la liste des sujets

Message par RattusRattus Lun 1 Déc 2014 - 18:31

Bizarre effectivement Confused

La revoilà :

Spoiler:


Je rajoute le code de topics_list_box
Code:

<!-- BEGIN topics_list_box -->
<!-- BEGIN row -->
<!-- BEGIN header_table -->
   <!-- BEGIN multi_selection -->
      <script type="text/javascript">
      function check_uncheck_main_{topics_list_box.row.header_table.BOX_ID}() {
         var all_checked = true;
         for (i = 0; (i < document.{topics_list_box.FORMNAME}.elements.length) && all_checked; i++) {
         if (document.{topics_list_box.FORMNAME}.elements[i].name == '{topics_list_box.FIELDNAME}[]{topics_list_box.row.header_table.BOX_ID}') {
            all_checked = document.{topics_list_box.FORMNAME}.elements[i].checked;
         }
         }
         document.{topics_list_box.FORMNAME}.all_mark_{topics_list_box.row.header_table.BOX_ID}.checked = all_checked;
      }
      function check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}() {
         for (i = 0; i < document.{topics_list_box.FORMNAME}.length; i++) {
         if (document.{topics_list_box.FORMNAME}.elements[i].name == '{topics_list_box.FIELDNAME}[]{topics_list_box.row.header_table.BOX_ID}') {
            document.{topics_list_box.FORMNAME}.elements[i].checked = document.{topics_list_box.FORMNAME}.all_mark_{topics_list_box.row.header_table.BOX_ID}.checked;
         }
         }
      }
      </script>
   <!-- END multi_selection -->

   <div class="main-head">
      <!-- BEGIN multi_selection -->
      <input onclick="check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}();" type="checkbox" name="all_mark_{topics_list_box.row.header_table.BOX_ID}" value="0" />
      <!-- END multi_selection -->
      <h1 class="page-title">Annonces</h1>
   </div>
   <div class="main-content">
   <table cellspacing="0" class="table">
      <thead>
         <tr>
            <th class="tcl">{L_TOPICS}</th>
            <th class="tc2">{topics_list_box.row.L_REPLIES}</th>
            <th class="tc3">{topics_list_box.row.L_VIEWS}</th>
            <th class="tcr">{topics_list_box.row.L_LASTPOST}</th>
         </tr>
      </thead>
      <tbody class="statused">
<!-- END header_table -->

<!-- BEGIN header_row -->
<strong>{topics_list_box.row.L_TITLE}</strong>
<!-- END header_row -->

<!-- BEGIN topic -->
   <!-- BEGIN table_sticky -->
      </tbody>
   </table>
   </div>

   <div class="main-head">
      <!-- BEGIN multi_selection -->
      <input onclick="check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}();" type="checkbox" name="all_mark_{topics_list_box.row.header_table.BOX_ID}" value="0" /   >
      <!-- END multi_selection -->
      <h2>Sujets</h2>
   </div>
   <div class="main-content">
   <table cellspacing="0" class="table">
      <thead>
         <tr>
                          <th class="tcl">{L_TOPICS}</th>
            <th class="tc2">{topics_list_box.row.topic.table_sticky.L_REPLIES}</th>
            <th class="tc3">{topics_list_box.row.topic.table_sticky.L_VIEWS}</th>
                          <th class="tcr">{topics_list_box.row.topic.table_sticky.L_LASTPOST}</th>
         </tr>
      </thead>
      <tbody class="statused">
   <!-- END table_sticky -->
      <tr>
         <td class="tcl tdtopics <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">
            <span class="status">
               <img title="{topics_list_box.row.L_TOPIC_FOLDER_ALT}" src="{topics_list_box.row.TOPIC_FOLDER_IMG}" alt="{topics_list_box.row.L_TOPIC_FOLDER_ALT}" />
            </span>
            <!-- BEGIN single_selection -->
            <input type="radio" name="{topics_list_box.FIELDNAME}" value="{topics_list_box.row.FID}" {topics_list_box.row.L_SELECT} />&nbsp;
            <!-- END single_selection -->
            {topics_list_box.row.ICON}&nbsp;
            {topics_list_box.row.NEWEST_POST_IMG}
            {topics_list_box.row.PARTICIPATE_POST_IMG}&nbsp;
                          <div class="annonce">{topics_list_box.row.TOPIC_TYPE}
                             
            <h2 class="topic-title" style="color:#000;"><a class="topictitle" href="{topics_list_box.row.U_VIEW_TOPIC}">{topics_list_box.row.TOPIC_TITLE}</a></h2>&nbsp;
            {topics_list_box.row.GOTO_OPEN} {topics_list_box.row.GOTO_PAGE_NEW} {topics_list_box.row.GOTO_CLOSE}&nbsp;
            {topics_list_box.row.L_BY} {topics_list_box.row.TOPIC_AUTHOR}
                            </div>
            <!-- BEGIN switch_description -->
            <br />
            &nbsp;{topics_list_box.row.topic.switch_description.TOPIC_DESCRIPTION}
            <!-- END switch_description -->
         </td>
         <td class="tc2 <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">{topics_list_box.row.REPLIES}</td>
         <td class="tc3 <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">{topics_list_box.row.VIEWS}</td>
         <td class="tcr <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">
                <!-- BEGIN avatar -->
                <span class="lastpost-avatar">{topics_list_box.row.topic.avatar.LAST_POST_AVATAR}</span>
                <!-- END avatar -->

                          <div style="text-align:center; font-size:11px;">{topics_list_box.row.LAST_POST_TIME}<br>{topics_list_box.row.LAST_POST_AUTHOR}{topics_list_box.row.LAST_POST_IMG}</div>
                          </td>
         <!-- BEGIN multi_selection -->
         <td><input onclick="javascript:check_uncheck_main_{topics_list_box.row.BOX_ID}();" type="checkbox" name="{topics_list_box.FIELDNAME}[]{topics_list_box.row.BOX_ID}" value="{topics_list_box.row.FID}" {topics_list_box.row.L_SELECT} /></td>
         <!-- END multi_selection -->
      </tr>
<!-- END topic -->
<!-- BEGIN no_topics -->
<tr>
   <td class="tcl" colspan="4"><strong>{topics_list_box.row.L_NO_TOPICS}</strong></td>
</tr>
<!-- END no_topics -->

<!-- BEGIN bottom -->
      </tbody>
   </table>
   </div>
   <div class="main-foot clearfix">
      <!-- BEGIN multi_selection -->
      <input onclick="check_uncheck_all_{topics_list_box.row.header_table.BOX_ID}();" type="checkbox" name="all_mark_{topics_list_box.row.header_table.BOX_ID}" value="0" />
      <!-- END multi_selection -->
      
      <p class="options">
         <a href="{U_MARK_READ}">{L_MARK_TOPICS_READ}</a>&nbsp;{S_WATCH_FORUM}&nbsp;<a href="#top">{L_BACK_TO_TOP}</a>
      </p>
   </div>
<!-- END bottom -->
<!-- BEGIN spacer --><br /><!-- END spacer -->
<!-- END row -->
<!-- END topics_list_box -->


Dernière édition par RattusRattus le Lun 1 Déc 2014 - 19:14, édité 2 fois
RattusRattus

RattusRattus
***

Féminin
Messages : 112
Inscrit(e) le : 27/11/2014

http://forum-reptiles.forumactif.org
RattusRattus a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Rajouter une colonne "auteur" dans la liste des sujets

Message par Invité Lun 1 Déc 2014 - 18:33

Re,
ok merci,
as tu modifié le template topics_list_box ?:
Affichage/Templates/Général/topics_list_box

a++
Anonymous

Invité
Invité


Invité a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Rajouter une colonne "auteur" dans la liste des sujets

Message par RattusRattus Lun 1 Déc 2014 - 18:34

Oui Smile

Je viens d'éditer mon message avec le code dedans. On s'est croisé Smile
RattusRattus

RattusRattus
***

Féminin
Messages : 112
Inscrit(e) le : 27/11/2014

http://forum-reptiles.forumactif.org
RattusRattus a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Rajouter une colonne "auteur" dans la liste des sujets

Message par Neptunia Lun 1 Déc 2014 - 18:37

J'ai rédigé ma réponse avant que le template ne soit fourni.
La manip décrite s'applique donc sur un template peu ou pas modifié.




Bonjour ^^

Dans le template topics_list_box :

Remplacer :
Code:
      <thead>
         <tr>
            <th class="tcl">{L_TOPICS}</th>
            <th class="tc2">{topics_list_box.row.L_REPLIES}</th>
            <th class="tc3">{topics_list_box.row.L_VIEWS}</th>
            <th class="tcr">{topics_list_box.row.L_LASTPOST}</th>
         </tr>
      </thead>
par :
Code:
      <thead>
         <tr>
            <th class="tcl">{L_TOPICS}</th>
                             <th class="tc3">{topics_list_box.row.L_AUTHOR}</th>
            <th class="tc2">{topics_list_box.row.L_REPLIES}</th>
            <th class="tc3">{topics_list_box.row.L_VIEWS}</th>
            <th class="tcr">{topics_list_box.row.L_LASTPOST}</th>
         </tr>
      </thead>

Puis remplacer :
Code:
      <thead>
         <tr>
            <th class="tcl">{L_TOPICS}</th>
            <th class="tc2">{topics_list_box.row.topic.table_sticky.L_REPLIES}</th>
            <th class="tc3">{topics_list_box.row.topic.table_sticky.L_VIEWS}</th>
            <th class="tcr">{topics_list_box.row.topic.table_sticky.L_LASTPOST}</th>
         </tr>
      </thead>
par :
Code:
      <thead>
         <tr>
            <th class="tcl">{L_TOPICS}</th>
                             <th class="tc3">{topics_list_box.row.topic.table_sticky.L_AUTHOR}</th>
            <th class="tc2">{topics_list_box.row.topic.table_sticky.L_REPLIES}</th>
            <th class="tc3">{topics_list_box.row.topic.table_sticky.L_VIEWS}</th>
            <th class="tcr">{topics_list_box.row.topic.table_sticky.L_LASTPOST}</th>
         </tr>
      </thead>

C'est fini pour l'intitulé des colonnes.
Pour le contenu à proprement parler, remplacer :
Code:
         </td>
         <td class="tc2 <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">{topics_list_box.row.REPLIES}</td>
         <td class="tc3 <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">{topics_list_box.row.VIEWS}</td>
         <td class="tcr <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">
                <!-- BEGIN avatar -->
par :
Code:
         </td>
                     <td class="tc3 <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">{topics_list_box.row.TOPIC_AUTHOR}</td>
         <td class="tc2 <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">{topics_list_box.row.REPLIES}</td>
         <td class="tc3 <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">{topics_list_box.row.VIEWS}</td>
         <td class="tcr <!-- BEGIN line_sticky --> sticky-separator <!-- END line_sticky -->">
                <!-- BEGIN avatar -->

:enreg: et ne pas oublier de publier ( Ajout )
Neptunia

Neptunia
Membre actif

Féminin
Messages : 17853
Inscrit(e) le : 08/08/2010

https://www.galaxie-series.net/
Neptunia a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Rajouter une colonne "auteur" dans la liste des sujets

Message par Invité Lun 1 Déc 2014 - 18:55

Re,
salut Neptune Wink ,

tu m'as coupé la chique Very Happy ,

Tu peux aussi supprimer cette partie (ligne 86 environ):
Code:
{topics_list_box.row.L_BY} {topics_list_box.row.TOPIC_AUTHOR}

Car elle n'est plus d'actualité vu que l'auteur est mentionné désormais Wink .

a++
Anonymous

Invité
Invité


Invité a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Rajouter une colonne "auteur" dans la liste des sujets

Message par RattusRattus Lun 1 Déc 2014 - 19:13

Wouh que d'efficacité. Tout fonctionne correctement, merci mille fois !
RattusRattus

RattusRattus
***

Féminin
Messages : 112
Inscrit(e) le : 27/11/2014

http://forum-reptiles.forumactif.org
RattusRattus a été remercié(e) par l'auteur de ce sujet.

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum