diff options
author | Graham Eames <grahamje@users.sourceforge.net> | 2005-12-12 21:58:14 +0000 |
---|---|---|
committer | Graham Eames <grahamje@users.sourceforge.net> | 2005-12-12 21:58:14 +0000 |
commit | c12fd5d434c9a3cda6bedb2d450243b278cd5dcb (patch) | |
tree | 6994464e49479d2c26c2fef2c2570da108825c5d /phpBB/includes/functions_admin.php | |
parent | ca4026013182ee19d4beab268bdb040b1d99f974 (diff) | |
download | forums-c12fd5d434c9a3cda6bedb2d450243b278cd5dcb.tar forums-c12fd5d434c9a3cda6bedb2d450243b278cd5dcb.tar.gz forums-c12fd5d434c9a3cda6bedb2d450243b278cd5dcb.tar.bz2 forums-c12fd5d434c9a3cda6bedb2d450243b278cd5dcb.tar.xz forums-c12fd5d434c9a3cda6bedb2d450243b278cd5dcb.zip |
Clean up and abstract the code for listing warned users
git-svn-id: file:///svn/phpbb/trunk@5329 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 967f76d40e..3991d228e7 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2007,6 +2007,36 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id return; } +/** +* Lists warned users +*/ +function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $sort_by = 'user_warnings DESC') +{ + global $db; + + $sql = 'SELECT user_id, username, user_warnings + FROM ' . USERS_TABLE . " + WHERE user_warnings > 0 + ORDER BY $sort_by"; + $result = $db->sql_query_limit($sql, $limit, $offset); + + $users = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + $sql = 'SELECT count(user_id) AS user_count + FROM ' . USERS_TABLE . ' + WHERE user_warnings > 0'; + + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $user_count = $row['user_count']; + + return; +} + if (class_exists('auth')) { /** |