Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
[Code] TOP 5 STATS; Top Poster, New Members, New Posts
Topic Started: Mar 3 2006, 01:57 AM (2,711 Views)
retsam
Lustful Love <3
 *   *   *   *  
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:
 

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"

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 :P

-[retsam]
Offline Profile Quote Post Goto Top
 
Dragon Hellfire
Member
 *   *  
Good Code, nice job on it
Offline Profile Quote Post Goto Top
 
retsam
Lustful Love <3
 *   *   *   *  
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)
Offline Profile Quote Post Goto Top
 
retsam
Lustful Love <3
 *   *   *   *  
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]
Offline Profile Quote Post Goto Top
 
Zelnen
Member Avatar
//*iampErFeCtIoN-
 *   *   *   *   *  
Lol is there a preview thats my ask..
Offline Profile Quote Post Goto Top
 
retsam
Lustful Love <3
 *   *   *   *  
*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]
Offline Profile Quote Post Goto Top
 
Zelnen
Member Avatar
//*iampErFeCtIoN-
 *   *   *   *   *  
Wow thats great code! Nice job Retsam!
Offline Profile Quote Post Goto Top
 
retsam
Lustful Love <3
 *   *   *   *  
:P 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]
Offline Profile Quote Post Goto Top
 
Zelnen
Member Avatar
//*iampErFeCtIoN-
 *   *   *   *   *  
retsam
March 3, 2006 02:43 AM
:P 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:
Offline Profile Quote Post Goto Top
 
retsam
Lustful Love <3
 *   *   *   *  
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]
Offline Profile Quote Post Goto Top
 
Runescape Forums
Member Avatar
If you like runescape... then check out rsforums.net
 *   *   *   *  
I went to your forum but didn't see a preview
Offline Profile Quote Post Goto Top
 
retsam
Lustful Love <3
 *   *   *   *  
yeah... I don't know why the script isn't working... It should be back though, so check again.
Offline Profile Quote Post Goto Top
 
Paper
Member Avatar
Member
 *   *   *   *   *   *  
It's back.

Perhaps the server was down for a mintue or two.

Nice work :)
Offline Profile Quote Post Goto Top
 
retsam
Lustful Love <3
 *   *   *   *  
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]
Offline Profile Quote Post Goto Top
 
Chef_dude548
Member Avatar
Member
 *   *  
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
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Code Snippets · Next Topic »
Add Reply