The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Collapsable category

View previous topic View next topic Go down

In progress Collapsable category

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

Using this code here: http://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

stluee
Forumember

Posts : 44
Reputation : 0
Language : english

Back to top Go down

In progress Re: Collapsable category

Post by APE on 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
http://help.forumotion.com/t102749-category-toggle-all-forums#668821



avatar
APE
Manager
Manager

Male Posts : 10810
Reputation : 1008
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

In progress Re: Collapsable category

Post by stluee on 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.

stluee
Forumember

Posts : 44
Reputation : 0
Language : english

Back to top Go down

In progress Re: Collapsable category

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

hello
the code dont work at all or the result is not good?
avatar
skouliki
Graphic Designer
Graphic Designer

Female Posts : 2992
Reputation : 465
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: Collapsable category

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

Do you have JavaScript Management activated?


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40491
Reputation : 2731
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: Collapsable category

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

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


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40491
Reputation : 2731
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: Collapsable category

Post by APE on 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://illiweb.com/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://illiweb.com/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






avatar
APE
Manager
Manager

Male Posts : 10810
Reputation : 1008
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

In progress Re: Collapsable category

Post by Harry Jackson on 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://illiweb.com/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://illiweb.com/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.
avatar
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 on January 29th 2017, 1:31 am

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

stluee
Forumember

Posts : 44
Reputation : 0
Language : english

Back to top Go down

In progress Re: Collapsable category

Post by APE on 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.



avatar
APE
Manager
Manager

Male Posts : 10810
Reputation : 1008
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

View previous topic View next topic Back to top


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