Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [antz2008] top 10 user

Quote Reply
Re: [antz2008] top 10 user In reply to
Hi,

You can do this with your own global. Add a global:

top10_users

that has:

Code:
sub {
my $output;
my $user_tb = $DB->table('User');
$user_tb->select_options("ORDER BY user_posts DESC", "LIMIT 10");
my $sth = $user_tb->select;
while (my $user = $sth->fetchrow_hashref) {
$output .= qq~
<a href="gforum.cgi?username=$user->{user_username}">$user->{user_username} ($user->{user_posts})</a><br>
~;
}
return $output;
}


Then just put <%top10_users%> wherever you want the user list displayed. Hope that helps,

Alex
--
Gossamer Threads Inc.
Subject Author Views Date
Thread top 10 user antz2008 1924 May 13, 2002, 9:49 AM
Thread Re: [antz2008] top 10 user
Alex 1873 May 13, 2002, 10:10 AM
Post Re: [Alex] top 10 user
antz2008 1850 May 13, 2002, 8:30 PM