Astuces Forumactif
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Membres connectés récemment
Voir tous les membres

[PHPBB2]Désactiver un js pour un membre

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

fascicularia
fascicularia
https://altitudetropicale.forums-actifs.com/

Messagefascicularia Ven 31 Aoû 2018 - 13:57

Bonjour  à tous,
j'ai un système d'onglets sur le forum qui pose soucis chez un membre de la communauté.

Apparemment, chez ce membre, le script s'active partiellement lui rendant ainsi la visualisation du forum impossible.

le script est paramétré pour s'activer à a demande du membre et doit afficher le contenu du premier onglet.

la hélas, l'affichage est bon mais il ne peut accéder qu'au premier onglet.

j'aimerai savoir s'il est possible de désactiver ce js pour ce membre ?
Le compte du membre : u1028
Le js
Code:
$(function() {
          'DEVELOPED BY ANGE TUTEUR';
          'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
          'ORIGIN : http://fmdesign.forumotion.com/t472-category-tabs#5772';
        
          // automatically detects the version
          var version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('div.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : document.getElementById('fa_edge') ? 4 : 'badapple';
        
          if (version == 'badapple') {
            if (window.console && console.warn) console.warn('The plugin "fa_tabs" is not supported for your forum version.');
            return;
          }
        
          window.fa_tabs = {
            active : my_getcookie('fa_tab_active') || 0, // active tab
            list : [], // category list
            version : version, // forum version
        
            // language settings
            lang : {
              title : '',
              placeholder : 'Categorie',
              all : 'Tout le forum'
            },
        
            // selectors
            select : {
              content : !version ? '#content-container td:has(> img[height="5"])' : 'main-content',
              category : ['table.M14_forumline:has(.secondarytitle)', '.forabg', '.main:has(.tcr) .main-head', '.borderwrap:has(.index-box)', '.forum-category'][version]
            },
        
            // function for changing the active category
            change : function(index) {
              my_setcookie('fa_tab_active', index); // save the active tab to a cookie
          
              // actions to run if the tab is not "all"
              if (index != 'all') {
                if (fa_tabs.active == 'all') {
                  fa_tabs.tab[0].previousSibling.className = '';
                  fa_tabs.display('none');
                } else {
                  fa_tabs.tab[fa_tabs.active].className = '';
                  fa_tabs.list[fa_tabs.active].style.display = 'none';
                }
        
                fa_tabs.tab[index].className = 'fa_tabactif';
                fa_tabs.list[index].style.display = '';
          
                if (fa_tabs.version == 2) {
                  if (fa_tabs.active != 'all') fa_tabs.list[fa_tabs.active].nextSibling.style.display = 'none';
                  fa_tabs.list[index].nextSibling.style.display = '';
                }
              } else {
                if (fa_tabs.active != 'all') fa_tabs.tab[fa_tabs.active].className = '';
                fa_tabs.tab[0].previousSibling.className = 'fa_tabactif';
                fa_tabs.display('');
              }
          
              fa_tabs.active = index;
            },
        
            // change the display of all categories
            display : function(state) {
              for (var i = 0, j = fa_tabs.list.length; i < j; i++) {
                fa_tabs.list[i].style.display = state;
                if (version == 2) fa_tabs.list[i].nextSibling.style.display = state;
              };
            },
        
            // stop tab scrolling
            stop : function() {
              if (fa_tabs.interval) {
                window.clearInterval(fa_tabs.interval);
                fa_tabs.interval = null;
              }
            },
        
            // scroll tablist
            scroll : function(by, max) {
              if (!fa_tabs.interval) {
                var node = document.getElementById('fa_tablist').firstChild.firstChild;
          
                fa_tabs.interval = window.setInterval(function() {
                  var margin = +node.style.marginLeft.replace(/px/, '');
                  (by < 0 && margin <= max) || (by > 0 && margin >= max) ? fa_tabs.stop() : node.style.marginLeft = margin + by + 'px';
                }, 1);
              }
            }
        
          };
        
          // startup variables
          var frag = document.createDocumentFragment(),
              container = $('<div id="fa_category_tabs"><h2 id="fa_tabs_title">' + fa_tabs.lang.title + '</h2></div>')[0],
              tablist = $('<div id="fa_tablist"style="display:none;"><div class="inner_tabs"><div></div></div></div>')[0],
              catglist = $('<div id="fa_catglist" />')[0],
          
              a = $(fa_tabs.select.category, !version ? $(fa_tabs.select.content)[0] : document.getElementById(fa_tabs.select.content)),
              i = 0,
              j = a.length,
              htmlStr = '<a href="javascript:fa_tabs.change(\'all\');">' + fa_tabs.lang.all + '</a>';
        
          // drop off the main container before the first category
          a[0] && a[0].parentNode.insertBefore(container, a[0]);
        
          // loop through each category
          for (; i < j; i++) {
            if (version == 2) var next = a[i].nextSibling;
        
            // create our tabs
            htmlStr += '<a href="javascript:fa_tabs.change(' + i + ');">' + ($('H2:first', a[i]).text() || fa_tabs.lang.placeholder + ' ' + i) + '</a>';
        
            // append the category to the list and hide it
            catglist.appendChild(a[i]);
            a[i].style.display = 'none';
        
            // get the next sibling as well for punbb
            if (version == 2) {
              catglist.appendChild(next);
              next.style.display = 'none';
            }
        
            fa_tabs.list[i] = a[i]; // cache the category to the array
          }
        
          if (fa_tabs.list[0]) {
            tablist.firstChild.firstChild.innerHTML = htmlStr; // fill in the tablist
            fa_tabs.tab = [].slice.call(tablist.getElementsByTagName('A')); // create an array for the tabs
            fa_tabs.tab.shift(); // remove the all tab
        
            fa_tabs.change(fa_tabs.active); // setup the active tab
        
            // finally add the content to the document
            frag.appendChild(tablist);
            frag.appendChild(catglist);
            container.appendChild(frag);
        
            window.setTimeout(function() {
              if (tablist.firstChild.scrollWidth > tablist.firstChild.clientWidth) {
                tablist.className = 'fa_tabs_overflow';
                tablist.firstChild.firstChild.style.marginLeft = '0px';
                tablist.insertAdjacentHTML('beforeend', '<a class="tab_scroller scroll_left" href="#" onmousedown="fa_tabs.scroll(1, 0); return false;" onclick="fa_tabs.stop(); return false;" onmouseout="fa_tabs.stop();"><</a><a class="tab_scroller scroll_right" href="#" onmousedown="fa_tabs.scroll(-1, -' + (tablist.firstChild.scrollWidth - tablist.firstChild.clientWidth) + '); return false;" onclick="fa_tabs.stop(); return false;" onmouseout="fa_tabs.stop();">></a>');
              }
            }, 100);
          }
        });
        
        $('head').append('<style type="text/css">#fa_tabs_title{color:#333;font-size:24px;font-weight:400;font-family:arial,sans-serif;margin:3px;line-height:24px}.inner_tabs a,a.tab_scroller{font-family:arial,sans-serif;height:20px;line-height:20px}#fa_tablist{position:relative;white-space:nowrap;    text-align: center;}#fa_tablist.fa_tabs_overflow{padding:0 18px}.inner_tabs{overflow:hidden;padding-bottom:1px;margin-bottom:-1px,    text-align: center;}a.tab_scroller{color:#FFF;background:#333;font-size:16px;text-align:center;position:absolute;bottom:2px;width:15px;opacity:.1}a.tab_scroller.scroll_left{left:0}a.tab_scroller.scroll_right{right:0}#fa_tablist:hover a.tab_scroller{opacity:.7}#fa_tablist a.tab_scroller:hover{opacity:1}#fa_catglist{background:transparent;}.inner_tabs a{color:#fff!important;background:transparen;border:2px solid #678500;font-size:11px;font-weight:700;display:inline-block;padding:0 10px;margin:3px 3px 0;border-radius:30px}.inner_tabs a.fa_tabactif,.inner_tabs a:hover{background:rgba(255,0,0,.2);position:relative;bottom:-1px;opacity:1}</style>');

Merci par avance pour votre aide


Dernière édition par fascicularia le Dim 2 Sep 2018 - 0:01, édité 1 fois
photoclic
https://photoclic.forum-pro.fr/

Messagephotoclic Ven 31 Aoû 2018 - 14:48

Bonjour Stéphane,

J'utilise aussi ce JS

Pour exclure un membre, j'ai démarré le script ainsi en ajoutant la ligne avec le if :

Code:

$(function() {
  
if (_userdata["user_id"] != '1028') {

......


Avec à la fin avant le style un crochet ajouté à l'avant dernière ligne:
Code:
 
             .......

              }
            }, 100);
          }
   }
        });
        


Soit le script dans sa totalité:
Code:
    $(function() {
if (_userdata["user_id"] != '1028') {
              'DEVELOPED BY ANGE TUTEUR';
              'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
              'ORIGIN : http://fmdesign.forumotion.com/t472-category-tabs#5772';
         
              // automatically detects the version
              var version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('div.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : document.getElementById('fa_edge') ? 4 : 'badapple';
         
              if (version == 'badapple') {
                if (window.console && console.warn) console.warn('The plugin "fa_tabs" is not supported for your forum version.');
                return;
              }
         
              window.fa_tabs = {
                active : my_getcookie('fa_tab_active') || 0, // active tab
                list : [], // category list
                version : version, // forum version
         
                // language settings
                lang : {
                  title : '',
                  placeholder : 'Categorie',
                  all : 'Tout le forum'
                },
         
                // selectors
                select : {
                  content : !version ? '#content-container td:has(> img[height="5"])' : 'main-content',
                  category : ['table.M14_forumline:has(.secondarytitle)', '.forabg', '.main:has(.tcr) .main-head', '.borderwrap:has(.index-box)', '.forum-category'][version]
                },
         
                // function for changing the active category
                change : function(index) {
                  my_setcookie('fa_tab_active', index); // save the active tab to a cookie
           
                  // actions to run if the tab is not "all"
                  if (index != 'all') {
                    if (fa_tabs.active == 'all') {
                      fa_tabs.tab[0].previousSibling.className = '';
                      fa_tabs.display('none');
                    } else {
                      fa_tabs.tab[fa_tabs.active].className = '';
                      fa_tabs.list[fa_tabs.active].style.display = 'none';
                    }
         
                    fa_tabs.tab[index].className = 'fa_tabactif';
                    fa_tabs.list[index].style.display = '';
           
                    if (fa_tabs.version == 2) {
                      if (fa_tabs.active != 'all') fa_tabs.list[fa_tabs.active].nextSibling.style.display = 'none';
                      fa_tabs.list[index].nextSibling.style.display = '';
                    }
                  } else {
                    if (fa_tabs.active != 'all') fa_tabs.tab[fa_tabs.active].className = '';
                    fa_tabs.tab[0].previousSibling.className = 'fa_tabactif';
                    fa_tabs.display('');
                  }
           
                  fa_tabs.active = index;
                },
         
                // change the display of all categories
                display : function(state) {
                  for (var i = 0, j = fa_tabs.list.length; i < j; i++) {
                    fa_tabs.list[i].style.display = state;
                    if (version == 2) fa_tabs.list[i].nextSibling.style.display = state;
                  };
                },
         
                // stop tab scrolling
                stop : function() {
                  if (fa_tabs.interval) {
                    window.clearInterval(fa_tabs.interval);
                    fa_tabs.interval = null;
                  }
                },
         
                // scroll tablist
                scroll : function(by, max) {
                  if (!fa_tabs.interval) {
                    var node = document.getElementById('fa_tablist').firstChild.firstChild;
           
                    fa_tabs.interval = window.setInterval(function() {
                      var margin = +node.style.marginLeft.replace(/px/, '');
                      (by < 0 && margin <= max) || (by > 0 && margin >= max) ? fa_tabs.stop() : node.style.marginLeft = margin + by + 'px';
                    }, 1);
                  }
                }
         
              };
         
              // startup variables
              var frag = document.createDocumentFragment(),
                  container = $('<div id="fa_category_tabs"><h2 id="fa_tabs_title">' + fa_tabs.lang.title + '</h2></div>')[0],
                  tablist = $('<div id="fa_tablist"style="display:none;"><div class="inner_tabs"><div></div></div></div>')[0],
                  catglist = $('<div id="fa_catglist" />')[0],
           
                  a = $(fa_tabs.select.category, !version ? $(fa_tabs.select.content)[0] : document.getElementById(fa_tabs.select.content)),
                  i = 0,
                  j = a.length,
                  htmlStr = '<a href="javascript:fa_tabs.change(\'all\');">' + fa_tabs.lang.all + '</a>';
         
              // drop off the main container before the first category
              a[0] && a[0].parentNode.insertBefore(container, a[0]);
         
              // loop through each category
              for (; i < j; i++) {
                if (version == 2) var next = a[i].nextSibling;
         
                // create our tabs
                htmlStr += '<a href="javascript:fa_tabs.change(' + i + ');">' + ($('H2:first', a[i]).text() || fa_tabs.lang.placeholder + ' ' + i) + '</a>';
         
                // append the category to the list and hide it
                catglist.appendChild(a[i]);
                a[i].style.display = 'none';
         
                // get the next sibling as well for punbb
                if (version == 2) {
                  catglist.appendChild(next);
                  next.style.display = 'none';
                }
         
                fa_tabs.list[i] = a[i]; // cache the category to the array
              }
         
              if (fa_tabs.list[0]) {
                tablist.firstChild.firstChild.innerHTML = htmlStr; // fill in the tablist
                fa_tabs.tab = [].slice.call(tablist.getElementsByTagName('A')); // create an array for the tabs
                fa_tabs.tab.shift(); // remove the all tab
         
                fa_tabs.change(fa_tabs.active); // setup the active tab
         
                // finally add the content to the document
                frag.appendChild(tablist);
                frag.appendChild(catglist);
                container.appendChild(frag);
         
                window.setTimeout(function() {
                  if (tablist.firstChild.scrollWidth > tablist.firstChild.clientWidth) {
                    tablist.className = 'fa_tabs_overflow';
                    tablist.firstChild.firstChild.style.marginLeft = '0px';
                    tablist.insertAdjacentHTML('beforeend', '<a class="tab_scroller scroll_left" href="#" onmousedown="fa_tabs.scroll(1, 0); return false;" onclick="fa_tabs.stop(); return false;" onmouseout="fa_tabs.stop();"><</a><a class="tab_scroller scroll_right" href="#" onmousedown="fa_tabs.scroll(-1, -' + (tablist.firstChild.scrollWidth - tablist.firstChild.clientWidth) + '); return false;" onclick="fa_tabs.stop(); return false;" onmouseout="fa_tabs.stop();">></a>');
                  }
                }, 100);
              }
}
            });
         
            $('head').append('<style type="text/css">#fa_tabs_title{color:#333;font-size:24px;font-weight:400;font-family:arial,sans-serif;margin:3px;line-height:24px}.inner_tabs a,a.tab_scroller{font-family:arial,sans-serif;height:20px;line-height:20px}#fa_tablist{position:relative;white-space:nowrap;    text-align: center;}#fa_tablist.fa_tabs_overflow{padding:0 18px}.inner_tabs{overflow:hidden;padding-bottom:1px;margin-bottom:-1px,    text-align: center;}a.tab_scroller{color:#FFF;background:#333;font-size:16px;text-align:center;position:absolute;bottom:2px;width:15px;opacity:.1}a.tab_scroller.scroll_left{left:0}a.tab_scroller.scroll_right{right:0}#fa_tablist:hover a.tab_scroller{opacity:.7}#fa_tablist a.tab_scroller:hover{opacity:1}#fa_catglist{background:transparent;}.inner_tabs a{color:#fff!important;background:transparen;border:2px solid #678500;font-size:11px;font-weight:700;display:inline-block;padding:0 10px;margin:3px 3px 0;border-radius:30px}.inner_tabs a.fa_tabactif,.inner_tabs a:hover{background:rgba(255,0,0,.2);position:relative;bottom:-1px;opacity:1}</style>');


Dernière édition par Milouze14 le Ven 31 Aoû 2018 - 19:27, édité 1 fois (Raison : Edit Philippe script dans la totalité)
photoclic
https://photoclic.forum-pro.fr/

Messagephotoclic Ven 31 Aoû 2018 - 23:09

Hello Philippe,

Je vois que tu as rajouté le script dans sa totalité. Impec.
Merci, bien plus clair avec ce complément tape la
fascicularia
fascicularia
https://altitudetropicale.forums-actifs.com/

Messagefascicularia Ven 31 Aoû 2018 - 23:24

Merci Photoclic,
je vais tester.

edit : fonctionne sous opera mais n'a aucune action avec la  derniére version de  firefox (Firefox 61.0.2).

Le membre rencontre justement le soucis avec cette version.

j'ai fait un essai en mettant mon identifiant de compte cad 1 et je rencontre le même soucis.

le script initialement doit afficher l'entièreté du forum à la connexion.

Là malheureusement, il affiche uniquement le premier onglet intitulé "vie du site" sans que le membre ne mette en route le sytème à onglets.

le soucis est d'ailleurs aussi visible en temps qu'invité.

En images après avoir vidé les caches via ccleaner et sous firefox 61.0.2

En tant qu'invité


 [PHPBB2]Désactiver un js pour un membre 110


Comme vous le voyez, c'est l'onglet intitulé vie du site qui s'affiche au lieu de l'entièreté du forum

En se connectant


 [PHPBB2]Désactiver un js pour un membre 210


Même soucis

Si j'active le sytème à onglets
 on peut voir que le js se positionne sur l'onglet intitulé vie du site au lieu de "tout le forum".
 [PHPBB2]Désactiver un js pour un membre 310
Milouze14
Milouze14
Fondateur

https://www.milouze14.net/

MessageMilouze14 Sam 1 Sep 2018 - 11:24

Hello Stéphane,

tu peux tester ce script en mentionnant l'id du membre en question

Code:
$(function() {
if (_userdata["user_id"] == '1')
{
$('#fa_category_tabs').find('.forumline').show(); 
$('#fa_tablist,#fa_tabs_title').hide(); 
}
});
fascicularia
fascicularia
https://altitudetropicale.forums-actifs.com/

Messagefascicularia Sam 1 Sep 2018 - 11:56

Bonjour Philippe,
toujours le même soucis sous Firefox 61.0.2 et également sous opéra.

A la limite, ne serait-il pas possible de voir ce qui cloche avec ce js sous Firefox 61.0.2 ? Cela éviterait que d'autres membres utilisant ce navigateur ne rencontrent le même soucis.

Apparemment, ce navigateur ne respecte pas cette partie du js (du moins je suppose)

Code:
 lang : {
              title : '',
              placeholder : 'Categorie',
              all : 'Tout le forum'
            },

Milouze14
Milouze14
Fondateur

https://www.milouze14.net/

MessageMilouze14 Sam 1 Sep 2018 - 13:03

Hum, étonnant car j'utilise cette version et tout fonctionne pour ma part.
Je pencherais plus pour un conflit avec un autre script!!

Le script que je t'ai donné affiche tous les forums et supprime la barre des onglets.


photoclic
https://photoclic.forum-pro.fr/

Messagephotoclic Sam 1 Sep 2018 - 13:19

Bonjour Philippe et Stéphane.

J'ai la même version de firefox et je ne rencontre pas le souci avec le script initial de Ange tuteur.
fascicularia
fascicularia
https://altitudetropicale.forums-actifs.com/

Messagefascicularia Sam 1 Sep 2018 - 13:44

Bon, je n'ai plus qu'à explorer la piste du conflit avec un autre js.

je m'en occupe dés Lundi.

Pour le weekend, je vais tout bonnement le désactiver.

Merci à vous deux pour cette aide.


Dernière édition par fascicularia le Sam 1 Sep 2018 - 14:05, édité 1 fois
photoclic
https://photoclic.forum-pro.fr/

Messagephotoclic Sam 1 Sep 2018 - 13:52

fascicularia a écrit:Bon, je n'ai plus qu'à explorer la piste du conflit avec un autre js.

je m'en occupe dés Lundi.

Pour le weekend, je vais tout bonnement le désactiver.

Ou peut-être une modif que tu as faites dans le script original de Ange Tuteur.
fascicularia
fascicularia
https://altitudetropicale.forums-actifs.com/

Messagefascicularia Sam 1 Sep 2018 - 14:56

Le script original n'a ét modifié que sur cette partie

Code:
 category : ['table.M14_forumline:has(.secondarytitle)'


et sur la mise en forme des onglets via le css.
photoclic
https://photoclic.forum-pro.fr/

Messagephotoclic Sam 1 Sep 2018 - 16:56

Tu as aussi cette ligne différente dans mon script j'ai 'all' et toi 'index'
Code:
my_setcookie('fa_tab_active', 'all'); //remplacé 'index' par 'all' pour revenir sur all dans cookie

Il y a peut-être d'autres trucs par rapport au css.

Je te donne mon script et qui fonctionne à condition de laisser 'all'.

Code:

//Onglets catégories
$(function() {
          'DEVELOPED BY ANGE TUTEUR';
          'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
          'ORIGIN : https://fmdesign.forumotion.com/t472-category-tabs#5772';
       
          // automatically detects the version
          var version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('div.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : document.getElementById('fa_edge') ? 4 : 'badapple';
       
          if (version == 'badapple') {
            if (window.console && console.warn) console.warn('The plugin "fa_tabs" is not supported for your forum version.');
            return;
          }
       
          window.fa_tabs = {
            active : my_getcookie('fa_tab_active') || 0, // active tab
            list : [], // category list
            version : version, // forum version
       
            // language settings
              lang : {
              title : 'Selectionner une Catégorie',
              placeholder : 'Categorie',
              all : 'Toutes les catégories'
            },

       
            // selectors
            select : {
              content : !version ? '#content-container td:has(> img[height="5"])' : 'main-content',
              category : ['.forumline:has(.secondarytitle)', '.forabg', '.main:has(.tcr) .main-head', '.borderwrap:has(.index-box)', '.forum-category'][version]
            },
       
            // function for changing the active category
            change : function(index) {
              my_setcookie('fa_tab_active', 'all'); //remplacé 'index' par 'all' pour revenir sur all dans cookie
         
              // actions to run if the tab is not "all"
              if (index != 'all') {
                if (fa_tabs.active == 'all') {
                  fa_tabs.tab[0].previousSibling.className = '';
                  fa_tabs.display('none');
                } else {
                  fa_tabs.tab[fa_tabs.active].className = '';
                  fa_tabs.list[fa_tabs.active].style.display = 'none';
                }
       
                fa_tabs.tab[index].className = 'fa_tabactif';
                fa_tabs.list[index].style.display = '';
         
                if (fa_tabs.version == 2) {
                  if (fa_tabs.active != 'all') fa_tabs.list[fa_tabs.active].nextSibling.style.display = 'none';
                  fa_tabs.list[index].nextSibling.style.display = '';
                }
              } else {
                if (fa_tabs.active != 'all') fa_tabs.tab[fa_tabs.active].className = '';
                fa_tabs.tab[0].previousSibling.className = 'fa_tabactif';
                fa_tabs.display('');
              }
         
              fa_tabs.active = index;
            },
     
            // change the display of all categories
            display : function(state) {
              for (var i = 0, j = fa_tabs.list.length; i < j; i++) {
                fa_tabs.list[i].style.display = state;
                if (version == 2) fa_tabs.list[i].nextSibling.style.display = state;
              };
            },
       
            // stop tab scrolling
            stop : function() {
              if (fa_tabs.interval) {
                window.clearInterval(fa_tabs.interval);
                fa_tabs.interval = null;
              }
            },
       
            // scroll tablist
            scroll : function(by, max) {
              if (!fa_tabs.interval) {
                var node = document.getElementById('fa_tablist').firstChild.firstChild;
         
                fa_tabs.interval = window.setInterval(function() {
                  var margin = +node.style.marginLeft.replace(/px/, '');
                  (by < 0 && margin <= max) || (by > 0 && margin >= max) ? fa_tabs.stop() : node.style.marginLeft = margin + by + 'px';
                }, 1);
              }
            }
       
          };
       
          // startup variables
          var frag = document.createDocumentFragment(),
              container = $('<div id="fa_category_tabs"><h2 id="fa_tabs_title">' + fa_tabs.lang.title + '</h2></div>')[0],
              tablist = $('<div id="fa_tablist"><div class="inner_tabs"><div></div></div></div>')[0],
              catglist = $('<div id="fa_catglist" />')[0],
         
              a = $(fa_tabs.select.category, !version ? $(fa_tabs.select.content)[0] : document.getElementById(fa_tabs.select.content)),
              i = 0,
              j = a.length,
              htmlStr = '<a href="javascript:fa_tabs.change(\'all\');">' + fa_tabs.lang.all + '</a>';
       
          // drop off the main container before the first category
          a[0] && a[0].parentNode.insertBefore(container, a[0]);
       
          // loop through each category
          for (; i < j; i++) {
            if (version == 2) var next = a[i].nextSibling;
       
            // create our tabs
            htmlStr += '<a href="javascript:fa_tabs.change(' + i + ');">' + ($('H2:first', a[i]).text() || fa_tabs.lang.placeholder + ' ' + i) + '</a>';
       
            // append the category to the list and hide it
            catglist.appendChild(a[i]);
            a[i].style.display = 'none';
       
            // get the next sibling as well for punbb
            if (version == 2) {
              catglist.appendChild(next);
              next.style.display = 'none';
            }
       
            fa_tabs.list[i] = a[i]; // cache the category to the array
          }
       
          if (fa_tabs.list[0]) {
            tablist.firstChild.firstChild.innerHTML = htmlStr; // fill in the tablist
            fa_tabs.tab = [].slice.call(tablist.getElementsByTagName('A')); // create an array for the tabs
            fa_tabs.tab.shift(); // remove the all tab
       
            fa_tabs.change(fa_tabs.active); // setup the active tab
       
            // finally add the content to the document
            frag.appendChild(tablist);
            frag.appendChild(catglist);
            container.appendChild(frag);
       
            window.setTimeout(function() {
              if (tablist.firstChild.scrollWidth > tablist.firstChild.clientWidth) {
                tablist.className = 'fa_tabs_overflow';
                tablist.firstChild.firstChild.style.marginLeft = '0px';
                tablist.insertAdjacentHTML('beforeend', '<a class="tab_scroller scroll_left" href="#" onmousedown="fa_tabs.scroll(1, 0); return false;" onclick="fa_tabs.stop(); return false;" onmouseout="fa_tabs.stop();"><</a><a class="tab_scroller scroll_right" href="#" onmousedown="fa_tabs.scroll(-1, -' + (tablist.firstChild.scrollWidth - tablist.firstChild.clientWidth) + '); return false;" onclick="fa_tabs.stop(); return false;" onmouseout="fa_tabs.stop();">></a>');
              }
            }, 100);
          }
        });
       
$('head').append('<style type="text/css">#fa_tabs_title{color:#3b699c;font-size:20px;font-weight:400;font-family:arial,sans-serif;margin:3px;line-height:24px}.inner_tabs a,a.tab_scroller{font-family:arial,sans-serif;height:30px;line-height:30px}#fa_tablist{position:relative;white-space:nowrap}#fa_tablist.fa_tabs_overflow{padding:0 18px}.inner_tabs{overflow:hidden;padding-bottom:1px;margin-bottom:-1px}a.tab_scroller{color:#FFF;background:#333;font-size:16px;text-align:center;position:absolute;bottom:2px;width:15px;opacity:.1}a.tab_scroller.scroll_left{left:0}a.tab_scroller.scroll_right{right:0}#fa_tablist:hover a.tab_scroller{opacity:.7}#fa_tablist a.tab_scroller:hover{opacity:1}#fa_catglist{padding:3px 3px}.inner_tabs a{color:#3b699c !important;background:#DDD;border:1px solid #BABABA;border-bottom:none;border-radius:10px 10px 0 0;text-decoration:none!important;font-size:12px;font-weight:700;display:inline-block;padding:0 10px;margin:3px 3px 0}.inner_tabs a.fa_tabactif,.inner_tabs a:hover{background:#EEE;position:relative;bottom:-1px;opacity:1}</style>');

Peut-être y remettre cette ligne pour une adaptation à tes templates:
Code:
    category : ['table.M14_forumline:has(.secondarytitle)'

Milouze14
Milouze14
Fondateur

https://www.milouze14.net/

MessageMilouze14 Sam 1 Sep 2018 - 19:46

Bien vu Serge,
Code:
 my_setcookie('fa_tab_active', index); // save the active tab to a cookie

A remplacer par:
Code:
 my_setcookie('fa_tab_active','all'); // save the active tab to a cookie
fascicularia
fascicularia
https://altitudetropicale.forums-actifs.com/

Messagefascicularia Dim 2 Sep 2018 - 0:00

Chapeau bas Serge, 
Cela a résolu le soucis.

Merci à vous deux pour cette aide et bon weekend.
Milouze14
Milouze14
Fondateur

https://www.milouze14.net/

MessageMilouze14 Dim 2 Sep 2018 - 4:12

Hello Stéphane, @fascicularia

je met le tag résolu clin oeil .

-Staff du Forum Milouze14-



  • Hello 
    Sujet résolu et déplacé dans le forum adéquat.

Pour toute information,merci de contacter un Membre du Staff

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

Créer un compte ou se connecter pour répondre

Vous devez être membre pour répondre.

S'enregistrer

Rejoignez notre communauté ! C'est facile !


S'enregistrer

Connexion

Vous êtes déjà membre ? Aucun soucis, cliquez ici pour vous connecter.


Connexion

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