Hi, this is my current new link global to get the number of new links for a category and all categories under it. Its not working, not sure why, and also how do i make it so it only displays on main category pages?
sub {
my $catid = shift;
my ($output,$link);
my $all_ids = $DB->table('Category')->children($catid);
push @$all_ids, $catid;
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC,Timestmp DESC,Title Limit 10');
my $cond = GT::SQL::Condition->new('CategoryID', 'IN', $all_ids,'isValidated', '=', 'Yes');
my $sth = $table->select($cond);
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_new', $link);
}
return $output;
}
sub {
my $catid = shift;
my ($output,$link);
my $all_ids = $DB->table('Category')->children($catid);
push @$all_ids, $catid;
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC,Timestmp DESC,Title Limit 10');
my $cond = GT::SQL::Condition->new('CategoryID', 'IN', $all_ids,'isValidated', '=', 'Yes');
my $sth = $table->select($cond);
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_new', $link);
}
return $output;
}