|
Post by Marty on Aug 3, 2005 21:58:21 GMT -8
<script type="text/javascript"> <!-- /* Alphabetize Users Online v2 Made by Marty Please do not repost without my permission */
var td=document.getElementsByTagName("td"); var users=new Array();
for (t=0; t < td.length; t++) { if (td[t].innerHTML.match(/Users Online/i) && td[t].className=="catbg" && td[t+3].innerHTML.match(/\,\s</gi)) { var user=td[t+3].getElementsByTagName("a"); for (u=0; u < user.length; u++) { if (user[u].href.match(/viewprofile&user=/i)) { if (user[u].firstChild.firstChild) { var invis=(user[u].nextSibling && user[u].nextSibling.length > 2)? " (invisible)" : ""; users.push([user[u].getElementsByTagName("font")[0].innerHTML.toLowerCase(),user[u].innerHTML,user[u].href,user[u].className,invis]); } else { var invis=(user[u].nextSibling && user[u].nextSibling.length > 2)? " (invisible)" : ""; users.push([user[u].innerHTML.toLowerCase(),user[u].innerHTML,user[u].href,invis]); } } } users.sort(); var split=td[t+3].getElementsByTagName("font")[0].innerHTML.split(/<br>/i)[1]; var newUsers=''; for (u=0; u < users.length; u++) { if (users[u].length==5) { newUsers+='<a href="' + users[u][2] + '" class="' + users[u][3] + ' onclick="pb_bubble=1">' + users[u][1] + '</a>' + users[u][4] + ', '; } else { newUsers+='<a href="' + users[u][2] + '" onclick="pb_bubble=1">' + users[u][1] + '</a>' + users[u][3] + ', '; } } newUsers=newUsers.substring(0,newUsers.length-2); td[t+3].innerHTML=td[t+3].innerHTML.replace(split,newUsers); } } //--> </script> This will sort the users online by alphabetical order. This version will display (invisible) if the user is invisible, and it fixes a minor bug. Put this in your Main Footer.
Last Edit: Aug 5, 2005 9:35:14 GMT -8 by Marty
|
|
|
Post by CD on Aug 3, 2005 22:06:36 GMT -8
Very nice job Marty.
|
|
100%
|
Post by Aaron on Aug 6, 2005 9:41:06 GMT -8
Nice code. I kept hearing some people at SSD complaining about the bugs lol. It good that you fixed them.
|
|
|
Post by Marty on Aug 6, 2005 12:26:49 GMT -8
lol, yeah. This one guy kept PMing me finding new bugs. I think I fixed them all, though.
|
|
|
Post by Ten Kabuto on Aug 12, 2005 23:06:17 GMT -8
Just wondering.. would this just alphabatize for any Users Online in any info center? Cause it would be awsome if it could go with any other info center mod.
|
|
|
Post by Marty on Aug 12, 2005 23:14:01 GMT -8
Yeah, it should work with any of them. Just make sure this code is above the info center code, and it should work.
|
|
|
Post by CD on Aug 12, 2005 23:20:30 GMT -8
Yeah, TK, if you're thinking of the SZ code I just made, it'd work with it.
|
|