getText( 'username' ); $this->requestedUser = ''; if ( $un != '' ) { $username = Title::makeTitleSafe( NS_USER, $un ); if( ! is_null( $username ) ) { $this->requestedUser = $username->getText(); } } parent::__construct(); } function getIndexField() { return 'rc_user_text'; } function getQueryInfo() { $dbr = wfGetDB( DB_SLAVE ); $conds = array(); // don't show hidden names $conds[] = 'ipb_deleted IS NULL'; $useIndex = $dbr->useIndexClause('rc_user_text'); if( $this->requestedUser != "" ) { $conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser ); } $conds[] = 'rc_user > 0'; // Users - no anons list ($recentchanges,$ipblocks) = $dbr->tableNamesN('recentchanges','ipblocks'); $query = array( 'tables' => " $recentchanges $useIndex LEFT JOIN $ipblocks ON rc_user=ipb_user AND ipb_auto=0 AND ipb_deleted=1 ", 'fields' => array('rc_user_text AS user_name', // inheritance 'rc_user_text', // for Pager 'MAX(rc_user) AS user_id', 'COUNT(*) AS recentedits', 'MAX(ipb_user) AS blocked'), 'options' => array('GROUP BY' => 'user_name'), 'conds' => $conds ); return $query; } function formatRow( $row ) { $userPage = Title::makeTitle( NS_USER, $row->rc_user_text ); $name = $this->getSkin()->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) ); $list = array(); foreach( self::getGroups( $row->user_id ) as $group ) $list[] = self::buildGroupLink( $group ); $groups = implode( ', ', $list ); $item = wfSpecialList( $name, $groups ); $count = wfMsgExt( 'activeusers-count', array('parsemag'), $row->recentedits ); $blocked = $row->blocked ? ' '.wfMsg('listusers-blocked') : ''; return "
' . wfMsgHTML('activeusers-noresult') . '
'; }; $wgOut->addHTML( $s ); }