Index: trunk/extensions/CountEdits/CountEdits.page.php |
— | — | @@ -92,7 +92,12 @@ |
93 | 93 | global $wgUser, $wgLang; |
94 | 94 | $dbr =& wfGetDB( DB_SLAVE ); |
95 | 95 | $rev = $dbr->tableName( 'revision' ); |
96 | | - $sql = "SELECT COUNT(*) AS count, rev_user, rev_user_text FROM $rev GROUP BY rev_user_text ORDER BY count DESC LIMIT 0,11"; |
| 96 | + $sql = "SELECT COUNT(*) AS count, rev_user, rev_user_text FROM $rev"; |
| 97 | + $groupby = "GROUP BY rev_user_text"; |
| 98 | + if( !$dbr->implicitGroupby() ) |
| 99 | + $groupby .= ", rev_user"; |
| 100 | + $orderby = "ORDER BY count DESC LIMIT 11"; |
| 101 | + $sql .= " $groupby $orderby"; |
97 | 102 | $res = $dbr->query( $sql ); |
98 | 103 | if( $res && $dbr->numRows( $res ) > 0 ) { |
99 | 104 | $skin = $wgUser->getSkin(); |