Hi Essam,
So we must create ShowSubCategoryLinks in Category Table[/url] as column??? then create a global called subcategory_links with:
sub {
my $output;
my $tags = shift;
return '' unless ($tags->{ShowSubCategoryLinks});
my $cat_id = $tags->{ID};
my $subcats = $DB->table('Category')->children($cat_id);
push @$subcats, $cat_id;
my $link_db = $DB->table('Links','CatLinks');
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','CategoryID', 'IN', $subcats);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$output .= qq~<li><a href="$CFG->{db_cgi_url}/jump.cgi?ID=$link->{ID}">$link->{'Title'}~;
}
return $output;
}
Le me know and thanks in advance
Antoine
So we must create ShowSubCategoryLinks in Category Table[/url] as column??? then create a global called subcategory_links with:
sub {
my $output;
my $tags = shift;
return '' unless ($tags->{ShowSubCategoryLinks});
my $cat_id = $tags->{ID};
my $subcats = $DB->table('Category')->children($cat_id);
push @$subcats, $cat_id;
my $link_db = $DB->table('Links','CatLinks');
my $condition = GT::SQL::Condition->new( 'isValidated','=','Yes','CategoryID', 'IN', $subcats);
my $sth = $link_db->select($condition);
while (my $link = $sth->fetchrow_hashref) {
$output .= qq~<li><a href="$CFG->{db_cgi_url}/jump.cgi?ID=$link->{ID}">$link->{'Title'}~;
}
return $output;
}
Le me know and thanks in advance
Antoine