Séparer les forums dans les catégories (bis)

3 participants

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

Résolu Séparer les forums dans les catégories (bis)

Message par IzumiRK Mer 4 Mar 2015 - 18:24

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://dead-everyday.forums-actifs.com/

Description du problème

Bonjour,

Je reviens pour le même problème car je me suis aperçu que le code qui permettait de séparer les forums dans les catégories posait problème avec mon codes de catégories en onglets. Cf Ce sujet pour le problème d'origine.

Avec mon code d'origine
Spoiler:
, les forums étaient tous collés les uns aux autres à l'intérieur d'une catégorie mais les liens des onglets menaient directement à la catégorie.

Maintenant, chaque onglet mène à un sous-forum au lieu de mener à la catégorie, du coup la moitié du forum n'est pas accessible. Le code actuel
Spoiler:
fait que les onglets ne différencient plus les catégories mais les forums.
Par exemple, si je clique sur l'onglet 1, ça me mènera au premier forum de la catégorie 1 uniquement, et l'onglet 2 me mènera au deuxième forum de la catégorie 1, etc.

J'ai essayé de modifier le deuxième code mais vu que je ne sais pas comment il a été écrit, ça ne donne rien. Du coup si quelqu'un saurait m'aider à isoler la partie de code qui m'intéresse en corrigeant le bug, ce serait génial ^^

Merci d'avance.


Dernière édition par IzumiRK le Dim 8 Mar 2015 - 2:06, édité 1 fois
IzumiRK

IzumiRK
****

Messages : 206
Inscrit(e) le : 25/02/2015

http://indare.forumactif.com/
IzumiRK a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par IzumiRK Jeu 5 Mar 2015 - 18:26

Up
IzumiRK

IzumiRK
****

Messages : 206
Inscrit(e) le : 25/02/2015

http://indare.forumactif.com/
IzumiRK a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par Ange Tuteur Ven 6 Mar 2015 - 3:04

Bonjour IzumiRK,

Essayez ce code :
Code:
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr>
          <td class="gensmall" align="right" valign="bottom">
                <!-- BEGIN switch_user_logged_in -->
                          <center><span class="gensmall">{LAST_VISIT_DATE} ▬ {CURRENT_TIME}
                            </span></center>
                <center><a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> ▬ <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a> ▬ <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a></center>
          <!-- END switch_user_logged_in -->
            </td>
        </tr>
        </table>
        <div id="conteneur_onglets_cate">
          <div class="onglet_cate">↕Préambule</div>
          <div class="onglet_cate">Gestion des personnages</div>
          <div class="onglet_cate">Extérieur</div>
          <div class="onglet_cate">Bâtiment principal</div>
          <div class="onglet_cate">Bâtiments annexes↕</div><br/>
          <div class="onglet_cate">↕Kochi</div>
          <div class="onglet_cate">Périphérie et ailleurs</div>
          <div class="onglet_cate">Hors RPG↕</div>
        </div><br/><br/>
        <div id="conteneur_categories">
        <!-- BEGIN catrow --><!-- BEGIN tablehead -->
        <div class="categorie"><table class="forumline" id="categories" width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
          <tr>
              <th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle"></th>
              <th nowrap="nowrap" width="90"></th>
              <th nowrap="nowrap" width="150"><div style="width:150px;"></div></th>
          </tr>
          <!-- END tablehead -->
          <!-- BEGIN cathead -->
          <tr>
              <!-- BEGIN inc -->
              <td class="{catrow.cathead.inc.INC_CLASS}" width="46" valign="top"><img src="{SPACER}" height="0" width="46" /></td>
              <!-- END inc -->
              <td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%" valign="top">
                <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">&nbsp;</td>
          </tr>
          <!-- END cathead -->
          <!-- BEGIN forumrow -->
          <tr>
            <td colspan="4"><div class="categorie"><table class="forumline" id="categories" width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
              <!-- 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="top">
           
              </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>
                                        </span>
                           
                                          <span class="gensmall" style="color:#71AFD1; float:right;">Messages : {catrow.forumrow.POSTS} || Sujets : {catrow.forumrow.TOPICS}</span><br />
                </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 -->
               
                </span>
              </td>
              <td class="row3" align="center" valign="middle" height="50">
                <span class="gensmall">{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}</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 -->
                          <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /><br/>
                <span class="gensmall">{catrow.forumrow.LAST_POST}</span>
              </td>
              </table><br/></div></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" /></div>
        <!-- END tablefoot --><!-- END catrow -->
        </div>
Ange Tuteur

Ange Tuteur
****

Masculin
Messages : 482
Inscrit(e) le : 16/11/2013

https://fmdesign.forumotion.com
Ange Tuteur a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par IzumiRK Ven 6 Mar 2015 - 3:48

Ça ne fonctionne pas, le cadre est vide et les forums ne s'affichent plus nulle part =/

Séparer les forums dans les catégories (bis) Sans_t10

C'est peut-être un conflit avec les catégories en onglets mais ça m'étonnerait, vu que le forum sur lequel j'installe le thème avait ce système et avait quand même des forums séparés.
S'il y a moyen de faire ça avec du javascript ou du jquery ou quoi que ce soit je prends aussi, tant que ça fonctionne.
IzumiRK

IzumiRK
****

Messages : 206
Inscrit(e) le : 25/02/2015

http://indare.forumactif.com/
IzumiRK a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par IzumiRK Sam 7 Mar 2015 - 17:48

Up
IzumiRK

IzumiRK
****

Messages : 206
Inscrit(e) le : 25/02/2015

http://indare.forumactif.com/
IzumiRK a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par [Nihil] Dim 8 Mar 2015 - 0:39

Coucou IzumiRK Smile

Je me base par rapport au template que as posté dans ton premier message. Si tu le remplaces par ceci, est ce que c'est mieux ?
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
  <td class="gensmall" align="right" valign="bottom">
        <!-- BEGIN switch_user_logged_in -->
                  <center><span class="gensmall">{LAST_VISIT_DATE} ▬ {CURRENT_TIME}
                    </span></center>
        <center><a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> ▬ <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a> ▬ <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a></center>
  <!-- END switch_user_logged_in -->
    </td>
</tr>
</table>
<div id="conteneur_onglets_cate">
  <div class="onglet_cate">↕Préambule</div>
  <div class="onglet_cate">Gestion des personnages</div>
  <div class="onglet_cate">Extérieur</div>
  <div class="onglet_cate">Bâtiment principal</div>
  <div class="onglet_cate">Bâtiments annexes↕</div><br/>
  <div class="onglet_cate">↕Kochi</div>
  <div class="onglet_cate">Périphérie et ailleurs</div>
  <div class="onglet_cate">Hors RPG↕</div>
</div><br/><br/>
<div id="conteneur_categories">
<!-- BEGIN catrow -->
  <!-- BEGIN forumrow -->
  <table class="forumline" id="categories" width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
  <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="top">
   
      </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>
                                </span>
                   
                                  <span class="gensmall" style="color:#71AFD1; float:right;">Messages : {catrow.forumrow.POSTS} || Sujets : {catrow.forumrow.TOPICS}</span><br />
        </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 -->
       
        </span>
      </td>
      <td class="row3" align="center" valign="middle" height="50">
        <span class="gensmall">{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}</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 -->
                  <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /><br/>
        <span class="gensmall">{catrow.forumrow.LAST_POST}</span>
      </td>
  </tr>
</table><img src="{SPACER}" alt="" height="5" width="1" />
  <!-- 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 -->
<!-- END tablefoot --><!-- END catrow -->
</div>
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

https://forum.forumactif.com
[Nihil] a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par IzumiRK Dim 8 Mar 2015 - 1:17

Presque ! Les forums sont séparés mais les catégories ont décidé de ne plus s'afficher en onglets. Mais c'est déjà un sacré progrès.

Je sais pas si ça peut aider mais dans le doute, le code Javascript qui gère les catégories en onglet :
Code:
$('document').ready(function()
  {
  if($('.categorie').size() > 1)
    {
      $('#conteneur_onglets').css( 'display' , 'block' );
      $('#conteneur_onglets .onglet').click(function()
      {
        change_categorie( $('.onglet', '#conteneur_onglets').index( this ) )
      });
     
      $('.onglet:eq(0)').click();
}
  });

  function change_categorie( index )
  {
      if( $('.categorie:eq(' + index + ')').size() != 0 )
      {
        $('#conteneur_categories').css( 'min-height' , $('.categorie:eq(' + index + ')').outerHeight() );

       
        $('.categorie').css( 'display' , 'none' );
        $('.categorie:eq(' + index + ')').fadeIn( 500 );
       
        $('.onglet.actif').removeClass('actif');
        $('.onglet:eq('+ index +')').addClass('actif');
      }
      else alert('Vous ne pouvez pas accéder à cette catégorie');
  }

J'avoue que je sais plus très bien comment fonctionne le code de catégories en onglets, j'avais utilisé un générateur automatique fourni par un tuto de Never Utopia et qui est un lien mort maintenant, et j'ai perdu mes accès au forum.
IzumiRK

IzumiRK
****

Messages : 206
Inscrit(e) le : 25/02/2015

http://indare.forumactif.com/
IzumiRK a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par [Nihil] Dim 8 Mar 2015 - 1:30

Ce soir je suis vraiment tête en l'air, j'enchaine bourdes sur bourdes...

Allez, c'est parti, j'espère ne pas dire de bêtise cette fois ♥ !

Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
  <td class="gensmall" align="right" valign="bottom">
        <!-- BEGIN switch_user_logged_in -->
                  <center><span class="gensmall">{LAST_VISIT_DATE} ▬ {CURRENT_TIME}
                    </span></center>
        <center><a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> ▬ <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a> ▬ <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a></center>
  <!-- END switch_user_logged_in -->
    </td>
</tr>
</table>
<div id="conteneur_onglets_cate">
  <div class="onglet_cate">↕Préambule</div>
  <div class="onglet_cate">Gestion des personnages</div>
  <div class="onglet_cate">Extérieur</div>
  <div class="onglet_cate">Bâtiment principal</div>
  <div class="onglet_cate">Bâtiments annexes↕</div><br/>
  <div class="onglet_cate">↕Kochi</div>
  <div class="onglet_cate">Périphérie et ailleurs</div>
  <div class="onglet_cate">Hors RPG↕</div>
</div><br/><br/>
<div id="conteneur_categories">
<!-- BEGIN catrow -->
<!-- BEGIN tablehead -->
<div class="categorie"><
<!-- END tablehead -->
  <!-- BEGIN forumrow -->
  <table class="forumline" id="categories" width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
  <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="top">
 
      </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>
                                </span>
                 
                                  <span class="gensmall" style="color:#71AFD1; float:right;">Messages : {catrow.forumrow.POSTS} || Sujets : {catrow.forumrow.TOPICS}</span><br />
        </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 -->
     
        </span>
      </td>
      <td class="row3" align="center" valign="middle" height="50">
        <span class="gensmall">{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}</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 -->
                  <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /><br/>
        <span class="gensmall">{catrow.forumrow.LAST_POST}</span>
      </td>
  </tr>
</table><img src="{SPACER}" alt="" height="5" width="1" />
  <!-- 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 --></div> <!-- fermeture de .categorie -->
<!-- END tablefoot --><!-- END catrow -->
</div>
[Nihil]

[Nihil]
Membre habitué

Messages : 1215
Inscrit(e) le : 10/12/2009

https://forum.forumactif.com
[Nihil] a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Séparer les forums dans les catégories (bis)

Message par IzumiRK Dim 8 Mar 2015 - 2:06

Ça fonctionne, merci beaucoup =D
IzumiRK

IzumiRK
****

Messages : 206
Inscrit(e) le : 25/02/2015

http://indare.forumactif.com/
IzumiRK a été remercié(e) par l'auteur de ce sujet.

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


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