I would like to have a listing of "active" categories, that is, categories containing new links.
I thought I could do something template-based with <%if Has_New_Links eq 'Yes'%> etc., but can't get it to work, and now think I need a global to do this. I've tried something like:
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ID DESC');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
my $cat_db = $DB->table('Category');
my @root_cats = $cat_db->select ['Full_Name']->fetchall_list;
...
}
return $output;
}... but can't get it right.
Can anyone help, please?
John
I thought I could do something template-based with <%if Has_New_Links eq 'Yes'%> etc., but can't get it to work, and now think I need a global to do this. I've tried something like:
Code:
sub { my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ID DESC');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
my $cat_db = $DB->table('Category');
my @root_cats = $cat_db->select ['Full_Name']->fetchall_list;
...
}
return $output;
}
Can anyone help, please?
John