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.

How to get Category Toggle working on PHPBB3?

4 posters

Page 1 of 2 1, 2  Next

Go down

Solved How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 8th 2017, 3:28 pm

Hi dear Forumotioners,

I'm working on an upgrade to PHPBB3 for our official PBPBB2 forum, so I made a testforum for it which you can find Here !

I've added the Category Toggle from this tutorial: https://help.forumotion.com/t102749-category-toggle-all-forums#668821

But it doesn't work, the pictures don't show up and nothing happens as you can see there..
Does anyone have an idea how to get this in working order?

Thanks for your time in advance Smile
Kind Regards,
Tonny Kamper


Last edited by TonnyKamper on December 13th 2017, 1:43 am; edited 1 time in total
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 9th 2017, 1:09 am

So you will be installing a phpBB 3 theme on your phpBB 2 forum which will changed it into phpBB 3?


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 9th 2017, 2:23 am

SLGray wrote:So you will be installing a phpBB 3 theme on your phpBB 2 forum which will changed it into phpBB 3?

Yes I am considering that @SLGray thanks for your reply, it's high time our phpbb2 get's an upgrade.. Smile I know I will have to change version to phpbb3 first with a standard version skin on our official forum before I can import the skin I made on the testforum.. I'm also testing Invision and ModernBB on 2 other testforums and I haven't decided yet which one is the best to work with.. but I want to have the skins finished first before deciding..
This phpbb3 skin I'm working on is almost to my liking, it only lacks the category toggle feature, which I need because our official forum has a lot of categories.

I've searched through the archives but found not one solution that worked or even partially worked, I found on the Dutch Helpforum this other JS and CSS for phpbb3 from january 2016, which it's quite recent I figured..
JS
Code:
$(function() {
  var oCat = $('#main-content .forabg'),
      oThis = null,
      oTemp = null,
      sEval = '';
 
  sEval = "oThis.find('ul.topiclist:first dl.icon').append('<div onclick=\"toggleCategory(\'c' + i + '\');\" id=\"bc' + i + '\" class=\"contract\">  </div>');" +
            "oThis.find('ul.topiclist.forums').attr('id', 'c' + i);";

  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
}
CSS
Code:
.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;
}
.expand {
  background: url("http://2img.net/i/fa/invision/exp_plus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);
}
But even that isn't doing the job, so I ran out of options and came here to ask for help, because javascript is one thing I haven't mastered yet blackeye

Kind regards and thanks for your time,
Tonny Kamper
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 9th 2017, 2:46 am

How about using ModenBB?  It has the feature.


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 9th 2017, 1:59 pm

SLGray wrote:How about using ModenBB?  It has the feature.

Yeah I noticed that @SLGray but I haven't got around to editing that one yet, I didn't know how to change the looks and position of that navbar because it's in the way of our banner, so I started with the phpbb3 and invision versions first, since I recently learned from you guys here how to find the selectors of the elements by rightclicking and inspect element in the browser, that was a big revelation to me.. it made me understand so much more about css than I could ever dreamed of !

So I wondered if my phpbb2, invision and modernbb have this feature working, why isn't it working on my phpbb3, while I use the code from official tutorials ? Could this be related to the recent update to a higher version of the standard JS that's already build in into the forums, so it outdated those codes from the tutorials ? I'm just guessing here.. Rolling Eyes

Kind regards,
Tonny Kamper.
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by Ape December 9th 2017, 6:04 pm

The code i use is this one

Note you will have to change some icons on it thou.
Javascript:
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("https://i.servimg.com/u/f35/13/25/37/43/mine10.png") 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("https://i.servimg.com/u/f35/13/25/37/43/add10.png") 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
        */



CSS files:
Code:
.contract, .expand {
    background: url("https://i.servimg.com/u/f35/13/25/37/43/mine10.png") 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("https://i.servimg.com/u/f35/13/25/37/43/add10.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);
}
This code was gave to me by the one and only Ange Tuteur


How to get Category Toggle working on PHPBB3? Left1212How to get Category Toggle working on PHPBB3? Center11How to get Category Toggle working on PHPBB3? Right112
How to get Category Toggle working on PHPBB3? Ape_b110
How to get Category Toggle working on PHPBB3? Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 9th 2017, 8:14 pm

Thank you very much for helping @APE Smile Ange's codes are usually fantastic, so I replaced the icons for the ones I prefer to have, but nothing is showing up..
The code is ticked on Indexpage and the css code is in place, but why is it still not working? Sad

Kind regards,
Tonny Kamper
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by Ape December 10th 2017, 2:21 am

so you have it set to In the home page only right ?

It looks to me that you have other Codes that maybe messing this one up.

try and remove all the other codes and see if that makes it work.


How to get Category Toggle working on PHPBB3? Left1212How to get Category Toggle working on PHPBB3? Center11How to get Category Toggle working on PHPBB3? Right112
How to get Category Toggle working on PHPBB3? Ape_b110
How to get Category Toggle working on PHPBB3? Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 2:00 pm

APE wrote:so you have it set to In the home page only right ?

It looks to me that you have other Codes that maybe messing this one up.

try and remove all the other codes and see if that makes it work.

Thank you for your assistence @APE
Yes the script is set to Homepage only (Index) I have disabled all other javascripts but it didn't made any difference, it still isn't working, so it isn't any of the other scripts that's causing the problem I assume..

Maybe it's a stupid question or a wild guess because I really have little knowledge of javascript, but could it be possible that the script used wrong selectors?

I ask this because I had to adjust 2 other scripts before by addressing some things in the Dutch language instead of the English which did the trick, I don't know why but it did.. I also dicovered while searching through thousands of posts here and trying to apply the given answers to my site, that my phpbb3 selectors often differ from the ones in the posts, I compared them through inspect element and saw that they had a different selector on my forum..

Kind regards,
Tonny Kamper
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by Ape December 10th 2017, 2:15 pm

The basic Javascripts should work on all forums but if you have made a lot of change to your Templates then it could give lots of problems.

The code i have gave should work on all of our forums the only time it will not work is when you change things in your templates.

if you have a lot of change try and force your templates to default and see if it works then.


How to get Category Toggle working on PHPBB3? Left1212How to get Category Toggle working on PHPBB3? Center11How to get Category Toggle working on PHPBB3? Right112
How to get Category Toggle working on PHPBB3? Ape_b110
How to get Category Toggle working on PHPBB3? Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 2:57 pm

APE wrote:The basic Javascripts should work on all forums but if you have made a lot of change to your Templates then it could give lots of problems.

The code i have gave should work on all of our forums the only time it will not work is when you change things in your templates.

if you have a lot of change try and force your templates to default and see if it works then.

Thanks again @APE
I had only 2 minor changes to the index_body and the viewtopic_body templates, but I did forced the default templates and it made no diffence, I even disabled the widgets and the portal but even that made no difference, the toggle category still isn't working, not even the icons are displayed..
I even took out the category header picture to see if the toggle icons were hiding behind it, but to no avail, it's so frustrating.. scratch

Kind regards,
Tonny Kamper
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by Ape December 10th 2017, 3:28 pm

Hmm really strange Think and the forum is phpbb3 right ?


How to get Category Toggle working on PHPBB3? Left1212How to get Category Toggle working on PHPBB3? Center11How to get Category Toggle working on PHPBB3? Right112
How to get Category Toggle working on PHPBB3? Ape_b110
How to get Category Toggle working on PHPBB3? Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 3:35 pm

APE wrote:Hmm really strange Think and the forum is phpbb3 right ?

Yes @APE in the display it says: phpBB3 (prosilver)
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by Ape December 10th 2017, 3:45 pm

okay let me think about this some more it is got to be some thing we are missing LOL Think


How to get Category Toggle working on PHPBB3? Left1212How to get Category Toggle working on PHPBB3? Center11How to get Category Toggle working on PHPBB3? Right112
How to get Category Toggle working on PHPBB3? Ape_b110
How to get Category Toggle working on PHPBB3? Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 4:17 pm

APE wrote:okay let me think about this some more it is got to be some thing we are missing LOL Think

Okay @APE I hope you can come up with something Smile
If you need it I can PM you login data of the founder account, so you can check it out for yourself...
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 10th 2017, 6:12 pm

Did you remove the other tutorial before adding APE's?


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 7:07 pm

SLGray wrote:Did you remove the other tutorial before adding APE's?

Yes I did @SLGray I replaced it with APE's, thank you for thinking with me Smile
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 10th 2017, 7:13 pm

Could you send me a test account bu PM?


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 7:18 pm

SLGray wrote:Could you send me a test account bu PM?

Yes offcourse @SLGray do you want access to regular admin rights, or to the founders account?
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 10th 2017, 7:24 pm

Admin


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 7:33 pm

SLGray wrote:Admin

PM is sent to you @SLGray , thank you Bow 3
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 10th 2017, 7:34 pm

Thanks.  PM received.


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 10th 2017, 8:01 pm

APE wrote:The code i use is this one

Note you will have to change some icons on it thou.
Javascript:
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("https://i.servimg.com/u/f35/13/25/37/43/mine10.png") 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("https://i.servimg.com/u/f35/13/25/37/43/add10.png") 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
        */



CSS files:
Code:
.contract, .expand {
    background: url("https://i.servimg.com/u/f35/13/25/37/43/mine10.png") 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("https://i.servimg.com/u/f35/13/25/37/43/add10.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);
}
This code was gave to me by the one and only Ange Tuteur
Is there not CSS in the JavaScript?


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 8:09 pm

Is that a question for @APE or for me @SLGray ?
My former code from the tutorial was almost the same as this one and didn't required a seperate css code..
The one I have on my phpbb2 version did needed one..
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by SLGray December 10th 2017, 8:12 pm

I removed the CSS you had and replaced it with APE's.

My question was to @APE.  Also I sent the log in information to APE.  I can not locate the issue.


How to get Category Toggle working on PHPBB3? 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 : 51568
Reputation : 3525
Language : English
Location : United States

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 8:15 pm

SLGray wrote:I removed the CSS you had and replaced it with APE's.

My question was to @APE.  Also I sent the log in information to APE.  I can not locate the issue.

Okay, thank you very much for your assistence @SLGray Bow 3

Kind regards,
Tonny Kamper
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 8:24 pm

SLGray wrote:Did you change the icons in the JavaScript?

I just did that @SLGray also replaced them in the css, but it still isn't showing up..
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by Ape December 10th 2017, 9:35 pm

I over rid the ones in the Javascript as it was not working right on my forum the + and the - was not showing right and i needed to make a button.

I will log in your forum later after i get back from picking my wife up from the hospital.


How to get Category Toggle working on PHPBB3? Left1212How to get Category Toggle working on PHPBB3? Center11How to get Category Toggle working on PHPBB3? Right112
How to get Category Toggle working on PHPBB3? Ape_b110
How to get Category Toggle working on PHPBB3? Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by TonnyKamper December 10th 2017, 9:44 pm

APE wrote:I over rid the ones in the Javascript as it was not working right on my forum the + and the - was not showing right and i needed to make a button.

I will log in your forum later after i get back from picking my wife up from the hospital.

Okay, thank you in advance @APE I'll wait patiently and I hope your wife is doing okay!!

Kind regards,
Tonny Kamper
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1098
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: How to get Category Toggle working on PHPBB3?

Post by Ape December 11th 2017, 2:23 am

Just an update on test done by me.

Turned off templates
Turned off CSS files
Turned off Widgets
Turned off JavaScripts

Installed the full forum on my test forum and did not have a problem with it so I am really lost on to why this will not show up on the forum.


How to get Category Toggle working on PHPBB3? Left1212How to get Category Toggle working on PHPBB3? Center11How to get Category Toggle working on PHPBB3? Right112
How to get Category Toggle working on PHPBB3? Ape_b110
How to get Category Toggle working on PHPBB3? Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19450
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Page 1 of 2 1, 2  Next

Back to top

- Similar topics

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