Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Showing all categories a link belongs to

Quote Reply
Showing all categories a link belongs to
I am using* this global to show the category name/link in link.html:
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.
Subject Author Views Date
Thread Showing all categories a link belongs to gotze 2011 Apr 14, 2005, 1:30 PM
Thread Re: [gotze] Showing all categories a link belongs to
webmaster33 1916 Apr 14, 2005, 5:59 PM
Thread Re: [webmaster33] Showing all categories a link belongs to
gotze 1901 Apr 15, 2005, 2:19 PM
Thread Re: [gotze] Showing all categories a link belongs to
macbethgr 1888 Apr 17, 2005, 6:38 AM
Post Re: [macbethgr] Showing all categories a link belongs to
macbethgr 1835 Apr 18, 2005, 5:51 AM