Post by Matt on Jun 5, 2006 19:20:36 GMT -5
Created By: Todge
Creator's Comments:
This will reverse the order of posts within a thread, so that the latest post is at the top of the first page and working down..
Put it in your Global Footer..
Creator's Comments:
This will reverse the order of posts within a thread, so that the latest post is at the top of the first page and working down..
Put it in your Global Footer..
<script type="text/javascript">
<!--
/*
Reverse order posts in threads by Todge
Copyright © 2006
Please keep this header intact
*/
if(document.location.href.match('board=')&&!document.location.href.match('action='))
{
var thread = document.getElementsByTagName('td');
var threadLinks;
for(t=0; t<thread.length; t++)
{
if(thread[t].className=='windowbg'&&thread[t].style.cursor=='pointer')
{
threadLinks=thread[t].getElementsByTagName('a');
if(threadLinks[0].firstChild.nodeName=='IMG')
{
threadLinks[1].href = threadLinks[0].href;
}
else
{
threadLinks[0].href = threadLinks[threadLinks.length-1].href;
}
thread[t].onclick = function(){document.location.href = this.getElementsByTagName('a')[0].href;}
}
}
}
var start=0;
if(document.location.href.match('action=display'))
{
var postTR = new Array();
var TR = document.getElementsByTagName('TR');
for(t=0; t<TR.length; t++)
{
if(TR[t].firstChild.width=='20%'&&TR[t].firstChild.className=='catbg'&&TR[t].firstChild.innerHTML.match(/<b>Author<\/b>/i))
{
start = 1;
}
if(TR[t].firstChild.width=='20%'&&TR[t].firstChild.className.match('windowbg')&&start==1)
{
postTR[0] = TR[t];
var TR = TR[t];
break;
}
}
var p=1;
while(TR.nextSibling.firstChild.width=='20%')
{
postTR[p] = TR.nextSibling.cloneNode(true);
TR.nextSibling.style.display = 'none';
TR=TR.nextSibling;
p++;
}
TR=TR.nextSibling;
for(t=postTR.length-1; t>-1; t--)
{
TR.parentNode.insertBefore(postTR[t],TR);
}
}
// -->
</script>