Try this code:
my $cat_id = shift;
my $all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids, $cat_id;
my $link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY Add_Date DESC LIMIT 5");
my $condition = GT::SQL::Condition->new(
'isValidated','=','Yes',
'isNew','=','Yes',
'CategoryID', 'IN', \@$all_ids
);
my $sth = $link_db->select($condition);
my $output;
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('link_homenew', $link);
}
return $output;
}
Just added the detailed_url tag, and did some code style changes.
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...
Code:
sub { my $cat_id = shift;
my $all_ids = $DB->table('Category')->children($cat_id);
push @$all_ids, $cat_id;
my $link_db = $DB->table('Links','CatLinks','Category');
$link_db->select_options ("ORDER BY Add_Date DESC LIMIT 5");
my $condition = GT::SQL::Condition->new(
'isValidated','=','Yes',
'isNew','=','Yes',
'CategoryID', 'IN', \@$all_ids
);
my $sth = $link_db->select($condition);
my $output;
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('link_homenew', $link);
}
return $output;
}
Just added the detailed_url tag, and did some code style changes.
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...