Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Scoop Box Exchange - Show Box: random_stories 1.00

Author: theantix [Info]

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;
Display: Sort:
Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
Keepers of Lists
Got Lists? We've got over 1800

Login
Make a new account
Username:
Password:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search