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

all_link_in_category global

Quote Reply
all_link_in_category global
Hi
I have tried finding a way to list all links from selected categories on a separet page in a lphabetical order with no luck..

I found one global:

sub {
my $ID $_[0];
my $table = $DB->table('CatLinks','Links');
my $sth = $table->( { CategoryID => $ID }, { isValidated => 'Yes' } ) || return $GT::SQL::error;
my @titles;
while (my $hit = $sth->fetchrow_hashref) {
push(@titles,$hit->{Title});
}
return join(",",@titles);
}

But it does not seem to work..
Anyone has this working
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] all_link_in_category global In reply to
sub {
my $ID=shift;
my $table = $DB->table('CatLinks','Links');
my $sth = $table->select({ CategoryID => $ID, isValidated => 'Yes' } ) || return $GT::SQL::error;
my $output;
while (my $hit = $sth->fetchrow_hashref) {
$output.=qq~<li>$hit->{Title}~;
}
return $output;
}