Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -38,6 +38,7 @@ |
39 | 39 | if( !defined('FLAGGED_VIS_PRISTINE') ) |
40 | 40 | define('FLAGGED_VIS_PRISTINE',2); |
41 | 41 | |
| 42 | +# SELECT parameters... |
42 | 43 | if( !defined('FR_FOR_UPDATE') ) |
43 | 44 | define('FR_FOR_UPDATE',1); |
44 | 45 | if( !defined('FR_MASTER') ) |
— | — | @@ -45,6 +46,14 @@ |
46 | 47 | if( !defined('FR_TEXT') ) |
47 | 48 | define('FR_TEXT',3); |
48 | 49 | |
| 50 | +# Level constants... |
| 51 | +if( !defined('FR_SIGHTED') ) |
| 52 | + define('FR_SIGHTED',0); |
| 53 | +if( !defined('FR_QUALITY') ) |
| 54 | + define('FR_QUALITY',1); |
| 55 | +if( !defined('FR_PRISTINE') ) |
| 56 | + define('FR_PRISTINE',2); |
| 57 | + |
49 | 58 | # Number of recent reviews to be a decent sample size |
50 | 59 | if( !defined('READER_FEEDBACK_SIZE') ) |
51 | 60 | define('READER_FEEDBACK_SIZE',15); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -275,10 +275,10 @@ |
276 | 276 | $config = $wgFlaggedRevsPrecedence; |
277 | 277 | switch( $config ) |
278 | 278 | { |
279 | | - case 2: |
| 279 | + case FR_PRISTINE: |
280 | 280 | $select = FLAGGED_VIS_PRISTINE; |
281 | 281 | break; |
282 | | - case 1: |
| 282 | + case FR_QUALITY: |
283 | 283 | $select = FLAGGED_VIS_QUALITY; |
284 | 284 | break; |
285 | 285 | default: |
— | — | @@ -340,9 +340,9 @@ |
341 | 341 | public static function quickTags( $tier ) { |
342 | 342 | switch( $tier ) |
343 | 343 | { |
344 | | - case 2: |
| 344 | + case FR_PRISTINE: |
345 | 345 | return self::quickPristineTags(); |
346 | | - case 1: |
| 346 | + case FR_QUALITY: |
347 | 347 | return self::quickQualityTags(); |
348 | 348 | default: |
349 | 349 | return self::quickSightedTags(); |
— | — | @@ -360,7 +360,7 @@ |
361 | 361 | # Find the maximum auto-review quality level |
362 | 362 | $qal = min($wgFlaggedRevsAutoReview-1,$quality); |
363 | 363 | # Pristine auto-review? |
364 | | - if( $qal == 2 ) { |
| 364 | + if( $qal == FR_PRISTINE ) { |
365 | 365 | $flags = self::quickPristineTags(); |
366 | 366 | # If tags are available and user can set them, we are done... |
367 | 367 | if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { |
— | — | @@ -369,7 +369,7 @@ |
370 | 370 | $qal--; |
371 | 371 | } |
372 | 372 | # Quality auto-review? |
373 | | - if( $qal == 1 ) { |
| 373 | + if( $qal == FR_QUALITY ) { |
374 | 374 | $flags = self::quickQualityTags(); |
375 | 375 | # If tags are available and user can set them, we are done... |
376 | 376 | if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { |
— | — | @@ -378,7 +378,7 @@ |
379 | 379 | $qal--; |
380 | 380 | } |
381 | 381 | # Sighted auto-review? |
382 | | - if( $qal == 0 ) { |
| 382 | + if( $qal == FR_SIGHTED ) { |
383 | 383 | $flags = self::quickSightedTags(); |
384 | 384 | # If tags are available and user can set them, we are done... |
385 | 385 | if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { |
— | — | @@ -837,8 +837,9 @@ |
838 | 838 | */ |
839 | 839 | public static function updatePendingList( $article, $latest = NULL ) { |
840 | 840 | $data = array(); |
841 | | - $level = self::pristineVersions() ? 2 : 1; |
842 | | - if( !self::qualityVersions() ) $level--; |
| 841 | + $level = self::pristineVersions() ? FR_PRISTINE : FR_QUALITY; |
| 842 | + if( !self::qualityVersions() ) |
| 843 | + $level = FR_SIGHTED; |
843 | 844 | # Get the latest revision ID |
844 | 845 | $lastID = $latest ? $latest : $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); |
845 | 846 | $pageId = $article->getId(); |
— | — | @@ -1089,9 +1090,9 @@ |
1090 | 1091 | */ |
1091 | 1092 | public static function getLevelTier( $flags ) { |
1092 | 1093 | if( self::isPristine($flags ) ) |
1093 | | - return 2; |
| 1094 | + return FR_PRISTINE; |
1094 | 1095 | else if( self::isQuality($flags ) ) |
1095 | | - return 1; |
| 1096 | + return FR_QUALITY; |
1096 | 1097 | else |
1097 | 1098 | return 0; |
1098 | 1099 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | $prow = $dbw->selectRow( array('flaggedrevs','revision'), |
148 | 148 | $columns, |
149 | 149 | array( 'fr_page_id' => $pageId, |
150 | | - 'fr_quality = 2', |
| 150 | + 'fr_quality = '.FR_PRISTINE, |
151 | 151 | 'rev_id = fr_rev_id', |
152 | 152 | 'rev_page = fr_page_id', |
153 | 153 | 'rev_deleted & '.Revision::DELETED_TEXT => 0 |
— | — | @@ -166,7 +166,7 @@ |
167 | 167 | $qrow = $dbw->selectRow( array('flaggedrevs','revision'), |
168 | 168 | $columns, |
169 | 169 | array( 'fr_page_id' => $pageId, |
170 | | - 'fr_quality = 1', |
| 170 | + 'fr_quality = '.FR_QUALITY, |
171 | 171 | $newerClause, |
172 | 172 | 'rev_id = fr_rev_id', |
173 | 173 | 'rev_page = fr_page_id', |