Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -311,10 +311,10 @@ |
312 | 312 | // of key flags that were fulfilled |
313 | 313 | $result = $db->select( |
314 | 314 | array('flaggedrevtags','flaggedrevs','revision'), |
315 | | - array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp'), |
| 315 | + array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp', 'COUNT(*)'), |
316 | 316 | array('frt_page_id' => $page_id, $tagwhere, $maxrevid, 'frt_rev_id=fr_rev_id', 'fr_rev_id=rev_id', 'rev_deleted=0'), |
317 | 317 | __METHOD__, |
318 | | - array('GROUP BY' => 'frt_rev_id', 'HAVING' => 'COUNT(*)=='.$wgFlaggedRevTags, 'ORDER BY' => 'frt_rev_id DESC', 'LIMIT' => $limit) ); |
| 318 | + array('GROUP BY' => 'frt_rev_id', 'HAVING' => 'COUNT(*)='.$wgFlaggedRevTags, 'ORDER BY' => 'frt_rev_id DESC', 'LIMIT' => $limit) ); |
319 | 319 | // Iterate through each flagged revision row |
320 | 320 | $out = array(); |
321 | 321 | while ( $row = $db->fetchObject($result) ) { |
— | — | @@ -574,6 +574,20 @@ |
575 | 575 | } |
576 | 576 | return true; |
577 | 577 | } |
| 578 | + |
| 579 | + /** |
| 580 | + * @param Array $flags |
| 581 | + * @output integer, lowest rating level |
| 582 | + */ |
| 583 | + public static function getLCQuality( $flags ) { |
| 584 | + global $wgFlaggedRevValues; |
| 585 | + |
| 586 | + $min = false; |
| 587 | + foreach ( $flags as $f => $v ) { |
| 588 | + if ( $min==false || $v < $min ) $min = $v; |
| 589 | + } |
| 590 | + return $min; |
| 591 | + } |
578 | 592 | |
579 | 593 | } |
580 | 594 | |