Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -246,7 +246,12 @@ |
247 | 247 | # Reader feedback tags, positive and negative. [a-zA-Z] tag names only. |
248 | 248 | # Each tag has five levels, which 3 being average. The tag names are |
249 | 249 | # mapped to their weight. This is used to determine the "worst"/"best" pages. |
250 | | -$wgFlaggedRevsFeedbackTags = array( 'reliability' => 3, 'completeness' => 2, 'npov' => 2, 'presentation' => 1 ); |
| 250 | +$wgFlaggedRevsFeedbackTags = array( |
| 251 | + 'reliability' => 3, |
| 252 | + 'completeness' => 2, |
| 253 | + 'npov' => 2, |
| 254 | + 'presentation' => 1 |
| 255 | +); |
251 | 256 | # How many seconds back should the average rating for a page be based on? |
252 | 257 | $wgFlaggedRevsFeedbackAge = 7 * 24 * 3600; |
253 | 258 | # How long before stats page is updated? |
— | — | @@ -531,7 +536,7 @@ |
532 | 537 | $wgAjaxExportList[] = 'RevisionReview::AjaxReview'; |
533 | 538 | |
534 | 539 | // Defaults for prefs |
535 | | -$wgDefaultUserOptions['flaggedrevssimpleui'] = $wgSimpleFlaggedRevsUI; |
| 540 | +$wgDefaultUserOptions['flaggedrevssimpleui'] = (int)$wgSimpleFlaggedRevsUI; |
536 | 541 | $wgDefaultUserOptions['flaggedrevsstable'] = true; |
537 | 542 | |
538 | 543 | # Cache update |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -986,9 +986,12 @@ |
987 | 987 | if( $article->getTitle()->isContentPage() ) { |
988 | 988 | $pages = explode( ',', trim($p['uniqueContentPages']) ); // page IDs |
989 | 989 | # Don't let this get bloated for no reason |
990 | | - if( count($pages) < $wgFlaggedRevsAutopromote['uniqueContentPages'] && !in_array($article->getId(),$pages) ) { |
| 990 | + if( count($pages) < $wgFlaggedRevsAutopromote['uniqueContentPages'] |
| 991 | + && !in_array($article->getId(),$pages) ) |
| 992 | + { |
991 | 993 | $pages[] = $article->getId(); |
992 | | - $p['uniqueContentPages'] = preg_replace('/^,/','',implode(',',$pages)); // clear any garbage |
| 994 | + // Clear out any formatting garbage |
| 995 | + $p['uniqueContentPages'] = preg_replace('/^,/','',implode(',',$pages)); |
993 | 996 | } |
994 | 997 | $p['totalContentEdits'] += 1; |
995 | 998 | $changed = true; |
— | — | @@ -1246,7 +1249,9 @@ |
1247 | 1250 | * @param string $t timestamp of the log entry |
1248 | 1251 | * @return bool true |
1249 | 1252 | */ |
1250 | | - public static function reviewLogLine( $type='', $action='', $title=null, $paramArray=array(), &$c, &$r ) { |
| 1253 | + public static function reviewLogLine( $type='', $action='', $title=null, |
| 1254 | + $paramArray=array(), &$c, &$r ) |
| 1255 | + { |
1251 | 1256 | $actionsValid = array('approve','approve2','approve-a','approve2-a','unapprove','unapprove2'); |
1252 | 1257 | # Show link to page with oldid=x |
1253 | 1258 | if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($paramArray[0]) ) { |
— | — | @@ -1542,9 +1547,11 @@ |
1543 | 1548 | if( empty($wgTitle) || $wgTitle->getNamespace() !== NS_SPECIAL ) { |
1544 | 1549 | return true; // nothing to do here |
1545 | 1550 | } |
| 1551 | + if( !$wgUser->isAllowed('review') ) |
| 1552 | + return true; // not relevant to user |
1546 | 1553 | $watchlist = SpecialPage::getTitleFor( 'Watchlist' ); |
1547 | 1554 | $recentchanges = SpecialPage::getTitleFor( 'Recentchanges' ); |
1548 | | - if( $wgUser->isAllowed('review') && ($wgTitle->equals($watchlist) || $wgTitle->equals($recentchanges)) ) { |
| 1555 | + if( $wgTitle->equals($watchlist) || $wgTitle->equals($recentchanges) ) { |
1549 | 1556 | $dbr = wfGetDB( DB_SLAVE ); |
1550 | 1557 | $watchedOutdated = $dbr->selectField( array('watchlist','page','flaggedpages'), '1', |
1551 | 1558 | array( 'wl_user' => $wgUser->getId(), |
— | — | @@ -1559,8 +1566,10 @@ |
1560 | 1567 | wfMsgExt('flaggedrevs-watched-pending',array('parseinline')) . "</div>"; |
1561 | 1568 | # Otherwise, give a notice if there is a large backlog in general |
1562 | 1569 | } else { |
1563 | | - $pages = $dbr->estimateRowCount( 'page', '*', array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ ); |
1564 | | - $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*', 'fp_pending_since IS NOT NULL', __METHOD__ ); |
| 1570 | + $pages = $dbr->estimateRowCount( 'page', '*', |
| 1571 | + array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ ); |
| 1572 | + $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*', |
| 1573 | + 'fp_pending_since IS NOT NULL', __METHOD__ ); |
1565 | 1574 | if( ($unreviewed/$pages) > .02 ) { |
1566 | 1575 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
1567 | 1576 | $notice .= "<div id='mw-oldreviewed-notice' class='plainlinks fr-backlognotice'>" . |
— | — | @@ -1576,7 +1585,9 @@ |
1577 | 1586 | $tables = array('flaggedpages','page','revision'); |
1578 | 1587 | $opts['ORDER BY'] = 'fp_page_id ASC'; |
1579 | 1588 | $opts['USE INDEX'] = array( 'flaggedpages' => 'PRIMARY' ); |
1580 | | - $join['page'] = array('INNER JOIN',array('page_id = fp_page_id','page_namespace' => $wgFlaggedRevsNamespaces)); |
| 1589 | + $join['page'] = array( 'INNER JOIN', |
| 1590 | + array('page_id = fp_page_id','page_namespace' => $wgFlaggedRevsNamespaces) |
| 1591 | + ); |
1581 | 1592 | $join['revision'] = array('INNER JOIN','rev_page = fp_page_id AND rev_id = fp_stable'); |
1582 | 1593 | return false; // final |
1583 | 1594 | } |