Code:
sub { my $cat_id = shift;
my $new_nr_limit = shift || 10; # Default is 10
($cat_id && $cat_id =~ /^\d+$/)
|| return "Invalid category ID passed to new_links_of_category global: $cat_id\n";
my $all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids, $cat_id;
my $db_obj = $DB->table('Links','CatLinks','Category');
$db_obj->select_options ('ORDER BY Add_Date DESC Limit $new_nr_limit');
my $sth = $db_obj->select (['Links.*'],
GT::SQL::Condition->new(
['CategoryID', 'IN', $all_ids],
['isValidated', '=', 'Yes',
'isNew', '=', 'Yes']
)
);
my $output;
while (my $link = $sth->fetchrow_hashref) {
$link->{'category_url'} = $CFG->{build_root_url}."/".$link->{'Full_Name'}."/";
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display('link', $link);
}
return $output;
}
Quote:
1 - How about if I want to display only the name of the cat/subcat for the specific cat/subcat that is being displayed.Quote:
2 - and what about if I want to display all the links instead of just the new ones.Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...