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.

Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

3 posters

Go down

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

Post by Harry Jackson 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.
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: Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

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

skouliki
skouliki
Manager
Manager

Female Posts : 15417
Reputation : 1710
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 January 24th 2017, 12:22 pm

skouliki wrote:hello 

maybe this will help you https://help.forumotion.com/t150484-collapsable-category#1037528

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

Post by Ape January 24th 2017, 1:02 pm

what code do you have in your forum now ?


Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Left1212Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Center11Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Right112
Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Ape_b110
Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19479
Reputation : 2013
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 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
}
avatar
Guest
Guest


Back to top Go down

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

Post by Ape 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.


Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Left1212Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Center11Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Right112
Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Ape_b110
Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19479
Reputation : 2013
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 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
Harry Jackson
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

- Similar topics

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