From f4cf1f599b3e5ed2a3f875a94bcc655f377b53b4 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 13 Sep 2010 14:21:13 +0000 Subject: [PATCH] Followup r72866, make 100 in 100+ a param. Makes raising the limit easier :) --- includes/diff/DifferenceInterface.php | 14 ++++++++++++-- languages/messages/MessagesEn.php | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/diff/DifferenceInterface.php b/includes/diff/DifferenceInterface.php index d447ed9475..f59aa56ba1 100644 --- a/includes/diff/DifferenceInterface.php +++ b/includes/diff/DifferenceInterface.php @@ -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 ) ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 970d26160a..0869f4fde3 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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 -- 2.20.1