Hi,
You should use globals, add something like:
top5 =>
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;
}and then just put <%top5%> somewhere on your home.html page.
Cheers,
Alex
--
Gossamer Threads Inc.
You should use globals, add something like:
top5 =>
Code:
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;
}
Cheers,
Alex
--
Gossamer Threads Inc.