Jeg
Sun Dec 12, 2021 2:30 pm
In the viewtopic_body template, add the following code at the beginning of the template:
- Code:
<postnav class="container">
<postnav class="title">Thread navigation</postnav>
</postnav>
<postnav class="--button"><img src="https://i.imgur.com/XNUHwwq.png" /></postnav>
In the same template, find
- Code:
<div style="position: relative; top: -30px; width: 1px;" id="{postrow.displayed.U_POST_ID}"></div>
- Code:
<div style="position: relative; top: -30px; width: 1px;" class="post--id" id="{postrow.displayed.U_POST_ID}"></div>
At the end of the template, add the following code aswell:
- Code:
<script type="text/javascript">
$('postnav.--button').on('click', function() {
$('postnav.container').toggleClass('trsoff');
$(this).toggleClass('trsoff');
});
$(function() {
$('div.post').each(function() {
var $plink = $(this).find('h2.topic-title a').attr('href');
var $pauth = $(this).find('.postprofile-name a').html();
var $pid = $(this).find('.post--id').attr('id');
var str = $(this).find('.postbody .content div').text();
var $length = '32';
var $preview = str.substring(0,$length);
$('postnav.container').append('<a class="post--ref" href="' + $plink + '">' + $pauth + ' - Message # ' + $pid + '<br /><postnav class="preview">' + $preview + '...</postnav></a>');
});
}, 500);</script>
You can customize the number of characters of the previews to show by changing the number 32 in the
- Code:
var $length = '32';
CSS:
- Code:
postnav.container {
background-color: white;
position: fixed;
right: 0;
top: 30vh;
width: 20vw;
z-index: 999;
height: 30vh;
padding: 1%;
box-sizing: border-box;
transform: translateX(19vw);
transition: all .5s ease-in-out;
}
a.post--ref {
display: block;
margin: 10px 0;
font-size: 9.5pt;
color: #454545;
font-family: Arial, sans-serif;
opacity: .8;
transition: all .5s ease-in-out;
}
postnav.title {
text-align: center;
display: block;
font-size: 13pt;
border-bottom: 1px solid #15151515;
padding-bottom: 10px;
margin-bottom: 10px;
}
postnav.preview {
color: #858585;
font-size: 9pt;
}
a.post--ref:hover {
opacity: 1;
}
postnav.--button {
background-color: white;
position: fixed;
right: 20vw;
top: 30vh;
z-index: 999;
height: 30vh;
padding: 1%;
box-sizing: border-box;
display: flex;
align-items: center;
transform: translateX(20vw);
cursor: pointer;
transition: all .5s ease-in-out;
}
postnav.--button img {
width: 13pt;
}
.notrsf {
transform: none !important;
}
Jeg
Sat May 07, 2022 2:18 am
Saturday, May 7th 2022
- Updated the forum version of it, which was the wrong one.
- Updated the forum version of it, which was the wrong one.