Description:
Returns a bulleted list of randomly retrieved stories.
Box Code:
# tweak the $story_count if you want to return more/less stories
my $story_count=2;
my ($rv,$sth) = $S->db_select({
FROM => 'stories',
WHAT => 'sid, title',
WHERE => "section<>'diary'",
ORDER_BY => 'rand()',
LIMIT => "$story_count"
});
my $return;
while (my $story = $sth->fetchrow_hashref()) {
my $sid = $story->{sid};
my $title = $story->{title};
$return .= qq{|dot| <A HREF="|rootdir|/$sid">$title</A> <BR>};
}
$sth->finish();
return $return;
|