This tutorial will allow you to group the posts of members who post twice or more in a row, automatically. This is applicable to versions phpbb2 and phpbb3.
Installing JavaScript
Go to Administration Panel > Modules > JavaScript codes management and create a new script.
Title : Your choice Placement : In the topics Paste the script below that corresponds to your forum version :
phpbb2 : - Code:
$(function() { var c = "", a, d = 0, b = 0; $("tr.post").each(function() { var e = $("> td:first span.name", this).text(); e != c ? (d++, b++, a = $(this), b % 2 != d % 2 && $("> td", a).add($("> td", a.next())).toggleClass("row1 row2"), c = e) : (b++, $(a).find("div.signature_div").remove(), $("> td:last", a).append($("> td:last > table ", this).addClass("doublepost").attr("id", $(this).attr("id").replace(/^p([0-9]+)$/, "$1"))), $(this).next().remove(), $(this).remove()) }); var f = location.hash; location.hash = ""; location.hash = f }); phpbb3 : - Code:
$(function() { var c = "", a, d = 0, b = 0; $("div.post").each(function() { var e = $(".postprofile dt", this).text(); e != c ? (d++, b++, a = $(this), b % 2 != d % 2 && a.toggleClass("row1 row2"), c = e) : (b++, $(a).find("div.signature_div").remove(), $("div.postbody", a).append($("div.postbody", this).attr("class", "doublepost").attr("id", $(this).attr("id").replace(/^p([0-9]+)$/, "$1"))), $(this).remove()) }); var f = location.hash; location.hash = ""; location.hash = f });
Modifying the CSS
The double posts are applied with the classname doublepost.
For example, we can add a style ( Administration Panel > Display > Colors > CSS stylesheet ) like this : - Code:
.doublepost { border-top:1px solid #888 } To put a gray( #888 ) border of 1 pixel above the double posts.
|