Post by CrAzY_J on Nov 5, 2005 12:30:12 GMT -8
Code description: What this code does is alphabetize the threads on a board, it will only affect ONE page at a time. The difference between this code and Alphabetical threads by Peter, is that this one alphabetizes the threads automatically ( so no clicking anything needed).
Code creator: CrAzY_J
COde placement: Global footers
Code instructions
Only thing you need to edit in this code, is the part in red and blue.
those 2 are the images you use for the "sticky" and "stickylock" image. If you use the default sticky and stickylock image, you don't need to edit the code at all!
Code creator: CrAzY_J
COde placement: Global footers
<script type="text/javascript">
/* Alphabetize threads
created by CrAzY_J
do not redistribute this code without the creator's permissoin*/
// Mod by Wormo for IE fix
var chicken = /(sticky|stickylock)/i
var pork = [];
var beef = document.body.getElementsByTagName("tr");
if( this.location.href.match(/board=/i) )
{
for( r = 0 ; r < beef.length ; r ++ )
{
if( beef[r].cells[0].width == "5%" && beef[r].cells[0].className == "windowbg2" )
{
beef[r].parentNode.setAttribute('id','ramen');
var shrimp = ( beef[r].cells[0].firstChild.type == "checkbox" )? 1:0;
if( !beef[r].cells[shrimp].innerHTML.match(chicken) )
{
pork.push([beef[r].cells[shrimp+2].getElementsByTagName("a")[0].innerHTML,beef[r]] );
beef[r].parentNode.removeChild( beef[r] );
r--;
}
}
}
var seafood = document.getElementById('ramen')
pork.sort();
for( s = 0 ; s < pork.length ; s ++ )
{
nxtrw=(seafood.nodeName=='TBODY' ? (document.all ? seafood.lastChild: seafood.lastChild.previousSibling) : seafood.lastChild.nextSibling);
seafood.insertBefore( pork[s][1], nxtrw);
}
}
</script>
Code instructions
Only thing you need to edit in this code, is the part in red and blue.
those 2 are the images you use for the "sticky" and "stickylock" image. If you use the default sticky and stickylock image, you don't need to edit the code at all!