This is a feature I've been using in my forum: When a user makes multiple posts in a row they are displayed as part of the same post, with a thin line that seperates their content. The merge is applied on the post box, and the profile and signature are displayed only once, but the quote/edit/etc buttons, the post title and date, the reputation/like system and the edit text are still displayed in each one separately, for obvious reasons.
It's not just double posts, if there are 15 posts in a row it will be applied on all them in the same manner (and you should probably ban that user, lol).
I've tested it only on phpBB3 but it's pretty basic and should work in others as well, maybe with a few edits... I'll appreciate feedback on that
Add this on the Javascript list, with position option "In topics".
- Example:
It's not just double posts, if there are 15 posts in a row it will be applied on all them in the same manner (and you should probably ban that user, lol).
I've tested it only on phpBB3 but it's pretty basic and should work in others as well, maybe with a few edits... I'll appreciate feedback on that
1. Javascript
Add this on the Javascript list, with position option "In topics".
- Code:
/*
* -- Automerge Double Posts --
* Version: 1.0 EN (2020-06-11) [phpBB3]
* Author: Wecoc
* Description: When a user makes multiple posts in a row, they are displayed as part of the same post,
* with a thin line that seperates their content.
*/
$(function() {
var posts = $(".post");
if (posts.length < 2) return;
for(var i=0; i<posts.length; i++ ) {
var post = posts[i], author = post.querySelector(".author a");
if (author == null) break;
author = author.innerText;
if (i > 0) {
var prev_post = posts[i-1], prev_author = prev_post.querySelector(".author a");
if (prev_author == null) break;
prev_author = prev_author.innerText;
if (author == prev_author) {
$(post).addClass("has_prev");
}
}
if (i < (posts.length - 1)) {
var next_post = posts[i+1], next_author = next_post.querySelector(".author a");
if (next_author == null) break;
next_author = next_author.innerText;
if (author == next_author) {
$(post).addClass("has_next");
post.appendChild(next_post);
}
}
}
});
2. CSS
- Code:
/* Hide the signature on multiposts */
.post.has_next > .inner > .postbody > .signature_div { display: none; }
/* Hide the profile on multiposts */
.post.has_next .post .postprofile { display: none; }
/* Hide the scroll buttons on multiposts */
.post.has_next > .inner > div.clear, .post.has_next > .inner > p.right { display: none; }
/* Change the basic format of the multiposts and add a border line to separate them */
.post.has_next .post {
border: none;
box-shadow: none;
float: left;
margin-top: 10px;
padding-top: 10px;
width: 100%;
border-top: 2px solid #313131 !important;
border-radius: 0 !important;
}