Hi,
This could be a global called <%random_listing%>. The show something <%r_listing%>. Not tested yet
Cheers,
sub {
my $db->table('Links');
my $time = time;
my $cond = GT::SQL::Condtion->new(
'ExpiryDate','>', $time,
'ExpiryDate', '<', 2147483647);
my $c = $db->count($cond);
my $r = rand($c);
$db->select_options("Limit $r,1");
my $row = $db->select($cond)->fetchrow_hashref;
return unless(defined $row);
my $r_listing = qq|<a href="$row->{URL}">$row->{Title}</a><br>$row->{Description}|;
return $r_listing;
}
Cheers,
Dat
Programming and creating plugins and templates
Blog
This could be a global called <%random_listing%>. The show something <%r_listing%>. Not tested yet
Cheers,
sub {
my $db->table('Links');
my $time = time;
my $cond = GT::SQL::Condtion->new(
'ExpiryDate','>', $time,
'ExpiryDate', '<', 2147483647);
my $c = $db->count($cond);
my $r = rand($c);
$db->select_options("Limit $r,1");
my $row = $db->select($cond)->fetchrow_hashref;
return unless(defined $row);
my $r_listing = qq|<a href="$row->{URL}">$row->{Title}</a><br>$row->{Description}|;
return $r_listing;
}
Cheers,
Dat
Programming and creating plugins and templates
Blog