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: list_all_users 1.00

Author: theantix [Info]

Description:

This box just very simply lists all of the users, ordered by user id

Box Code:

#return nothing for non-admins
return '' unless $S->have_perm('story_admin');

my ($rv,$sth) = $S->db_select({
WHAT => 'u.nickname, u.uid',
FROM => 'users u',
ORDER_BY=> "u.uid"
});

my $return='<div class="userlist">';

if ( $rv ) {
while (my $r = $sth->fetchrow_hashref) {
$return .= '<a href="/scoop/user/uid:' . $r->{uid} . '">' . $r->{nickname} . ' <br />';
};
}

$sth->finish();

$return .= '</div>';

return $return ;
Display: Sort:
Some more info (none / 0) (#1)
by cam on Sat Mar 26, 2005 at 09:52:44 AM PST

This line;

$return .= '..... etc etc etc';

Needs the "a" tag to be closed. Also to have the users list by descending order and limit it to the last ten users replace the SQL statement with;

my ($rv,$sth) = $S->db_select({
    WHAT => 'u.nickname, u.uid',
    FROM => 'users u',
    ORDER_BY=> "u.uid DESC",
    LIMIT=> "0,10"
});

cam



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