Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Top5 global links format?

Quote Reply
Top5 global links format?
We are trying to change the output on the Top5 global. Here is the global:

sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 5');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top5_loop => \@output };
}

On other globals we used the following formatting code:

$output .= Links::SiteHTML::display ('link', $link)

How can we incorporate this formatting in the global?
Quote Reply
Re: [OP] Top5 global links format? In reply to
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 5');
my $sth = $table->select;
my $output;
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link)
}
return $output;
}

Last edited by:

afinlr: Feb 2, 2004, 5:38 AM