by TonnyKamper Sat 9 Dec - 2:23
SLGray wrote:So you will be installing a phpBB 3 theme on your phpBB 2 forum which will changed it into phpBB 3?
Yes I am considering that
@SLGray thanks for your reply, it's high time our phpbb2 get's an upgrade..
I know I will have to change version to phpbb3 first with a standard version skin on our official forum before I can import the skin I made on the testforum.. I'm also testing Invision and ModernBB on 2 other testforums and I haven't decided yet which one is the best to work with.. but I want to have the skins finished first before deciding..
This phpbb3 skin I'm working on is almost to my liking, it only lacks the category toggle feature, which I need because our official forum has a lot of categories.
I've searched through the archives but found not one solution that worked or even partially worked, I found on the Dutch Helpforum this other JS and CSS for phpbb3 from january 2016, which it's quite recent I figured..
JS
- Code:
$(function() {
var oCat = $('#main-content .forabg'),
oThis = null,
oTemp = null,
sEval = '';
sEval = "oThis.find('ul.topiclist:first dl.icon').append('<div onclick=\"toggleCategory(\'c' + i + '\');\" id=\"bc' + i + '\" class=\"contract\"> </div>');" +
"oThis.find('ul.topiclist.forums').attr('id', 'c' + i);";
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
}
CSS
- Code:
.contract, .expand {
background: url("http://2img.net/i/fa/invision/exp_minus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);
cursor: pointer;
float: right;
}
.expand {
background: url("http://2img.net/i/fa/invision/exp_plus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);
}
But even that isn't doing the job, so I ran out of options and came here to ask for help, because javascript is one thing I haven't mastered yet
Kind regards and thanks for your time,
Tonny Kamper