Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

10 Most active link submitter?

Quote Reply
10 Most active link submitter?
Hello,

Is there any global which display 10 users most active submitting links? Thanks in advanced.

Best regards,

Kay
Quote Reply
Re: [Kay] 10 Most active link submitter? In reply to
umm..., anybody..?? Blush
Quote Reply
Re: [Kay] 10 Most active link submitter? In reply to
That's a good one ...
Quote Reply
Re: [SSmeredith] 10 Most active link submitter? In reply to
How would you want it worked out? Just by the highest people to add links?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] 10 Most active link submitter? In reply to
I would like something like ...

See our "Top 10 Contributors"

And list by username and/or company ( if added)
Quote Reply
Re: [Andy] 10 Most active link submitter? In reply to
Was anything like this ever created? Would be good to have for "most links submitted' as well as "most reviews" done. Surprised that there are so little stats globals that focus on the users instead of the links.

Safe swoops
Sangiro

Last edited by:

sangiro: May 18, 2006, 6:33 AM
Quote Reply
Re: [sangiro] 10 Most active link submitter? In reply to
Hi,

This should do it Tongue

Code:
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 };

}

Cal with:



Code:
<%top_submitter('1')%>

<%loop Top_Submitter_Loop%>
<%Username%> (<%LinkCount%>) <br/>
<%endloop%>

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!