Heya all,
I'm using the global below to generate a list of the 8 latest links.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 8');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
if (length $link->{Title} > 50) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...';
}
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}
I simply call this with a tag: <%global_name%>
I'd like to use this same global on other pages but generate a different number of links, say 2 or 35. How can I pass the value of "limit" to the global from the tag?
Safe swoops
Sangiro
I'm using the global below to generate a list of the 8 latest links.
Code:
sub { my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 8');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
if (length $link->{Title} > 50) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...';
}
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}
I simply call this with a tag: <%global_name%>
I'd like to use this same global on other pages but generate a different number of links, say 2 or 35. How can I pass the value of "limit" to the global from the tag?
Safe swoops
Sangiro