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

Products: Gossamer Links: Development, Plugins and Globals: Re: [Matthias70] Number of links in one category: Edit Log

Here is the list of edits for this post
Re: [Matthias70] Number of links in one category
Hi,l

So literally just grab the number of links in a given sub-category?

There are a couple of ways of doing this...

1) Add the new global: get_subcat_count

Code:
sub {
return $DB->table('CatLinks')->count( { CategoryID => $_[0] } ) || 0;
}

...call with:

<%get_subcat_count(1234)%> (1234 = the category ID you wanna get)

2) Use the existing field in the Category table:

get_subcat_count

Code:
sub {
return $DB->table('Category')->select( ['Direct_Links'], { ID => $_[0] } )->fetchrow;
}

Untested, but both of those should do the trick (the 2nd one is probably the better option, seeing as GLinks has already been so nice to give you that value <G>)

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: Mar 12, 2011, 3:13 AM

Edit Log: