PDA

View Full Version : DEFAULT VIEW: Memberlist -- Top Posters


Xube
10-14-2003, 03:47 PM
I'm guessing/hoping that this hack has probably already been requested and created but I haven't been able to find it while looking so far:

Right now the default view for the memberlist is to show members alphabetically. Is there a hack existing that changes the default view (the view you get when you first click on the memberlist button) so that it shows the members listed by the highest number of posts to lowest number of posts?

:) Thanks if anyone has this or knows where I can find it.

EvilLS1
10-14-2003, 08:32 PM
In memberlist.php find:

if ($what=="topposters") {
$orderby="posts";
$direction="DESC";
}


Above it add:

if ($what=="username") {
$orderby="username";
$direction="ASC";
}


Find:

if ($orderby=="" or ($orderby!="username" and $orderby!="posts" and $orderby!="joindate" and $orderby!="lastpost")) {
$what = 'username';
$orderby="username";
}


Replace it with:

if ($orderby=="" or ($orderby!="username" and $orderby!="posts" and $orderby!="joindate" and $orderby!="lastpost")) {
$what = 'topposters';
$orderby="posts";
$direction="DESC";
}


In your memberlist template find:

<td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]"><b>List Alphabetically</b></a></smallfont></td>


Replace it with:

<td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]&what=username"><b>List Alphabetically</b></a></smallfont></td>

Gary King
10-14-2003, 11:19 PM
The better way would be to do the following:

open memberlist.php and find require("./global.php");
below it, add:$what="topposters";


Simple as that ;)

EvilLS1
10-14-2003, 11:34 PM
If you do it that way the List Alphabetically and List by Date Joined links will no longer work b/c $what will always be defined as topposters.

The easiest way to do it would be to simply replace the memberlist link with this:
<a href="memberlist.php?s=$session[sessionhash]&what=topposters">

But I figured the guy has already considered that and didn't wanna do it that way for whatever reason. *shrugs*

Gary King
10-15-2003, 12:05 AM
If you do it that way the List Alphabetically and List by Date Joined links will no longer work b/c $what will always be defined as topposters.

The easiest way to do it would be to simply replace the memberlist link with this:
<a href="memberlist.php?s=$session[sessionhash]&what=topposters">

But I figured the guy has already considered that and didn't wanna do it that way for whatever reason. *shrugs*
True, true. Yes, replacing the link with that would be best.

Xube
10-16-2003, 04:44 AM
If you do it that way the List Alphabetically and List by Date Joined links will no longer work b/c $what will always be defined as topposters.

The easiest way to do it would be to simply replace the memberlist link with this:
<a href="memberlist.php?s=$session[sessionhash]&what=topposters">

But I figured the guy has already considered that and didn't wanna do it that way for whatever reason. *shrugs*

:squareeyed: Thanks for some great advice and for the codings! So, if I replace the memberlist link with that new link, then clicking on it would take me to the list of top posting users, but... would members still be able to later change the order of how the memberlist appears. (change the list into ordering by date joined, etc).

EvilLS1
10-16-2003, 04:50 AM
So, if I replace the memberlist link with that new link, then clicking on it would take me to the list of top posting users, but... would members still be able to later change the order of how the memberlist appears. (change the list into ordering by date joined, etc).

Yep. :)

Xube
10-16-2003, 06:17 PM
Yep. :)

Many thanx!! It worked like a charm! :banana: