Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

Go down

In progress Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

Post by Harry Jackson on January 24th 2017, 8:05 am

Technical Details


Forum version : #phpBB3
Position : Member
Concerned browser(s) : Google Chrome
Who the problem concerns : All members
When the problem appeared : January 23rd, 2017
Forum link : http://zex-vietnam.forumvi.com

Description of problem

I've used the code from this tutorial but nothing happens. I'm sure I did exactly the same as what this post instructs.
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: Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

Post by skouliki on January 24th 2017, 9:30 am

avatar
skouliki
Graphic Designer
Graphic Designer

Female Posts : 3905
Reputation : 655
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

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

Sorry, but it does not help me solve my problem Sad
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: Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

Post by APE on January 24th 2017, 1:02 pm

what code do you have in your forum now ?



avatar
APE
Administrator
Administrator

Male Posts : 12320
Reputation : 1283
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

In progress Re: Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

Post by Guest on January 24th 2017, 1:07 pm

It is showing, but not working correct. Collapsing the linklist lol

Try replacing it with this one:

Code:
/***
 * 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() {
   ("JScript <jscriptbrasil at live dot com>, based on Invision.js");
   var style = document.createElement("style"),
      /* Versions:|phpBB3-------------| */
      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://i68.servimg.com/u/f68/15/58/53/29/catego14.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
      '  cursor: pointer;' +
      '  float: right;' +
      '}' +
      '.expand {' +
      '  background: url("https://i68.servimg.com/u/f68/15/58/53/29/catego15.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
      '}';
   document.getElementsByTagName("head")[0].appendChild(style);
 
   switch (oCat[0].className) {
      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;
   }
   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
}

Guest
Guest


Back to top Go down

In progress Re: Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

Post by APE on January 24th 2017, 2:22 pm

ok i see the problem you have changed to much on your templates for this to work.

It looks for key items in your templates to pick the right place to close and open.

so none of the codes we have here will work.



avatar
APE
Administrator
Administrator

Male Posts : 12320
Reputation : 1283
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

In progress Re: Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

Post by Harry Jackson on January 24th 2017, 5:27 pm

@APE wrote:ok i see the problem you have changed to much on your templates for this to work.

It looks for key items in your templates to pick the right place to close and open.

so none of the codes we have here will work.

Do you have any solution for me, please? bwi

I really like this toggle Confused
avatar
Harry Jackson
New Member

Posts : 10
Reputation : 1
Language : English and Vietnamese

http://zex-vietnam.forumvi.com

Back to top Go down

Back to top


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