Kylo Pardon. I posted this in another discussion. But I sent it here by mistake. Is the extend.php file below correct?
<?php
use Flarum\Extend;
use Flarum\Frontend\Document;
return [
new Bokt\Redis\Extend\EnableRedisCache($redis = [
'host' => '127.0.0.1',
'password' => '-----',
'port' => 6379,
'database' => 1,
]),
new Bokt\Redis\Extend\EnableRedisQueue($redis),
// Register extenders here to customize your forum!
(new Extend\Frontend('forum'))
->content(function (Document $document) {
$document->foot[] = <<<'JS'
<script type="text/javascript">
$(window).scroll(function(){
// footer height in pixels
const footerHeight = 100;
// padding-bottom value for .App
const paddingBottomApp = 50;
var scrollBottom = $(document).height() - $(this).height() - $(this).scrollTop();
if(footerHeight + paddingBottomApp - scrollBottom < 0) {
$(".DiscussionPage-nav > ul").css("bottom", "auto");
} else {
$(".DiscussionPage-nav > ul").css("bottom", footerHeight + paddingBottomApp);
}
});
</script>
JS;
})
];