With this trick you will be able to show the first post reminder in only specific topics.
It works in phpBB3, punBB, Invision and modernBB.
It doesn't work in phpBB2.
General ï…¸ Configuration ï…¸ Messages ï…¸ Always show the first post in the topics ï…¸ Yes
Make sure you have Javascript Codes enabled.
Name: First post toggle
Placement: In all the pages
The first post will not be displayed by default in other pages.
To display it you have to add
on its content. Don't worry, that will not be shown in the post itself.
And that's all. Hope you find it useful
It works in phpBB3, punBB, Invision and modernBB.
It doesn't work in phpBB2.
Instructions
1) Enable the first post option.
To do that you have to go to:General ï…¸ Configuration ï…¸ Messages ï…¸ Always show the first post in the topics ï…¸ Yes
2) Open the template viewtopic_body
Display ï…¸ Templates ï…¸ General ï…¸ viewtopic_body- phpBB3 and modernBB:
- Search this line:
- Code:
<div id="p{postrow.displayed.U_POST_ID}" class="post {postrow.displayed.ROW_COUNT}{postrow.displayed.ONLINE_IMG_NEW} post--{postrow.displayed.U_POST_ID}"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
and change it by this:
- Code:
<div id="p{postrow.displayed.U_POST_ID}" class="post {postrow.displayed.ROW_COUNT}{postrow.displayed.ONLINE_IMG_NEW} post--{postrow.displayed.U_POST_ID}<!-- BEGIN first_post_br --> first_post<!-- END first_post_br -->"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
- punBB:
- Search this line:
- Code:
<div class="post post--{postrow.displayed.U_POST_ID}"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
and change it by this:
- Code:
<div class="post post--{postrow.displayed.U_POST_ID}<!-- BEGIN first_post_br --> first_post<!-- END first_post_br -->"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
- Invision:
- Search this line:
- Code:
<div id="p{postrow.displayed.U_POST_ID}" class="post {postrow.displayed.ONLINE_IMG_NEW} clearfix post--{postrow.displayed.U_POST_ID}"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
and change it by this:
- Code:
<div id="p{postrow.displayed.U_POST_ID}" class="post {postrow.displayed.ONLINE_IMG_NEW} clearfix post--{postrow.displayed.U_POST_ID}<!-- BEGIN first_post_br --> first_post<!-- END first_post_br -->"{postrow.displayed.THANK_BGCOLOR} style="{postrow.displayed.DISPLAYABLE_STATE}">
3) Add this in your CSS
Display ï…¸ Colors ï…¸ CSS Stylesheet
|
4) Insert the Javascript
Modules ï…¸ Javascript codes management ï…¸ Create a new JavascriptMake sure you have Javascript Codes enabled.
Name: First post toggle
Placement: In all the pages
- Code:
$(function() {
$('.first_post').filter(function(){
var e = $(this);
if (e.html().indexOf("<!--first_post-->")) {
var post = e[0];
var br = post.nextElementSibling;
post.style.display = "block";
br.style.display = "block";
}
});
});
How to use it
The first post will not be displayed by default in other pages.
To display it you have to add
|
- Extra:
- You may want to add a SCEditor button to insert that text automatically for you in your post.
To do that, add this in the same javascript, after the code I posted before.
- Code:
$(function(){
$(function(){
$('<a class="sceditor-button sceditor-button-firstpost" unselectable="on" title="First post reminder"><div unselectable="on">First post</div></a>').insertAfter('.sceditor-button-removeformat').click(function(){
$('#text_editor_textarea').sceditor("instance").insertText("<!--first_post-->");
});
});
});
And add this in your CSS:- Code:
.sceditor-button-firstpost div {
background-image: url('https://i62.servimg.com/u/f62/19/86/96/38/first_10.png') !important;
}
And that's all. Hope you find it useful