diff options
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r-- | phpBB/memberlist.php | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index af86af4d73..364a3cd523 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -151,7 +151,7 @@ switch ($mode) $db->sql_freeresult($result); $sql_ary = array( - 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id', + 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_type, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id', 'FROM' => array( USER_GROUP_TABLE => 'ug', @@ -314,6 +314,8 @@ switch ($mode) 'RANK_IMG' => $user_rank_data['img'], 'RANK_IMG_SRC' => $user_rank_data['img_src'], + 'S_INACTIVE' => $row['user_type'] == USER_INACTIVE, + 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '', 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), @@ -1025,6 +1027,23 @@ switch ($mode) FROM ' . POSTS_TABLE . ' WHERE poster_ip ' . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips) AND " . $db->sql_in_set('forum_id', $ip_forums); + + /** + * Modify sql query for members search by ip address / hostname + * + * @event core.memberlist_modify_ip_search_sql_query + * @var string ipdomain The host name + * @var string ips IP address list for the given host name + * @var string sql The SQL query for searching members by IP address + * @since 3.1.7-RC1 + */ + $vars = array( + 'ipdomain', + 'ips', + 'sql', + ); + extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_ip_search_sql_query', compact($vars))); + $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) @@ -1165,6 +1184,32 @@ switch ($mode) $order_by .= ', u.user_posts DESC'; } + /** + * Modify sql query data for members search + * + * @event core.memberlist_modify_sql_query_data + * @var string order_by SQL ORDER BY clause condition + * @var string sort_dir The sorting direction + * @var string sort_key The sorting key + * @var array sort_key_sql Arraty with the sorting conditions data + * @var string sql_from SQL FROM clause condition + * @var string sql_select SQL SELECT fields list + * @var string sql_where SQL WHERE clause condition + * @var string sql_where_data SQL WHERE clause additional conditions data + * @since 3.1.7-RC1 + */ + $vars = array( + 'order_by', + 'sort_dir', + 'sort_key', + 'sort_key_sql', + 'sql_from', + 'sql_select', + 'sql_where', + 'sql_where_data', + ); + extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars))); + // Count the users ... if ($sql_where) { @@ -1345,13 +1390,19 @@ switch ($mode) ); } + $user_types = array(USER_NORMAL, USER_FOUNDER); + if ($auth->acl_get('a_user')) + { + $user_types[] = USER_INACTIVE; + } + $start = $pagination->validate_start($start, $config['topics_per_page'], $config['num_users']); // Get us some users :D $sql = "SELECT u.user_id FROM " . USERS_TABLE . " u $sql_from - WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") + WHERE " . $db->sql_in_set('u.user_type', $user_types) . " $sql_where ORDER BY $order_by"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); @@ -1480,6 +1531,7 @@ switch ($mode) 'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, 'S_GROUP_LEADER' => $is_leader, + 'S_INACTIVE' => $row['user_type'] == USER_INACTIVE, 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $row['username']), )); |