where I must pt this code? sub { my $vals = shift; my $link_db = $DB->table ('Links'); $link_db->select_options ('ORDER BY Hits DESC', 'LIMIT 5'); my $sth = $link_db->select; my $output = ''; while (my $link = $sth->fetchrow_hashref) { $output .= Links::SiteHTML::display('link', $link); } return $output; }
Can U explain so weel? Thanks Andy Bye from Italy Fabio
Note: the output will be formatted from the links.html template, the code needs some work to call a separate template so you could format to your liking.
Fabio, it's just the global last 5 links, as written by alex and released in the docs. As eraser says, you need to put it in the global. If you want last 5 in cat, you'll need to add a few more qualifiers to it. It's under gt >> sql. Hope this helps.