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

Re: [gotze] Showing all categories a link belongs to

Quote Reply
Re: [gotze] Showing all categories a link belongs to In reply to
There is a small bug in it (highlighted in red):
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;
}


Since $cat was always overwritten (not concatenated), finally you always got displayed the last link value, only.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Apr 14, 2005, 6:00 PM
Subject Author Views Date
Thread Showing all categories a link belongs to gotze 3124 Apr 14, 2005, 1:30 PM
Thread Re: [gotze] Showing all categories a link belongs to
webmaster33 2986 Apr 14, 2005, 5:59 PM
Thread Re: [webmaster33] Showing all categories a link belongs to
gotze 2970 Apr 15, 2005, 2:19 PM
Thread Re: [gotze] Showing all categories a link belongs to
macbethgr 2956 Apr 17, 2005, 6:38 AM
Post Re: [macbethgr] Showing all categories a link belongs to
macbethgr 2904 Apr 18, 2005, 5:51 AM