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.
The forum of the forums
3 posters

    Category Toggle Code Does Not Work For My Forumotion PHPBB3 Forum

    Harry Jackson
    Harry Jackson
    New Member


    Posts : 10
    Reputation : 1
    Language : English and Vietnamese

    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.
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15311
    Reputation : 1705
    Language : English,Greek
    Location : Greece

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

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


    Harry Jackson
    Harry Jackson
    New Member


    Posts : 10
    Reputation : 1
    Language : English and Vietnamese

    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
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19325
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    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
    avatar
    Guest
    Guest


    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
    }
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19325
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    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
    Harry Jackson
    Harry Jackson
    New Member


    Posts : 10
    Reputation : 1
    Language : English and Vietnamese

    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

      Current date/time is September 23rd 2024, 1:18 am