PhpBB3 Category Toggler
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.