From: Sam Reed Date: Thu, 6 Jan 2011 01:23:05 +0000 (+0000) Subject: Fixup nasty way of listing tables and left joining in other tables. Use better join_c... X-Git-Tag: 1.31.0-rc.0~32779 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=4d940a2f18c0706f79d1c44468f68981000e7b24;p=lhc%2Fweb%2Fwiklou.git Fixup nasty way of listing tables and left joining in other tables. Use better join_conds syntax --- diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index abc0363a36..144b08bbc8 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -94,11 +94,8 @@ class UsersPager extends AlphabeticPager { $conds[] = 'user_editcount > 0'; } - list ($user,$user_groups,$ipblocks) = $dbr->tableNamesN('user','user_groups','ipblocks'); - $query = array( - 'tables' => " $user $useIndex LEFT JOIN $user_groups ON user_id=ug_user - LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_deleted=1 AND ipb_auto=0 ", + 'tables' => array( 'user', 'user_groups', 'ipblocks'), 'fields' => array( $this->creationSort ? 'MAX(user_name) AS user_name' : 'user_name', $this->creationSort ? 'user_id' : 'MAX(user_id) AS user_id', @@ -109,6 +106,10 @@ class UsersPager extends AlphabeticPager { 'MAX(ipb_deleted) AS ipb_deleted' // block/hide status ), 'options' => array('GROUP BY' => $this->creationSort ? 'user_id' : 'user_name'), + 'join_conds' => array( + 'user_groups' => array( 'LEFT JOIN', 'user_id=ug_user' ), + 'ipblocks' => array( 'LEFT JOIN', 'user_id=ipb_user AND ipb_deleted=1 AND ipb_auto=0' ), + ), 'conds' => $conds );