From 8a275fc6a112918da68e69a193bfdcb9fa8e8263 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 12 Sep 2010 15:39:32 +0000 Subject: [PATCH] (bug 24007) Diff pages now mention the number of users having edited intermediate revisions. Also updated MessagesQqq so these are a little more clear --- RELEASE-NOTES | 2 ++ includes/diff/DifferenceInterface.php | 20 +++++++++++++++++--- languages/messages/MessagesEn.php | 3 ++- languages/messages/MessagesQqq.php | 8 +++++++- maintenance/language/messages.inc | 1 + 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 710a7e68bf..0e655e7c40 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -148,6 +148,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * The parser cache is now shared amongst users whose different settings aren't used in the page. * Any attribute beginning with "data-" can now be used in wikitext, per HTML5. +* (bug 24007) Diff pages now mention the number of users having edited + intermediate revisions === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/includes/diff/DifferenceInterface.php b/includes/diff/DifferenceInterface.php index 64975bb4d1..d447ed9475 100644 --- a/includes/diff/DifferenceInterface.php +++ b/includes/diff/DifferenceInterface.php @@ -812,10 +812,24 @@ CONTROL; } $n = $this->mTitle->countRevisionsBetween( $oldid, $newid ); - if ( !$n ) + if ( !$n ) { return ''; - - return wfMsgExt( 'diff-multi', array( 'parseinline' ), $n ); + } else { + global $wgLang; + $dbr = wfGetDB( DB_SLAVE ); + $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 ) + ); + $numUsers = $dbr->numRows( $res ); + $msg = $numUsers > 100 ? 'diff-multi-manyusers' : '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 5810916470..4e79da4ff0 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1617,7 +1617,8 @@ Note that using the navigation links will reset this column.', 'compareselectedversions' => 'Compare selected revisions', 'showhideselectedversions' => 'Show/hide selected revisions', 'editundo' => 'undo', -'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown)', +'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 intermediate revisions by 100+ users not shown)', # Search results 'search-summary' => '', # do not translate or duplicate this message to other languages diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index f234df8783..4b711a10f1 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -1154,7 +1154,13 @@ See also {{msg-mw|difference}}.', 'showhideselectedversions' => 'Text of the button which brings up the [[mw:RevisionDelete|RevisionDelete]] menu.', 'editundo' => 'Undo link when viewing diffs {{Identical|Undo}}', -'diff-multi' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive.", +'diff-multi' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive. + +*Parameter $1 is the number of revisions +*Parameter $2 is the number of users making those revisions", +'diff-multi-manyuser' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive, and the intermediate revisions have been edited by 100+ users + +*$1 is the number of revisions, will always be 100 or more", # Search results 'searchresults-title' => 'Appears as page title in the html header of the search result special page.', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 055957ac78..6727461255 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -804,6 +804,7 @@ $wgMessageStructure = array( 'showhideselectedversions', 'editundo', 'diff-multi', + 'diff-multi-manyusers', ), 'search' => array( 'search-summary', -- 2.20.1