|
[Code] TOP 5 STATS; Top Poster, New Members, New Posts
|
|
Topic Started: Mar 3 2006, 01:57 AM (2,711 Views)
|
|
retsam
|
Mar 3 2006, 01:57 AM
Post #1
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
Alright now here is something I am sure a lot of members have been waiting for. It's late so I'll show a preview site later, but *hint-sig*. Hope you all like this, I am suprised no one had done it before.
What it does / Features: -Shows the top 5 all-time posters -Shows the top 5 newest members -Shows the top 5 newest threads -Only shown on the index -Only members can view -Works in (Tested in:) Firefox and Internet Explorer
NAVIGATION
- Code:
-
<div id="TOPshower"></div>
Footer
- Code:
-
<script> //Top 5 Stats V.1 //By Retsam //No Modifications Allowed
//Top Posters LTPMEM = "http://invisionfree.com/forums/UCO/index.php?act=Members&max_results=10&sort_key=posts&sort_order=desc" //Newest Members LNPMEM = "http://invisionfree.com/forums/UCO/index.php?act=Members&s=&name_box=all&name=&filter=ALL&sort_key=joined&sort_order=desc&max_results=10" //New Posts LNPOST = "http://invisionfree.com/forums/UCO/index.php?act=site" document.write('<div id="frameConstruct" style="display:none"></div>'); iframe = "<iframe id='LTMEM' name='LTMEM' src='"+LTPMEM+"'></iframe>" iframe += "<iframe id='LNMEM' name='LNMEM' src='"+LNPMEM+"'></iframe>" iframe += "<iframe id='LPOST' name='LPOST' src='"+LNPOST+"' onLoad='Opload()'></iframe>" boardURL="http://invisionfree.com/forums/UCO/index.php" if(!document.location.href.match("=") || document.location.href.match("act=idx")) { if (document.getElementById("userlinks").innerHTML.indexOf("Log Out") > -1) { document.getElementById('frameConstruct').innerHTML = iframe }} function Opload(){ TOPPOST = [] TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[4].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[8].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[13].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[17].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[22].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[26].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[31].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[35].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[40].innerHTML TOPPOST[TOPPOST.length] = top.LTMEM.document.getElementsByTagName('td')[44].innerHTML
NEWMEMB = [] NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[4].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[8].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[13].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[17].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[22].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[26].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[31].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[35].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[40].innerHTML NEWMEMB[NEWMEMB.length] = top.LNMEM.document.getElementsByTagName('td')[44].innerHTML
td=document.getElementsByTagName("TD") for(i=0;i<td.length;i++) {
if ((td[i].className=="row4") && td[i].innerHTML.indexOf(" guests, ") > -1) { MIN = ((td[i].getElementsByTagName("A").length-2) + 18) MAX = ((td[i].getElementsByTagName("A").length-2) + 27) MLX = ((td[i].getElementsByTagName("A").length-2) + 28)
} }
LATEST = [] for(x=MIN;x<MLX;x++){ LATEST[LATEST.length] = top.LPOST.document.getElementsByTagName('a')[x].innerHTML } LATLIN = [] for(y=MIN;y<MAX;y++){ LATLIN[LATLIN.length] = top.LPOST.document.getElementsByTagName('a')[y] } ShowBuild() } function ShowBuild(){ iBuild = "<table class='maintitle' border='0' cellpadding='0' cellspacing='0' width='100%'>" iBuild += "<tbody><tr>" iBuild += "<td class='tcat' valign='bottom'>" iBuild += "<p align='center'> Statistics - Top 5 </p>" iBuild += "</td></tr></tbody></table>" iBuild += "<table class='row4' align='center' border='0' cellpadding='6' cellspacing='1' width='100%' style='border: 1px #000000 solid'>" iBuild += "<tbody id='collapseobj_forumhome_statistics' style=''><tr>" iBuild += "<td class='thead' align='left' nowrap='nowrap' width='23%'> Top Posters </td>" iBuild += "<td class='thead' align='left' nowrap='nowrap' width='22%'> Newest Members </td>" iBuild += "<td class='thead' nowrap='nowrap' width='55%'> Newest Replies </td>" iBuild += "</tr><tr><td class='alt2' valign='top' width='23%'><table><tbody><tr>" iBuild += "<td class='smallfont' width='100%'> Member: </td>" iBuild += "<td class='smallfont' align='right' nowrap='nowrap'> Posts: </td>" iBuild += "</tr><tr><td width='100%'><b>"+TOPPOST[0]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+TOPPOST[1]+"</b></td></tr><tr>" iBuild += "<td width='100%'><b>"+TOPPOST[2]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+TOPPOST[3]+" </b>" iBuild += "</td></tr><tr><td width='100%'>" iBuild += "<b>"+TOPPOST[4]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+TOPPOST[5]+"</b></td></tr><tr>" iBuild += "<td width='100%'><b>"+TOPPOST[6]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+TOPPOST[7]+"</b></td></tr><tr>" iBuild += "<td width='100%'><b>"+TOPPOST[8]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+TOPPOST[9]+"</b></td></tr></tbody></table></td>" iBuild += "<td class='alt1' valign='top' width='22%'>" iBuild += "<table><tbody><tr><td class='smallfont' nowrap='nowrap' width='100%'> Member: </td>" iBuild += "<td class='smallfont' align='right' nowrap='nowrap'> Posts: </td></tr><tr>" iBuild += "<td class='smallfont' width='100%'><b>"+NEWMEMB[0]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+NEWMEMB[1]+"</b></td></tr><tr>" iBuild += "<td class='smallfont' width='100%'><b>"+NEWMEMB[2]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+NEWMEMB[3]+"</b></td></tr><tr>" iBuild += "<td class='smallfont' width='100%'><b>"+NEWMEMB[4]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+NEWMEMB[5]+"</b></td></tr><tr>" iBuild += "<td class='smallfont' width='100%'><b>"+NEWMEMB[6]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+NEWMEMB[7]+"</b></td></tr><tr>" iBuild += "<td class='smallfont' width='100%'><b>"+NEWMEMB[8]+"</b></td>" iBuild += "<td class='smallfont' align='right'><b> "+NEWMEMB[9]+"</b></td></tr></tbody></table></td>" iBuild += "<td class='alt2' valign='top' width='55%'>" iBuild += "<table><tbody><tr> <td class='smallfont' nowrap='nowrap' width='70%'> Thread: </td>" iBuild += "<td class='smallfont' nowrap='nowrap' width='30%'> Last Poster: </td></tr><tr>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[0]+"'>"+LATEST[0]+"</a></strong></td>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[1]+"'>"+LATEST[1]+"</a></strong></td>" iBuild += "</tr><tr>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[2]+"'>"+LATEST[2]+"</a></strong></td>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[3]+"'>"+LATEST[3]+"</a></strong></td>" iBuild += "</tr><tr>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[4]+"'>"+LATEST[4]+"</a></strong></td>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[5]+"'>"+LATEST[5]+"</a></strong></td>" iBuild += "</tr><tr>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[6]+"'>"+LATEST[6]+"</a></strong></td>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[7]+"'>"+LATEST[7]+"</a></strong></td>" iBuild += "</tr><tr>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[8]+"'>"+LATEST[8]+"</a></strong></td>" iBuild += "<td class='smallfont'><strong><a href='"+LATLIN[9]+"'>"+LATEST[9]+"</a></strong></td>" iBuild += "</tr></tbody></table></td></tr></tbody></table>" boardURL="http://invisionfree.com/forums/UCO/index.php" if(!document.location.href.match("=") || document.location.href.match("act=idx")) { if (document.getElementById("userlinks").innerHTML.indexOf("Log Out") > -1) { document.getElementById('TOPshower').innerHTML = iBuild }} } </script>
[Instructions
On the script find this part:
- Quote:
-
Replace the blue parts (http://invisionfree.com/forums/UCO/) with your site's short address like so: (www.s5.invisionfree.com/forums/blublu) <- [that's a example]
Enjoy 
-[retsam]
|
|
|
| |
|
Dragon Hellfire
|
Mar 3 2006, 02:01 AM
Post #2
|
- Posts:
- 58
- Group:
- Members
- Member
- #92,650
- Joined:
- January 28, 2006
|
Good Code, nice job on it
|
|
|
| |
|
retsam
|
Mar 3 2006, 02:07 AM
Post #3
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
thanks... It's quite a big code to put in... Oh, and just for latter notice and inquirers: If you have a script that adds links, tables, <td> tags to parts before where it searchs for the information, then this script won't work. (E.G. you have a extra link in the submenu area; this script won't work properly)
|
|
|
| |
|
retsam
|
Mar 3 2006, 02:28 AM
Post #4
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
Edit: it works on IE fine now
I am in a generous mood, so if you have a site that breaks the above notice, I'll customize the script to fit for the first 5 people who ask.
-[retsam]
|
|
|
| |
|
Zelnen
|
Mar 3 2006, 02:29 AM
Post #5
|
- Posts:
- 1,147
- Group:
- Members
- Member
- #88,597
- Joined:
- January 3, 2006
|
Lol is there a preview thats my ask..
|
|
|
| |
|
retsam
|
Mar 3 2006, 02:33 AM
Post #6
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
*hint click my sig... I didn't make a new forum... I would have had to sign up a lot and spam a lot... So as of now just click there*
-[retsam]
|
|
|
| |
|
Zelnen
|
Mar 3 2006, 02:39 AM
Post #7
|
- Posts:
- 1,147
- Group:
- Members
- Member
- #88,597
- Joined:
- January 3, 2006
|
Wow thats great code! Nice job Retsam!
|
|
|
| |
|
retsam
|
Mar 3 2006, 02:43 AM
Post #8
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
Thanks Zelen... If you want this for your site, I'll get it customized, for you... (But you need to hurry, limited time offer :P)
Glad you all are liking the script. Can anyone tell me if it works on Opera?
EDIT: oh... It seems I found the first error... (I'll fix it tomorrow). The error is that if more than yourself is online, then that shows in the New Posts link (Post, Poster, as far as how many people are online at that time) It'll be a simple fix, no worries, but tomorrow.
-[retsam]
|
|
|
| |
|
Zelnen
|
Mar 3 2006, 02:47 AM
Post #9
|
- Posts:
- 1,147
- Group:
- Members
- Member
- #88,597
- Joined:
- January 3, 2006
|
- retsam
- March 3, 2006 02:43 AM
 Thanks Zelen... If you want this for your site, I'll get it customized, for you... (But you need to hurry, limited time offer :P) Glad you all are liking the script. Can anyone tell me if it works on Opera? -[retsam]
Lol i'm ok i don't need this for my site. It's really good work though.
I wish i could code as good as you..... :wacko:
|
|
|
| |
|
retsam
|
Mar 3 2006, 02:50 AM
Post #10
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
hah... Lol, that's very sloppy and lousy scripting, but thank you...
(I found the solution to the bug, but since i have to get off... It won't be fixed till later tomorrow.)
-[retsam]
|
|
|
| |
|
Runescape Forums
|
Mar 3 2006, 08:27 AM
Post #11
|
If you like runescape... then check out rsforums.net
- Posts:
- 738
- Group:
- Members
- Member
- #16,690
- Joined:
- April 14, 2004
|
I went to your forum but didn't see a preview
|
|
|
| |
|
retsam
|
Mar 3 2006, 02:30 PM
Post #12
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
yeah... I don't know why the script isn't working... It should be back though, so check again.
|
|
|
| |
|
Paper
|
Mar 3 2006, 02:48 PM
Post #13
|
- Posts:
- 2,067
- Group:
- Members
- Member
- #19,225
- Joined:
- May 17, 2004
- I'm Browsing With
- Firefox 3
|
It's back.
Perhaps the server was down for a mintue or two.
Nice work
|
|
|
| |
|
retsam
|
Mar 3 2006, 06:28 PM
Post #14
|
- Posts:
- 829
- Group:
- Members
- Member
- #21,606
- Joined:
- June 15, 2004
|
Thanks paper... Umm.. I am going to work with the members error first, and then I'll work on having it more customable to all IF site.
(Hmm... Although, buggy since so many people asked for this type of thing, I thought that this would have been a little more popular)
-[retsam]
|
|
|
| |
|
Chef_dude548
|
Mar 3 2006, 07:05 PM
Post #15
|
- Posts:
- 64
- Group:
- Members
- Member
- #83,983
- Joined:
- December 8, 2005
|
Hey, retsam, can you set up the code for my board? the url is s13.invisionfree.com?RPGs_v2855
if you need more in te ways of info pretaining to my board, just ask
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|