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

Re: [qix] Counting different Links

Quote Reply
Re: [qix] Counting different Links In reply to
Hi,

Here you go:

Make a new global - called "count_links_with_type"

Code:
sub {
my $field = 'Type';
return $DB->table('Links')->count( { $field => $_[0] } ) || 0;
}

Be sure to edit the bit in red to the field name that holds the download type =)

Then, call with:

Code:
Freeware: <%count_links_with_type('Freeware')%>
Shareware: <%count_links_with_type('Shareware')%>
..etc

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!

Last edited by:

Andy: Apr 8, 2008, 4:39 AM
Subject Author Views Date
Thread Counting different Links qix 3927 Apr 8, 2008, 4:09 AM
Post Re: [qix] Counting different Links
Andy 3806 Apr 8, 2008, 4:35 AM
Thread Re: [qix] Counting different Links
Andy 3802 Apr 8, 2008, 4:38 AM
Post Re: [Andy] Counting different Links
qix 3775 Apr 8, 2008, 10:53 AM