Hi,
I'm using the following global to show the users sorted by the number of link entries each user has
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
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