Automerge Double Posts
+4
Jucarese
YoshiGM
Neptune-
Wecoc
8 posters
Page 1 of 1
Automerge Double Posts
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;
}
Wecoc- Forumember
- Posts : 144
Reputation : 111
Language : Catalan, Spanish, English
skouliki, SarkZKalie, TonnyKamper and Jucarese like this post
Re: Automerge Double Posts
Hello,
We have a similar tutorial on French Support Forum.
If it can help, works for phpBB2 too
Translated in -> phpbb: Agregada doble publicación
And in -> phpbb: Aggregate double post
We have a similar tutorial on French Support Forum.
If it can help, works for phpBB2 too
Translated in -> phpbb: Agregada doble publicación
And in -> phpbb: Aggregate double post
Re: Automerge Double Posts
Neptune is right.. We already have a tutorial created by Ea/Etana written some years ago
But, thanks for the tip
But, thanks for the tip
Re: Automerge Double Posts
Hi @Wecoc can you prepare for the other new platforms ???? ModernBB and AwesomeBB
thanks
thanks
TonnyKamper likes this post
Re: Automerge Double Posts
Simone Boi wrote:Doesn't work for me with ModernBB, any tips?
You need to wait a new update of the code.
They need to change some parts to work in the other versions
Simone Boi likes this post
Re: Automerge Double Posts
Hello everyone,
The trick proposed by Ea, on the French support, no longer works. She was removed from the list in early March 2021.
For the ModernBB version:
For the AwesomeBB version:
Best regards.
Bipo.
The trick proposed by Ea, on the French support, no longer works. She was removed from the list in early March 2021.
For the ModernBB version:
Administration Panel Display Pictures and Colors Colors CSS stylesheet
- Code:
/* Hide the signature on multiposts */
.post.has_prev > .postbody > .signature_div { display: none; }
/* Hide the profile on multiposts */
.post.has_next .post .postprofile { 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: 3px solid #3793ff !important;
border-radius: 0 !important;
}
Administration Panel Modules JavaScript codes management
- Code:
/*
* -- Automerge Double Posts --
* Version: 1.0 EN (2021-03-21) [ModernBB]
* Author: Wecoc & Bipo
* 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(".postprofile-name a");
if (author == null) break;
author = author.innerText;
if (i > 0) {
var prev_post = posts[i-1], prev_author = prev_post.querySelector(".postprofile-name 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(".postprofile-name a");
if (next_author == null) break;
next_author = next_author.innerText;
if (author == next_author) {
$(post).addClass("has_next");
post.appendChild(next_post);
}
}
}
});
For the AwesomeBB version:
Administration Panel Display Pictures and Colors Colors CSS stylesheet
- Code:
/* Hide the signature on multiposts */
.post-wrap.has_prev > .post-body > .post > .post-content > .post-signature { display: none; }
/* Hide the profile on multiposts */
.post-wrap.has_prev .post-body .post-aside { display: none;}
/* Hide the space post on multiposts */
.post-wrap.has_prev .post { margin: 0px 3px 0;}
Administration Panel Modules JavaScript codes management
- Code:
/*
* -- Automerge Double Posts --
* Version: 1.0 EN (2021-03-21) [AwesomeBB]
* Author: Wecoc & Bipo
* 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-wrap");
if (posts.length < 2) return;
for(var i=0; i<posts.length; i++ ) {
var post = posts[i], author = post.querySelector(".post-author a");
if (author == null) break;
author = author.innerText;
if (i > 0) {
var prev_post = posts[i-1], prev_author = prev_post.querySelector(".post-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(".post-author a");
if (next_author == null) break;
next_author = next_author.innerText;
if (author == next_author) {
$(post).addClass("has_next");
post.appendChild(next_post);
}
}
}
});
Best regards.
Bipo.
Last edited by Bipo on May 18th 2022, 4:52 pm; edited 1 time in total
Bipo- New Member
- Posts : 3
Reputation : 1
Language : French only.
Ape, SarkZKalie, TonnyKamper and Wecoc like this post
Re: Automerge Double Posts
Please do not post links to things that guests can not see. We as guests can not see the page you linked.
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.
Similar topics
» Automerge Double Post
» aggregate double-posts double-loads pages hides favicon
» Double Posts
» phpbb : Aggregate double posts
» CSS image for double-posts not correctly positioned
» aggregate double-posts double-loads pages hides favicon
» Double Posts
» phpbb : Aggregate double posts
» CSS image for double-posts not correctly positioned
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum