I found the answers from within this forum, after various search terms and putting the 'pieces' together.
This is a summary of what I found:
added global:
top_submitter using this code from Andy Newby ( UltraNerds ) sub {
my $back;
my @links;
my $min_links = $_[0] || 2;
my $Links = $DB->table('Links');
$Links->select_options('GROUP BY LinkOwner', "HAVING link_cnt > $min_links", 'ORDER BY link_cnt DESC','LIMIT 10');
my $cond = new GT::SQL::Condition;
$cond->add('LinkOwner','!=','admin');
my $sth = $Links->select(
['LinkOwner',
'COUNT(LinkOwner) AS link_cnt'], $cond) || return $GT::SQL::error;
while (my ($user) = $sth->fetchrow_array) {
my $link = $DB->table('Users')->get( { Username => $user } );
$link->{LinkCount} = $DB->table('Links')->count( { LinkOwner => $user } );
push @links, $link;
}
return { Top_Submitter_Loop => \@links };
}
-------------------
A new template page added to the 'luna' templates folder, topusers.html
-------------------
Combined with this, againf
from Andy Newby ( UltraNerds ) which I modified to add the hyperlink, which is added to the new templete page topusers.html
<%top_submitter('1')%>
<%loop Top_Submitter_Loop%>
<a href="http://www.yoursite.com/cgi-bin/search.cgi?LinkOwner=<%Username%>"><%Username%></a> (<%LinkCount%>) <br/>
<%endloop%>
-------------------
This is called up using the page.cgi function
Like this:
http://www.skinnyboo.com/.../page.cgi?p=topusers I hope this helps anybody else looking for something similar to display top users
NOTE: number of users displayed can be edited on one of the lines in the global
'ORDER BY link_cnt DESC','LIMIT 10'); (this will display top 10)
'ORDER BY link_cnt DESC','LIMIT 20'); (this will display top 20)
Many thanks to the 'techies' and forum contributors.
Colin Thompson