Mm... I don't understand that JS at all! lol
But the overall_footer.html is a template, no? Very glad you solved your problem mate!
A stunning theme required
- kaspir
- Moderator
- Posts: 97
- Joined: Mon Mar 20, 2017 2:38 pm
- Location: USA
- Contact:
Re: A stunning theme required
World of Phaos RPG online is making it's come back! Play free now!
Check out phpBB contributions & extension downloads.
- axew3
- w3all User
- Posts: 2718
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: A stunning theme required
Hi!, the code correct and working here online isn't the above ... posting as soon the complete correct solution for the default phpBB theme!
- axew3
- w3all User
- Posts: 2718
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: A stunning theme required
I've just remember that i had prepare this some day ago, it is the starting code that work into the default install theme of phpBB 3.2, the prosilver theme. Resize the forum list on index, and the topics list of viewforum.
Provide a throttle to not overload the cpu on resize.
Into overall_footer.html after:
add:
Recompile template!
Provide a throttle to not overload the cpu on resize.
Into overall_footer.html after:
Code: Select all
<!-- IF S_PLUPLOAD --><!-- INCLUDE plupload.html --><!-- ENDIF -->
{$SCRIPTS}
Code: Select all
<script type="text/javascript">
function resizer() {
$('ul.topiclist.forums li.row dl.row-item').each(function () {
var dhsf = ($(this.childNodes[0].nextElementSibling.childNodes[3]).height());
if (null == dhsf){
var dhsf = ($(this.childNodes[1].childNodes[1]).height());
}
if (dhsf < 55){ dhsf = 55; } // the needed min height
$(this,'ul.topiclist.forums li.row dl').children().css({
height: dhsf + 'px',
'padding':'0px'
});
});
$('ul.topiclist.topics li.row dl.row-item').each(function () {
var dhsf = ($(this.childNodes[0].nextElementSibling.childNodes[3]).height());
if (null == dhsf){
var dhsf = ($(this.childNodes[1].childNodes[1]).height());
}
if (dhsf < 55){ dhsf = 55; } // the needed min height
$(this,'ul.topiclist.topics li.row dl').children().css({
height: dhsf + 'px',
'padding':'0px'
});
});
}
$( window ).load(function() {
$('ul.topiclist.forums li.row dl.row-item').each(function () {
$(this.childNodes[3]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5,7]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"margin:0px;padding-left:6px;vertical-align:middle\"></td></tr></tbody></table>" );
});
$('ul.topiclist.topics li.row dl.row-item').each(function () {
$(this.childNodes[3]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"text-align:center;margin:0px;padding:0px;vertical-align:middle\"></td></tr></tbody></table>" );
$(this.childNodes[3,5,7]).wrapInner( "<table style=\"margin:0px;padding:0px;border-collapse:collapse;height:100%;width:100%\"><tbody><tr><td style=\"margin:0px;padding-left:6px;vertical-align:middle\"></td></tr></tbody></table>" );
});
resizer();
});
(function() {
window.addEventListener("resize", resizeThrottler, false);
var resizeTimeout;
function resizeThrottler() {
// ignore resize events as long as an actualResizeHandler execution is in the queue
if ( !resizeTimeout ) {
resizeTimeout = setTimeout(function() {
resizeTimeout = null;
actualResizeHandler();
// The actualResizeHandler will execute at a rate of 45fps
}, 198);
}
}
function actualResizeHandler() {
// handle the resize event
resizer();
}
}());
</script>
- axew3
- w3all User
- Posts: 2718
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: A stunning theme required
p.s the above code has been just updated, i have fail on copy the right piece, and it was not containing the resize for viewforum.php (topics list).
Now is ok.
Now is ok.
- kaspir
- Moderator
- Posts: 97
- Joined: Mon Mar 20, 2017 2:38 pm
- Location: USA
- Contact:
Re: A stunning theme required
I LOVE IT!!!!
Purge cache wors too after adding this script to footer. I first used on my test forum which anyone can see it working here: https://phpbb.thetopfew.com/viewforum.php?f=2
Then I put on my live site here: https://forums.thetopfew.com/ (and this is a custom theme, based on prosilver!) works like a charm, seriously.
I could have never helped you with this, lol. BUT I FRICKIN LOVE IT! WOW.. Glad I stayed up with this topic.. hell a good job mate! I would make that a phpbb extension and maybe ask for donations mate or drag more ppl to your site per clicks to download it.. seriously. Once people understand what this does, phpbb platform users may will want it!
World of Phaos RPG online is making it's come back! Play free now!
Check out phpBB contributions & extension downloads.
- axew3
- w3all User
- Posts: 2718
- Joined: Fri Jan 22, 2016 5:15 pm
- Location: Italy
- Contact:
Re: A stunning theme required
so we go to further improve it ... let say that the code intentionally leave something not needed, like:
could may just be:
it is in place to be more clear where we aim ... ok it is little elementary, but you know, i'm a simple man
Code: Select all
$( this,'ul.topiclist.forums li.row dl.row-item').height();
Code: Select all
$(this).height();