The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Automerge Double Posts

+4
Jucarese
YoshiGM
Neptune-
Wecoc
8 posters

Go down

Automerge Double Posts Empty Automerge Double Posts

Post by Wecoc June 11th 2020, 3:02 pm

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.

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 Smile

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
Wecoc
Forumember

Male Posts : 144
Reputation : 111
Language : Catalan, Spanish, English

skouliki, SarkZKalie, TonnyKamper and Jucarese like this post

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by Neptune- June 11th 2020, 3:52 pm

Hello,


We have a similar tutorial on French Support Forum.

If it can help, works for phpBB2 too

Translated in Automerge Double Posts Flag-es -> phpbb: Agregada doble publicación

And in Automerge Double Posts Flag-gb -> phpbb: Aggregate double post
Neptune-
Neptune-
Forumember

Female Posts : 496
Reputation : 104
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : Scotland, UK

https://www.galaxie-series.net/

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by YoshiGM June 11th 2020, 5:56 pm

Neptune is right.. We already have a tutorial created by Ea/Etana written some years ago Wink
But, thanks for the tip cheers
YoshiGM
YoshiGM
Active Poster

Male Posts : 1560
Reputation : 146
Language : Spanish & English
Location : Mexico

http://asistencia.foroactivo.com/u21373

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by Jucarese October 2nd 2020, 8:34 pm

Hi @Wecoc can you prepare for the other new platforms ???? ModernBB and AwesomeBB
thanks
Jucarese
Jucarese
Hyperactive

Male Posts : 2550
Reputation : 119
Language : spanish
Location : SSF Admin

http://asistencia.foroactivo.com/u23082

TonnyKamper likes this post

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by Simone Boi February 23rd 2021, 7:47 am

Doesn't work for me with ModernBB, any tips?
avatar
Simone Boi
Forumember

Posts : 90
Reputation : 2
Language : Italian

https://gamespledge.forumattivo.com/

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by YoshiGM February 23rd 2021, 3:48 pm

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 Confused
YoshiGM
YoshiGM
Active Poster

Male Posts : 1560
Reputation : 146
Language : Spanish & English
Location : Mexico

http://asistencia.foroactivo.com/u21373

Simone Boi likes this post

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by Bipo March 21st 2021, 2:22 pm

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:

Administration Panel  Display  Pictures and Colors  ColorsCSS 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  ColorsCSS 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
Bipo
New Member

Posts : 3
Reputation : 1
Language : French only.

Ape, SarkZKalie, TonnyKamper and Wecoc like this post

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by ktsky1 March 24th 2021, 7:14 am

It looks cool
ktsky1
ktsky1
New Member

Posts : 1
Reputation : 1
Language : CN

Back to top Go down

Automerge Double Posts Empty Re: Automerge Double Posts

Post by SLGray March 24th 2021, 8:26 pm

Please do not post links to things that guests can not see.  We as guests can not see the page you linked.


Automerge Double Posts Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51549
Reputation : 3523
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum