Followup r72866, make 100 in 100+ a param. Makes raising the limit easier :)
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 13 Sep 2010 14:21:13 +0000 (14:21 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 13 Sep 2010 14:21:13 +0000 (14:21 +0000)
includes/diff/DifferenceInterface.php
languages/messages/MessagesEn.php

index d447ed9..f59aa56 100644 (file)
@@ -817,16 +817,26 @@ CONTROL;
                } else {
                        global $wgLang;
                        $dbr = wfGetDB( DB_SLAVE );
+                       
+                       // Actually, the limit is $limit + 1. We do this so we can detect
+                       // if there are > 100 authors in a given revision range. If they
+                       // are, $limit will be passed to diff-multi-manyusers for l10n.
+                       $limit = 100;
                        $res = $dbr->select( 'revision', 'DISTINCT rev_user_text',
                                array(
                                        'rev_page = ' . $this->mOldRev->getPage(),
                                        'rev_id > ' . $this->mOldRev->getId(),
                                        'rev_id < ' . $this->mNewRev->getId()
                                ), __METHOD__,
-                               array( 'LIMIT' => 101 )
+                               array( 'LIMIT' => $limit + 1 )
                        );
                        $numUsers = $dbr->numRows( $res );
-                       $msg = $numUsers > 100 ? 'diff-multi-manyusers' : 'diff-multi';
+                       if( $numUsers > $limit ) {
+                               $msg = 'diff-multi-manyusers';
+                               $numUsers = $limit;
+                       } else {
+                               $msg = 'diff-multi';
+                       }
                        return wfMsgExt( $msg, array( 'parseinline' ), $wgLang->formatnum( $n ),
                                $wgLang->formatnum( $numUsers ) );
                }
index 970d261..0869f4f 100644 (file)
@@ -1618,7 +1618,7 @@ Note that using the navigation links will reset this column.',
 'showhideselectedversions' => 'Show/hide selected revisions',
 'editundo'                 => 'undo',
 'diff-multi'               => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by {{PLURAL:$2|one user|$2 users}} not shown)',
-'diff-multi-manyusers'     => '($1 intermediate revisions by 100+ users not shown)',
+'diff-multi-manyusers'     => '($1 intermediate revisions by $2+ users not shown)',
 
 # Search results
 'search-summary'                   => '', # do not translate or duplicate this message to other languages