[Tutorial] Show the first post reminder in specific topics
5 posters
Page 1 of 1
[Tutorial] Show the first post reminder in specific topics
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
Wecoc- Forumember
- Posts : 144
Reputation : 111
Language : Catalan, Spanish, English
Re: [Tutorial] Show the first post reminder in specific topics
And what does this do? Do we have an image to see the result?
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: [Tutorial] Show the first post reminder in specific topics
Well, it's difficult to show the result with an image in this case, but let's see...
I used the same principle as in the tutorial Hide the sentence "Last edited by..." on specific or all messages. Also, now the first post reminder has a specific class called first_post, so you could modify some properties of it via CSS.
- Spoiler:
I used the same principle as in the tutorial Hide the sentence "Last edited by..." on specific or all messages. Also, now the first post reminder has a specific class called first_post, so you could modify some properties of it via CSS.
- Spoiler:
Wecoc- Forumember
- Posts : 144
Reputation : 111
Language : Catalan, Spanish, English
Re: [Tutorial] Show the first post reminder in specific topics
So if you do not want to use the first reminder feature in the AP, you can use this one for certain topics?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: [Tutorial] Show the first post reminder in specific topics
Long story short, this uses the first reminder feature in the AP but "hides" it by default except for certain topics.
Sorry if I didn't explain it well enough the first time.
Sorry if I didn't explain it well enough the first time.
Wecoc- Forumember
- Posts : 144
Reputation : 111
Language : Catalan, Spanish, English
Re: [Tutorial] Show the first post reminder in specific topics
How do I disable the first topic reminder ? I think it is causing some issues . I do not like it anyway . I think I have version phpBB .
Thank you .
If you have not seen my current support post . Please view it at
https://help.forumotion.com/t159228-how-to-fix-this-coding-problem#1108929
Maybe you can help figure it out .
Thank you .
Okay I have turned it off .skouliki wrote:azwiz wrote:How do I disable the first topic reminder ? I think it is causing some issues . I do not like it anyway . I think I have version phpBB .
Administration Panel .... General .. Messages and emails ... Configuration
Always show the first post in the topics : No
Thank you .
If you have not seen my current support post . Please view it at
https://help.forumotion.com/t159228-how-to-fix-this-coding-problem#1108929
Maybe you can help figure it out .
Thank you .
Last edited by azwiz on July 3rd 2020, 9:41 pm; edited 1 time in total
Re: [Tutorial] Show the first post reminder in specific topics
azwiz wrote:How do I disable the first topic reminder ? I think it is causing some issues . I do not like it anyway . I think I have version phpBB .
Administration Panel .... General .. Messages and emails ... Configuration
Always show the first post in the topics : No
Wecoc likes this post
Similar topics
» First post reminder in specific topics
» [Tutorial] Recent topics from specific forums
» Show first message on each page for specific topics
» [Solved] Make specific hover change for specific topics.
» [Tutorial] Cite Specific Text
» [Tutorial] Recent topics from specific forums
» Show first message on each page for specific topics
» [Solved] Make specific hover change for specific topics.
» [Tutorial] Cite Specific Text
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum