I am using the following Global to display a random link in the rightsidebar (SQL Links 3.2+)
Now this Global works on homepage and on the detailed pages of the links but not when displaying the subcategories!
sub {
my $db = $DB->table('Links');
my $total = $db->count ( 'isValidated' => 'Yes' );
my $rand = int( rand($total) );
$db->select_options ("LIMIT $rand, 1");
my $link = $db->select->fetchrow_hashref;
my $html = Links::SiteHTML::display('link', $link);
return $html;
}
what is wrong with it?
Thanks
Antoine
Now this Global works on homepage and on the detailed pages of the links but not when displaying the subcategories!
sub {
my $db = $DB->table('Links');
my $total = $db->count ( 'isValidated' => 'Yes' );
my $rand = int( rand($total) );
$db->select_options ("LIMIT $rand, 1");
my $link = $db->select->fetchrow_hashref;
my $html = Links::SiteHTML::display('link', $link);
return $html;
}
what is wrong with it?
Thanks
Antoine