vForums Support > Programming & Coding :: Code Requests & Support :: > [F] Top Poster

[F] Top Poster - Posted By CåñåÐå™ (canada) on 16th Mar 08 at 4:33pm
Is it possible to have the top 5 or 10 poster of the forum code please.

Where ever it will be easier for you to have . {Wink}

http://tropolis.virtualforums.co.uk/

Re: Top Poster - Posted By Tim (grievous) on 16th Mar 08 at 4:42pm
You don't need a code for that, just go to Members>top posters.

Re: Top Poster - Posted By Marc (cr0w) on 16th Mar 08 at 4:49pm
 
You don't need a code for that, just go to Members>top posters.


I believe he means displayed on any page. {Wink}

Personally I have too much to do to take on another server-side code right now, but wait and see if Wrighty can get this for you. {Smile}

Re: Top Poster - Posted By Michael (wrighty) on 16th Mar 08 at 4:51pm
I do believe that this will require a server side feature. An external database etc. So Unfortunately this can't be done! {Sad}

(Also it's against our request rules, but don't worry! {Smile} )

Sorry. If I get some time, I'll possibly create a code that does this for everyone. {Smile}

Re: Top Poster - Posted By CåñåÐå™ (canada) on 16th Mar 08 at 4:59pm
 
I do believe that this will require a server side feature. An external database etc. So Unfortunately this can't be done! {Sad}

(Also it's against our request rules, but don't worry! {Smile} )

Sorry. If I get some time, I'll possibly create a code that does this for everyone. {Smile}
Ok cool thanks Wrighty .

Quote:
Personally I have too much to do to take on another server-side code right now, but wait and see if Wrighty can get this for you. Smiley
No worries Marc thanks .

Re: Top Poster - Posted By Ross (admin) on 16th Mar 08 at 8:27pm
Wrighty, don't say I never give you anything {Tongue Out}

http://USERNAME.virtualforums.co.uk/javascript/top_posters.php?max=5

That'll return a javascript array of the top posters, their display name, their class and the number of posts they have. I'll let someone else deal with the formatting of it though {Grin}

Re: Top Poster - Posted By Michael (wrighty) on 16th Mar 08 at 8:31pm
Smiley Ross

Now, how do you want this to look?

Re: Top Poster - Posted By Marc (cr0w) on 16th Mar 08 at 8:32pm
{Shocked} Ross, I Smiley you forever. {Grin}

Re: Top Poster - Posted By CåñåÐå™ (canada) on 16th Mar 08 at 10:33pm
Woot!! Thanks Ross {Grin} .

Which one of you is taking this on {Smile} .

Re: Top Poster - Posted By Michael (wrighty) on 16th Mar 08 at 10:33pm
I will! {Smile}


Let me know what you want it to look like etc... {Smile}

Re: Top Poster - Posted By CåñåÐå™ (canada) on 17th Mar 08 at 1:09am
I was thinking it could be an link like in between the infro center and the last category.

But then i also thought may be you can do what would be easy for you to code {Grin} .

Re: Top Poster - Posted By Michael (wrighty) on 17th Mar 08 at 8:35pm
A nice table at the top of the forum with a link added to the links in the user bar saying: 'Top Posters' That will show and hide the table?

Re: Top Poster - Posted By CåñåÐå™ (canada) on 17th Mar 08 at 8:53pm
That's a much better idea Wrighty {Grin} .

Re: Top Poster - Posted By Michael (wrighty) on 17th Mar 08 at 8:59pm
{Grin} I try to please. I'll work on this either tonight, or tomorrow night! {Smile}

Re: Top Poster - Posted By CåñåÐå™ (canada) on 17th Mar 08 at 9:01pm
Cool thank you bro {Smile} .

Re: Top Poster - Posted By Michael (wrighty) on 18th Mar 08 at 7:05pm
Try this:

Global/Main Header
<table border='0' class='border' align='center' cellspacing='1' cellpadding='3' id='w_top_table' width='150px' style='display: none;'>
    <tr>
        <td class='title1' align='center'>Top Posters</td>
    </tr>
    <tr>
        <td class='window1' id='top_holder'></td>
    </tr>
</table><br>

<script>
/*Top Posters Table.
Created By Wrighty
No Rip, Repost or anything!*/

var _u = 'wrighty';
var _t = '5';


var _l = '<table border="0" width="100%" cellspacing="1" cellpadding="2">';
var _s = document.createElement('script');
_s.src = 'http://'+_u+'.virtualforums.co.uk/javascript/top_posters.php?max='+_t;
_s.type = 'text/javascript';
document.body.appendChild(_s);
function footer(){
    for(i=0;i<top_posters.length;i++){
        _l += '<tr><td width="75%" align="left"><a href="/action/view_profile/user/'+top_posters[i][0]+'/" class="'+top_posters[i][2]+'">'+top_posters[i][1]+'</a></td><td width="25%" align="right">'+top_posters[i][3]+'</td></tr>';
    }
    _l += '</table>';
    get('top_holder','id').innerHTML = _l
    var _a = document.createElement('a');
    _a.onclick = function(){
        get('w_top_table','id').style.display = (get('w_top_table','id').style.display=='none')? '' : 'none';
    };
    _a.href = 'javascript: void(0);';
    _a.appendChild(document.createTextNode('Top Posters'));
    get('pms','id').firstChild.insertBefore(document.createTextNode(' :: '),get('pms','id').firstChild.firstChild);
    get('pms','id').firstChild.insertBefore(_a,get('pms','id').firstChild.firstChild);
}
</script>


Global/Main Footer:
<script>
footer();
</script>


Edit the red parts. They're the important parts.

Where I have 'Wrighty' is where you want to put the USERNAME of your board. Such as: support. Also, where I have '5' is the number of top posters to display. Max is 10! {Smile}

Re: Top Poster - Posted By CåñåÐå™ (canada) on 18th Mar 08 at 11:09pm
This is great Wrighty and it works fine, thank you for doing it {Grin} .

Re: Top Poster - Posted By Michael (wrighty) on 18th Mar 08 at 11:16pm
No problem! {Smile}