HomeHome  
  • WelcomeWelcome  
  • Events  
  • PublicationsPublications  
  • FAQFAQ  
  • SearchSearch  
  • MemberlistMemberlist  
  • UsergroupsUsergroups  
  • RegisterRegister  
  • Log inLog in  
  • You are not connected. Please login or register


    PhpBB3 Category Toggler

    • Co-Founder

        Reputation : 40
        Registered on : 2012-02-26
        Posts : 284
      PhpBB3 Category Toggler
      Originally created by Saxaca, we have full permissions to publish this!

      Description


      This tutorial will show you how to add a category toggler to phpBB3 forums!

      Set up


      1. Go to your Admin Panel > Modules > HTML & JAVASCRIPT > Javascript codes management

      2. Click on "Create a new javascript", paste this code in the field and save!

      Code:
      /*
       * Category show/hide for Forumotion phpBB3 boards
       * (C) Copyright Saxaca Designs
       * All rights reserved
       *
       * Licensed under the GNU Public Lisence V2
       * No reproduction available without the prior written permission of Saxaca Designs
       */

      $(function() {
        x = $('div.forabg').get();

        for (i = 0; i < x.length; i++) {
          x[i].id = 'cat_'+i;

          $(x[i]).find('li.header').prepend('<img src="http://cdn2.iconfinder.com/data/icons/fugue/icon/toggle_small_collapse.png" class="saxToggle" style="float: right; margin-right: 5px; margin-top: 3px; cursor: pointer;" />');

          if (my_getcookie(x[i].id)=='contracted') {
            $(x[i]).find('li.row').hide();
            $(x[i]).find('.saxToggle')[0].src='http://cdn5.iconfinder.com/data/icons/fugue/icon/toggle-small-expand.png';
          }
        };

        $('.saxToggle').click(function() {
          if ($(this).parent().parent().parent().find('li.row').is(':visible')) {
            $(this).parent().parent().parent().find('li.row').hide('slow');
            this.src ='http://cdn5.iconfinder.com/data/icons/fugue/icon/toggle-small-expand.png';
            my_setcookie($(this).parent().parent().parent().parent()[0].id, 'contracted');
          }

          else {
            $(this).parent().parent().parent().find('li.row').show('slow');
            this.src ='http://cdn2.iconfinder.com/data/icons/fugue/icon/toggle_small_collapse.png';
            my_setcookie($(this).parent().parent().parent().parent()[0].id, 'expanded');
          }
        });
      });

      Please leave the copyright code in the script!

      Technical problems



      The tutorial was tested on this forum and with the browser Mozilla Firefox; If you notice that the tutorial doesn't work, contact an administrator and we will fill this field with your reporting.

      Thanks, the staff
      For every problem or question please, contact us in the section Support for the tutorials, The staff will answer you as soon as it is possible...

      Friendly,
      The team of the Forum of Codes.

      avatar
      • ***


          Reputation : 0
          Registered on : 2013-10-23
          Posts : 34
          LG
        Is this code available for phpbb2?

        avatar
        • Administrator

            Reputation : 315
            Registered on : 2012-02-22
            Posts : 2362
            School of codes courses: coming soon
          Nope

          sorry



          Niko wants you in the team Guest

          Community manager and Administrator at Forumattivo.com

          avatar
          • ***


              Reputation : 0
              Registered on : 2013-10-23
              Posts : 34
              LG
            I have done it guys.


            YOUR BANNER HERE
            728x90
            DMCA.com Protection Status
            © PunBB | Contact | Report an abuse