I am using* this global to show the category name/link in link.html:
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
$name =~ s/ /_/g;
$cat = "<a href=$CFG->{build_root_url}/$name>$name</a> ";
}
return $cat;
}
Now, this shows the "main" category.
Can anyone suggest how to show the additional categories, a link belongs to? That could be one or more categories. Or none at all (i.e., a link only belongs to one category).
*: I've used it in 2.xx as well as now in 3.00.
Code:
sub { my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Category','CatLinks');
my $sth = $db->select ( { 'CatLinks.LinkID' => $id }, ['Category.ID', 'Category.Full_Name'] );
my $cat;
while (my ($id,$name) = $sth->fetchrow_array) {
$name =~ s/ /_/g;
$cat = "<a href=$CFG->{build_root_url}/$name>$name</a> ";
}
return $cat;
}
Now, this shows the "main" category.
Can anyone suggest how to show the additional categories, a link belongs to? That could be one or more categories. Or none at all (i.e., a link only belongs to one category).
*: I've used it in 2.xx as well as now in 3.00.