Merge "Do not call purgeExpiredRestrictions on simple page views"
[lhc/web/wiklou.git] / includes / specials / SpecialActiveusers.php
index ff63243..66f1f03 100644 (file)
@@ -115,10 +115,16 @@ class ActiveUsersPager extends UsersPager {
                        ) . ')';
                }
 
+               if ( $dbr->implicitGroupby() ) {
+                       $options = array( 'GROUP BY' => array( 'qcc_title' ) );
+               } else {
+                       $options = array( 'GROUP BY' => array( 'user_name', 'user_id', 'qcc_title' ) );
+               }
+
                return array(
                        'tables' => array( 'querycachetwo', 'user', 'recentchanges' ),
                        'fields' => array( 'user_name', 'user_id', 'recentedits' => 'COUNT(*)', 'qcc_title' ),
-                       'options' => array( 'GROUP BY' => array( 'qcc_title' ) ),
+                       'options' => $options,
                        'conds' => $conds
                );
        }
@@ -263,9 +269,11 @@ class SpecialActiveUsers extends SpecialPage {
 
                // Occasionally merge in new updates
                $seconds = min( self::mergeActiveUsers( 300, $days ), $days * 86400 );
-               // Mention the level of staleness
-               $out->addWikiMsg( 'cachedspecial-viewing-cached-ttl',
-                       $this->getLanguage()->formatDuration( $seconds ) );
+               if ( $seconds > 0 ) {
+                       // Mention the level of staleness
+                       $out->addWikiMsg( 'cachedspecial-viewing-cached-ttl',
+                               $this->getLanguage()->formatDuration( $seconds ) );
+               }
 
                $up = new ActiveUsersPager( $this->getContext(), null, $par );