Gossamer Forum
Quote Reply
Select Modification
This global takes the current category ID when on a category template. How do I hardcode a category ID instead? This global could then be used on the home page with any category ID I wish to use.

Code:
sub {
my ($all_ids,@list,$output);
my $tags = shift;
my $cat_id = $tags->{ID};
$all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids, $cat_id;
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options ('ORDER BY Title DESC LIMIT 40');
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','CategoryID', 'IN', $all_ids);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$output .= qq~<option value="$CFG->{db_cgi_url}/jump.cgi?ID=$link->{ID}">$link->{'Title'}</option>~;
}
return $output;
}

--------------------------------
Privacy Software

Last edited by:

BLOOD: May 12, 2004, 8:36 AM
Quote Reply
Re: [BLOOD] Select Modification In reply to
You should be able to just replace;

Code:
my $cat_id = $tags->{ID};

with...

Code:
my $cat_id = $tags->{ID} || '0';

.. which *should* then work on it based on it being the root category.

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] Select Modification In reply to
Cheers Andy Cool

I had something similar to that but it didn’t work. Yours does - many thanks!

--------------------------------
Privacy Software