Gossamer Forum
Quote Reply
Counting different Links
Hi,

I have a Download Site based on Links SQL Dbase with many Links.
Each Link has a field with the information if the Download is Freeware, Shareware, Demo etc.
I will now show how many Links of each Freeware, each Shareware etc. are in the Dbase.

Anyone knows a global for this ??

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

Should be pretty simple. Whats you "type" field? (the one that holds the "freeware", "shareware" etc in?)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
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


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

Last edited by:

Andy: Apr 8, 2008, 4:39 AM
Quote Reply
Re: [Andy] Counting different Links In reply to
Thanks Andy,

that works pretty good Smile

Cheers,
Frank