Hi Oliver,
This global will show all the new links in the category and sub categories. I hope this is something like what you were looking for.
sub {
my $tags = shift;
my @list;
my $cat_id = $tags->{'ID'};
my $name = $tags->{'Name'};
my $link_db = $DB->table('Links','CatLinks');
my $cat_db = $DB->table('Category');
my $sth2 = $cat_db->select ( ['ID'],{ FatherID => $cat_id });
$link_db->select_options ("ORDER BY Add_Date");
my $sth = $link_db->select ( { CategoryID => $cat_id, isValidated => 'Yes', isNew =>'Yes' });
my $output = qq~ <b>New Links in $name:</b><br> ~;
while (my $link = $sth->fetchrow_hashref) {
push @list, $link->{'Title'};
}
while (my ($child_id) = $sth2->fetchrow_array){
my $sth3 = $link_db->select ( { CategoryID => $child_id, isValidated => 'Yes', isNew => 'Yes' });
while (my $link2 = $sth3->fetchrow_hashref) {
push @list, $link2->{'Title'};
}
}
foreach my $link (@list) {
$output .= "<li>$link";
}
return $output;
}
Laura.
This global will show all the new links in the category and sub categories. I hope this is something like what you were looking for.
sub {
my $tags = shift;
my @list;
my $cat_id = $tags->{'ID'};
my $name = $tags->{'Name'};
my $link_db = $DB->table('Links','CatLinks');
my $cat_db = $DB->table('Category');
my $sth2 = $cat_db->select ( ['ID'],{ FatherID => $cat_id });
$link_db->select_options ("ORDER BY Add_Date");
my $sth = $link_db->select ( { CategoryID => $cat_id, isValidated => 'Yes', isNew =>'Yes' });
my $output = qq~ <b>New Links in $name:</b><br> ~;
while (my $link = $sth->fetchrow_hashref) {
push @list, $link->{'Title'};
}
while (my ($child_id) = $sth2->fetchrow_array){
my $sth3 = $link_db->select ( { CategoryID => $child_id, isValidated => 'Yes', isNew => 'Yes' });
while (my $link2 = $sth3->fetchrow_hashref) {
push @list, $link2->{'Title'};
}
}
foreach my $link (@list) {
$output .= "<li>$link";
}
return $output;
}
Laura.