2013-11-13, 13:07
Tutorial: Auto alignment subforums |
Today I will show something interesting, auto arranging child boards on phpBB3 and punBB version, beta version.
Now the settings:
ACP > Display > Homepage > Structure and hierarchy:
Credits: StaarK*
--> Tutorials, tips and tricks <--
Auto alignment subforums
Auto alignment subforums
1º - Css
- Code:
.subforums {
margin: 2px 0 3px 5px;
padding-left: 20px;
background: url(http://community.invisionpower.com/filestore/public/style_images/master/subforum_stem.png) no-repeat left 4px;
overflow: hidden;
float: left;
min-width: 100px;
}
.sub:nth-child(odd) {
float: left;
clear: both;
width: 160px;
position: relative;
}
.sub:nth-child(even) {
float: right;
width: auto;
position: relative;
}
.sub:nth-child(even):last-child {
position: relative;
left: -3px;
}
phpBB3
- Code:
$(document).ready(function(){
$('.topiclist.forums li.row').each(function(){
$(this).find('.dterm a:has(img)').next().wrap('<li class="sub" />');
$(this).find('.dterm li').wrapAll('<ul class="subforums" />');
$(this).find('.dterm a:has(img)').remove();
});
$('.topiclist.forums').each(function(index){
cm = $(this).html();
cm = cm.replace(/, /gi,'');
$(this).html(cm);
});
});
- Code:
$(document).ready(function(){
$('.subforums').each(function(){
$(this).find('a:has(img)').next().wrap('<li class="sub" />');
$(this).find('a:has(img)').remove();
});
$('.subforums').each(function(index){
cm = $(this).html();
cm = cm.replace(/, /gi,'');
$(this).html(cm);
});
});
find:
- Code:
{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
- Code:
<ul class="subforums">{catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}</ul>
3º - Preview
phpBB3
punBB
© PunBB Design
If you have any questions related to this topic create a topic with the following title: Auto alignment subforums |