r21707 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21706‎ | r21707 | r21708 >
Date:00:27, 30 April 2007
Author:aaron
Status:old
Tags:
Comment:
*Some updates
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -116,10 +116,8 @@
117117 # Let this stand alone just in case...
118118 $wgGroupPermissions['reviewer']['review'] = true;
119119
120 -# Define when users get automatically promoted
121 -$wgFlaggedRevsAutopromote = array('editor' => array('days' => 60,
122 - 'edits' => 1000,
123 - 'email' => true) );
 120+# Define when users get automatically promoted to editors
 121+$wgFlaggedRevsAutopromote = array('days' => 60, 'edits' => 1000, 'email' => true);
124122
125123 # What icons to display
126124
@@ -526,25 +524,24 @@
527525 // Do not give this to bots
528526 if ( in_array( 'bot', $groups ) ) return;
529527 // Check if we need to promote...
530 - foreach ($wgFlaggedRevsAutopromote as $group=>$vars) {
531 - if ( !in_array($group,$groups) && $userage >= $vars['days'] && $user->getEditCount() >= $vars['edits']
532 - && ( !$vars['email'] || $wgUser->isAllowed('emailconfirmed') ) ) {
533 - # Do not re-add status if it was previously removed...
534 - $fname = 'FlaggedRevs::autoPromoteUser';
535 - $db = wfGetDB( DB_SLAVE );
536 - $result = $db->select(
537 - array('logging'),
538 - array('log_user'),
539 - array("log_type='validate'", "log_action='revoke1'", 'log_namespace' => NS_USER, 'log_title' => $user->getName() ),
540 - $fname,
541 - 'LIMIT = 1');
542 - # Add rights if they were never removed
543 - if ( !$db->numRows($result) ) {
544 - $user->addGroup($group);
545 - # Lets NOT spam RC, set $RC to false
546 - $log = new LogPage( 'validate', false );
547 - $log->addEntry('grant1', $user->getUserPage(), wfMsgHtml('makevalidate-autosum') );
548 - }
 528+ $vars = $wgFlaggedRevsAutopromote;
 529+ if ( !in_array('editor',$groups) && $userage >= $vars['days'] && $user->getEditCount() >= $vars['edits']
 530+ && ( !$vars['email'] || $wgUser->isAllowed('emailconfirmed') ) ) {
 531+ # Do not re-add status if it was previously removed...
 532+ $fname = 'FlaggedRevs::autoPromoteUser';
 533+ $db = wfGetDB( DB_SLAVE );
 534+ $result = $db->select(
 535+ array('logging'),
 536+ array('log_user'),
 537+ array("log_type='validate'", "log_action='revoke1'", 'log_namespace' => NS_USER, 'log_title' => $user->getName() ),
 538+ $fname,
 539+ array('LIMIT' => 1) );
 540+ # Add rights if they were never removed
 541+ if ( !$db->numRows($result) ) {
 542+ $user->addGroup('editor');
 543+ # Lets NOT spam RC, set $RC to false
 544+ $log = new LogPage( 'validate', false );
 545+ $log->addEntry('grant1', $user->getUserPage(), wfMsgHtml('makevalidate-autosum') );
549546 }
550547 }
551548 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php
@@ -253,10 +253,10 @@
254254 $fulltext = FlaggedRevs::expandText( $rev->getText(), $rev->getTitle() );
255255
256256 $quality = 0;
257 - if ( FlaggedRevs::isPristine($this->dims) )
258 - $quality = 2;
259 - else if ( FlaggedRevs::isQuality($this->dims) )
260 - $quality = 1;
 257+ if ( FlaggedRevs::isQuality($this->dims) ) {
 258+ $quality = FlaggedRevs::getLCQuality($this->dims);
 259+ $quality = ($quality > 1) ? $quality : 1;
 260+ }
261261
262262 $dbw = wfGetDB( DB_MASTER );
263263 // Our review entry
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -67,7 +67,7 @@
6868 'revreview-accuracy-4' => 'Featured',
6969 'revreview-depth' => 'Depth',
7070 'revreview-depth-0' => 'Unapproved',
71 - 'revreview-depth-1' => 'Stub',
 71+ 'revreview-depth-1' => 'Basic',
7272 'revreview-depth-2' => 'Moderate',
7373 'revreview-depth-3' => 'High',
7474 'revreview-depth-4' => 'Featured',