Post by Wormopolis on Sept 7, 2008 3:34:04 GMT -8
This code will auto-merge multiple posts from the same user into 1 post. It does not delete posts, nor affect post count. It uses your exisiting skin colors and username colors.
Modify and Delete buttons only appear to those who would normally be able to access them.
Preview:
EDIT: new version 1.1. bug fix for Firefox that I didnt catch.
EDIT: new version 1.2. bug fix for displaying user recent posts.
UPDATES TO THIS CODE FOUND ON wormocodes.proboards.com
Modify and Delete buttons only appear to those who would normally be able to access them.
<!-- SCRIPT DIVIDER: Multiple Post automerge -->
<script type="text/javascript">
<!--
// autoMerge multiple posts v 1.2
// by Wormopolis
// Do Not Repost - Header must stay intact
// put in board footer, or global footer for all boards.
if (!location.href.match(/userrecentposts/i)) {
iCells=document.getElementsByTagName('hr');
for ( i=iCells.length-1; i>0; i--) {
if(iCells[i].parentNode.vAlign=='top') {
var msgCell = iCells[i].parentNode;
var authCell = iCells[i].parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling;
var postCell = authCell.parentNode;
if (!authCell.getElementsByTagName('a')[2]) {
var auth = authCell.innerHTML.split(/<\/A>/i)[2].split("<BR")[0];
} else {
var auth = authCell.getElementsByTagName('a')[2].innerHTML;
}
var timeCell = msgCell.parentNode.previousSibling.getElementsByTagName('font')[1];
var msgTime = timeCell.innerHTML.replace(/Reply \#\d+/,'');
keep = msgTime.substring(0,1);
msgTime=msgTime.substring(1, msgTime.length);
var disc = "<br/><br/><br/>" + keep + " " + auth + " Later added " + msgTime;
var btns=msgCell.parentNode.previousSibling.getElementsByTagName('a');
for (m=0; m<btns.length; m++) {
var tmp=document.createElement('div');
var cloneBtn=btns[m].cloneNode(true);
tmp.appendChild(cloneBtn);
if (!tmp.innerHTML.match(/quote/i)) disc+=tmp.innerHTML;
}
disc+="<br/>";
(iCells[i-1].parentNode.vAlign=='top') ? j=1 : j=2;
var prev_msgCell = iCells[i-j].parentNode;
var prev_authCell = iCells[i-j].parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling;
if (!prev_authCell.getElementsByTagName('a')[2]) {
var prev_auth = prev_authCell.innerHTML.split(/<\/A>/i)[2].split("<BR")[0];
} else {
var prev_auth = prev_authCell.getElementsByTagName('a')[2].innerHTML;
}
if (prev_auth == auth) {
vict=msgCell.firstChild;
noob=document.createElement("br");
msgCell.replaceChild(noob,vict);
prev_msgCell.innerHTML+=disc + msgCell.innerHTML;
postCell.style.display='none';
}
}
}
}
// -->
</script>
Preview:
EDIT: new version 1.1. bug fix for Firefox that I didnt catch.
EDIT: new version 1.2. bug fix for displaying user recent posts.
UPDATES TO THIS CODE FOUND ON wormocodes.proboards.com