Gossamer Forum
Quote Reply
User Toplist
Hi,
I'm using the following global to show the users sorted by the number of link entries each user has
Code:
sub {

my $db = $DB->table('Links');
$db->select_options( "GROUP BY LinkOwner","ORDER BY link_count DESC" );
my $sth = $db->select("LinkOwner", "COUNT(*) as link_count") or die "Query Error: $GT::SQL::error";

my $back;
while (my ($s, $c) = $sth->fetchrow_array) {
if ($c < 7) { next; }
my $url = $CFG->{db_cgi_url} . "/search.cgi?query=;LinkOwner=$s";
$back .= qq|> <a href="$url">$s</a> ($c Einträge) <br />|;
}

return $back;

}

Can this code be modified to show the users sorted by the number of hits all their links have.
I have the number of hits each user has in this variable <%users_hits($Username)%>
Output should be something like this
1. User A: 1000 hits
2. User B: 900 hits
3. User C: 500 hits

Thanks
Matthias

Matthias
gpaed.de
Subject Author Views Date
Thread User Toplist Matthias70 4222 Sep 29, 2007, 11:23 AM
Thread Re: [Matthias70] User Toplist
tandat 4116 Sep 29, 2007, 7:20 PM
Post Re: [tandat] User Toplist
Matthias70 4081 Sep 30, 2007, 12:03 AM
Thread Re: [tandat] User Toplist
Matthias70 4100 Sep 30, 2007, 3:03 AM
Thread Re: [Matthias70] User Toplist
tandat 4075 Sep 30, 2007, 3:14 AM
Post Re: [tandat] User Toplist
Matthias70 4066 Sep 30, 2007, 3:22 AM