Hi
I have created a new global to display a random link:
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;
if (length $link->{Title} > 20) {
$link->{Title} = substr($link->{Title}, 0, 20) . '...';
}
my $html = Links::SiteHTML::display('link', $link);
return $html;
}
How to I limit that global to pick up only a specific links? lets say only the once that has Description? so links without one will not be randomed..
Regards
KaTaBd
Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
I have created a new global to display a random link:
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;
if (length $link->{Title} > 20) {
$link->{Title} = substr($link->{Title}, 0, 20) . '...';
}
my $html = Links::SiteHTML::display('link', $link);
return $html;
}
How to I limit that global to pick up only a specific links? lets say only the once that has Description? so links without one will not be randomed..
Regards
KaTaBd
Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory