The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Collapsable category

5 posters

Go down

In progress Collapsable category

Post by stluee January 17th 2017, 12:45 am

Using this code here: https://help.forumotion.com/t130001-collapsible-categories

For this forum here http://noplacelikehome.forumotion.com/

I cant get it to work.Is this an older code? Is there a etter one I can use?

Thank you
avatar
stluee
Forumember

Posts : 47
Reputation : 0
Language : english

Back to top Go down

In progress Re: Collapsable category

Post by Ape January 17th 2017, 2:32 am

hello i have looked over your profile here and you don't have your Forum Version added to your profile  can you please tell me what one you are using so we can give you the right code.

Thank you.

Also update your profile with your forum link and browser info this helps us work your problem out faster

EDIT: please look in the tips and tricks for most plugin's
https://help.forumotion.com/t102749-category-toggle-all-forums#668821


Collapsable category  Left1212Collapsable category  Center11Collapsable category  Right112
Collapsable category  Ape_b110
Collapsable category  Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Collapsable category

Post by stluee January 18th 2017, 4:45 am

Using punb and that 2nd code didnt work either. I plaaced it in java like the instructions said.
I am helping the administrator.
avatar
stluee
Forumember

Posts : 47
Reputation : 0
Language : english

Back to top Go down

In progress Re: Collapsable category

Post by skouliki January 18th 2017, 11:20 am

hello
the code dont work at all or the result is not good?
skouliki
skouliki
Manager
Manager

Female Posts : 15026
Reputation : 1680
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: Collapsable category

Post by SLGray January 18th 2017, 9:43 pm

Do you have JavaScript Management activated?


Collapsable category  Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51452
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Collapsable category

Post by SLGray January 20th 2017, 7:03 am

I have tested the linked tutorial, and it does not work at all.


Collapsable category  Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51452
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Collapsable category

Post by Ape January 20th 2017, 8:42 pm

ok This one is the one i use myself
Code:
/**************************************************************************
 Category Toggle
 ***************************************************************************/

         
         
         
        /***
        * Application: toggle Category
        * Description: Show/hide categories!
        * Version: 0.02632015-jq1.9.1
        *        RC1 (Release candidate 1!) - Invision
        * Author: JScript - 2015/03/26 - based on Invision.js
        * This work is free. You can redistribute it and/or modify it
        * under the terms of the WTFPL, Version 2
        */
                $(function() {
          if (_userdata.page_desktop) return;
          ("JScript <jscriptbrasil at live dot com>, based on Invision.js");
          var style = document.createElement("style"),
              /* Versions:|phpBB2----------------------------------------|  |phpBB3-------------|    |PunBB-----------------|  |Invision already have it!| */
              oCat = $('#content-container .three-col td:eq(1) .forumline, #main-content .forabg, #main-content .main-head'),
              oThis = null,
              oTemp = null,
              sEval = '';
       
          style.type = "text/css";
          style.innerHTML =
              '.contract, .expand {' +
              '  background: url("http://2img.net/i/fa/invision/exp_minus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
              '  cursor: pointer;' +
              '  float: right;' +
'  padding-right: 55px;' +
'  padding-top: 10px;' +
'  padding-bottom: 19px;' +
              '  margin-top: -35px;' +
              '}' +
              '.expand {' +
              '  background: url("http://2img.net/i/fa/invision/exp_plus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
              '}';
          document.getElementsByTagName("head")[0].appendChild(style);
       
          switch (oCat[0].className) {
              case 'forumline': //phpBB2
                sEval = "oTemp = oThis.find('tr').first();oTemp.addClass('title-bar');" +
                    "oTemp.find('th:last').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\" style=\"margin-top: -15px;\">&nbsp;&nbsp;&nbsp;</div>');" +
                    "oThis.find('tr').not('.title-bar').addClass('c' + i);";
                break;
              case 'forabg': //phpBB3
                sEval = "oThis.find('ul.topiclist:first dl.icon').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\">&nbsp;&nbsp;&nbsp;</div>');" +
                    "oThis.find('ul.topiclist.forums').attr('id', 'c' + i);";
                break;
              case 'main-head': //PunBB
                sEval = "oThis.find('h2').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\">&nbsp;&nbsp;&nbsp;</div>');" +
                    "oThis.next().attr('id', 'c' + i);";
                break;
          }
          for (var i = 0, len = oCat.length; i < len; i++) {
              oThis = $(oCat[i]);
              eval(sEval);
          }
       
          initCategories();
        });
        // by invision.js
        function initCategories() {
          var id;
          cookies = document.cookie.split('; ');
          for (var i = 0; i < cookies.length; i++) {
              if (cookies[i].charAt(0) == '_') {
                cookie = cookies[i].split('=');
                if (cookie[1] == '1') {
                    id = cookie[0].substring(1);
                    if (document.getElementById(id)) {
                      toggleCategory(id)
                    }
                }
              }
          }
        }
        // by invision.js, modified by JScript
        function toggleCategory(id) {
          var obj = document.getElementById(id);
          var button = document.getElementById('b' + id);
          if (obj) {
              var toggle = obj.style.display == 'none';
              obj.style.display = toggle ? '' : 'none';
          } else {
              var elems = document.getElementsByClassName(id);
              for (var i = 0, len = elems.length; i < len; i++) {
                var toggle = elems[i].style.display == 'none';
                elems[i].style.display = toggle ? '' : 'none';
              }
          }
          button.className = toggle ? 'contract' : 'expand';
          my_setcookie('_' + id, toggle ? '' : '1', true);
          return false
        }
       
        /*
        ▲ -> contract
        ▼ -> expand
        */


This code is working 100% on phpbb3 and should work ok in all other forums to.

I know this is working as i am using it on my 3 sites Smile





Collapsable category  Left1212Collapsable category  Center11Collapsable category  Right112
Collapsable category  Ape_b110
Collapsable category  Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Collapsable category

Post by Harry Jackson January 24th 2017, 12:19 pm

APE wrote:ok This one is the one i use myself
Code:
/**************************************************************************
 Category Toggle
 ***************************************************************************/

         
         
         
        /***
        * Application: toggle Category
        * Description: Show/hide categories!
        * Version: 0.02632015-jq1.9.1
        *        RC1 (Release candidate 1!) - Invision
        * Author: JScript - 2015/03/26 - based on Invision.js
        * This work is free. You can redistribute it and/or modify it
        * under the terms of the WTFPL, Version 2
        */
                $(function() {
          if (_userdata.page_desktop) return;
          ("JScript <jscriptbrasil at live dot com>, based on Invision.js");
          var style = document.createElement("style"),
              /* Versions:|phpBB2----------------------------------------|  |phpBB3-------------|    |PunBB-----------------|  |Invision already have it!| */
              oCat = $('#content-container .three-col td:eq(1) .forumline, #main-content .forabg, #main-content .main-head'),
              oThis = null,
              oTemp = null,
              sEval = '';
       
          style.type = "text/css";
          style.innerHTML =
              '.contract, .expand {' +
              '  background: url("http://2img.net/i/fa/invision/exp_minus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
              '  cursor: pointer;' +
              '  float: right;' +
'  padding-right: 55px;' +
'  padding-top: 10px;' +
'  padding-bottom: 19px;' +
              '  margin-top: -35px;' +
              '}' +
              '.expand {' +
              '  background: url("http://2img.net/i/fa/invision/exp_plus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
              '}';
          document.getElementsByTagName("head")[0].appendChild(style);
       
          switch (oCat[0].className) {
              case 'forumline': //phpBB2
                sEval = "oTemp = oThis.find('tr').first();oTemp.addClass('title-bar');" +
                    "oTemp.find('th:last').append('<div onclick="toggleCategory(\\'c' + i + '\\');" id="bc' + i + '" class="contract" style="margin-top: -15px;">&nbsp;&nbsp;&nbsp;</div>');" +
                    "oThis.find('tr').not('.title-bar').addClass('c' + i);";
                break;
              case 'forabg': //phpBB3
                sEval = "oThis.find('ul.topiclist:first dl.icon').append('<div onclick="toggleCategory(\\'c' + i + '\\');" id="bc' + i + '" class="contract">&nbsp;&nbsp;&nbsp;</div>');" +
                    "oThis.find('ul.topiclist.forums').attr('id', 'c' + i);";
                break;
              case 'main-head': //PunBB
                sEval = "oThis.find('h2').append('<div onclick="toggleCategory(\\'c' + i + '\\');" id="bc' + i + '" class="contract">&nbsp;&nbsp;&nbsp;</div>');" +
                    "oThis.next().attr('id', 'c' + i);";
                break;
          }
          for (var i = 0, len = oCat.length; i < len; i++) {
              oThis = $(oCat[i]);
              eval(sEval);
          }
       
          initCategories();
        });
        // by invision.js
        function initCategories() {
          var id;
          cookies = document.cookie.split('; ');
          for (var i = 0; i < cookies.length; i++) {
              if (cookies[i].charAt(0) == '_') {
                cookie = cookies[i].split('=');
                if (cookie[1] == '1') {
                    id = cookie[0].substring(1);
                    if (document.getElementById(id)) {
                      toggleCategory(id)
                    }
                }
              }
          }
        }
        // by invision.js, modified by JScript
        function toggleCategory(id) {
          var obj = document.getElementById(id);
          var button = document.getElementById('b' + id);
          if (obj) {
              var toggle = obj.style.display == 'none';
              obj.style.display = toggle ? '' : 'none';
          } else {
              var elems = document.getElementsByClassName(id);
              for (var i = 0, len = elems.length; i < len; i++) {
                var toggle = elems[i].style.display == 'none';
                elems[i].style.display = toggle ? '' : 'none';
              }
          }
          button.className = toggle ? 'contract' : 'expand';
          my_setcookie('_' + id, toggle ? '' : '1', true);
          return false
        }
       
        /*
        ▲ -> contract
        ▼ -> expand
        */


This code is working 100% on phpbb3 and should work ok in all other forums to.

I know this is working as i am using it on my 3 sites Smile




I'm using a forumotion PHPBB3 forum and this does not work in it.
Harry Jackson
Harry Jackson
New Member

Posts : 10
Reputation : 1
Language : English and Vietnamese

http://zex-vietnam.forumvi.com

Back to top Go down

In progress Re: Collapsable category

Post by stluee January 29th 2017, 1:31 am

It isnt working on my side. Where is it placed ?Does this new code go to javascript?
avatar
stluee
Forumember

Posts : 47
Reputation : 0
Language : english

Back to top Go down

In progress Re: Collapsable category

Post by Ape January 29th 2017, 3:34 pm

yes it should be added to the JavaScript system and make sure the setting is turned on and marked as Home page only.


Collapsable category  Left1212Collapsable category  Center11Collapsable category  Right112
Collapsable category  Ape_b110
Collapsable category  Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum