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.
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
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