aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-04-28 14:02:51 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-04-28 14:02:51 +0000
commit7c01f242b350982a6d4a0d08f8a2b81a4d45f450 (patch)
tree03080b8bc6ce442d879e787af199653e456b077a /phpBB
parentbdf5e3f3d35965b886be3ab34458f8ddbb48e7c9 (diff)
downloadforums-7c01f242b350982a6d4a0d08f8a2b81a4d45f450.tar
forums-7c01f242b350982a6d4a0d08f8a2b81a4d45f450.tar.gz
forums-7c01f242b350982a6d4a0d08f8a2b81a4d45f450.tar.bz2
forums-7c01f242b350982a6d4a0d08f8a2b81a4d45f450.tar.xz
forums-7c01f242b350982a6d4a0d08f8a2b81a4d45f450.zip
fix wrong query for searching by group id. If not within group mode we only need the user details too (hopefully)
git-svn-id: file:///svn/phpbb/trunk@7418 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/memberlist.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 02692b5781..d65ea1a167 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -940,7 +940,7 @@ switch ($mode)
$sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
$sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
$sql_where .= (sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
- $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id " : '';
+ $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : '';
if ($search_group_id)
{
@@ -1253,12 +1253,21 @@ switch ($mode)
$db->sql_freeresult($result);
// Do the SQL thang
- $sql = "SELECT u.*
- $sql_select
- FROM " . USERS_TABLE . " u
- $sql_from
- WHERE " . $db->sql_in_set('u.user_id', $user_list) . "
- $sql_where_data";
+ if ($mode == 'group')
+ {
+ $sql = "SELECT u.*
+ $sql_select
+ FROM " . USERS_TABLE . " u
+ $sql_from
+ WHERE " . $db->sql_in_set('u.user_id', $user_list) . "
+ $sql_where_data";
+ }
+ else
+ {
+ $sql = 'SELECT *
+ FROM ' . USERS_TABLE . '
+ WHERE ' . $db->sql_in_set('user_id', $user_list);
+ }
$result = $db->sql_query($sql);
$id_cache = array();