Index: trunk/extensions/ReaderFeedback/specialpages/ProblemPages_body.php |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | $x = 2; |
124 | 124 | $conds[] = "rfp_ave_val < $x"; |
125 | 125 | // Reasonable sample |
126 | | - $conds[] = 'rfp_count >= '.READER_FEEDBACK_SIZE; |
| 126 | + $conds[] = 'rfp_count >= '.ReaderFeedback::getFeedbackSize(); |
127 | 127 | return array( |
128 | 128 | 'tables' => array('reader_feedback_pages','page'), |
129 | 129 | 'fields' => 'page_namespace,page_title,page_len,rfp_ave_val', |
Index: trunk/extensions/ReaderFeedback/specialpages/LikedPages_body.php |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | $x = 3.5; |
124 | 124 | $conds[] = "rfp_ave_val > $x"; |
125 | 125 | // Reasonable sample |
126 | | - $conds[] = 'rfp_count >= '.READER_FEEDBACK_SIZE; |
| 126 | + $conds[] = 'rfp_count >= '.ReaderFeedback::getFeedbackSize(); |
127 | 127 | return array( |
128 | 128 | 'tables' => array('reader_feedback_pages','page'), |
129 | 129 | 'fields' => 'page_namespace,page_title,page_len,rfp_ave_val', |
Index: trunk/extensions/ReaderFeedback/ReaderFeedback.class.php |
— | — | @@ -43,6 +43,11 @@ |
44 | 44 | return self::$feedbackTagWeight[$tag]; |
45 | 45 | } |
46 | 46 | |
| 47 | + public static function getFeedbackSize() { |
| 48 | + global $wgFeedbackSizeThreshhold; |
| 49 | + return (int)$wgFeedbackSizeThreshhold; |
| 50 | + } |
| 51 | + |
47 | 52 | ################# Utility functions ################# |
48 | 53 | |
49 | 54 | /** |
Index: trunk/extensions/ReaderFeedback/ReaderFeedback.php |
— | — | @@ -23,10 +23,6 @@ |
24 | 24 | exit( 1 ); |
25 | 25 | } |
26 | 26 | |
27 | | -# Number of recent reviews to be a decent sample size |
28 | | -if( !defined('READER_FEEDBACK_SIZE') ) |
29 | | - define('READER_FEEDBACK_SIZE',15); |
30 | | - |
31 | 27 | $wgExtensionCredits['specialpage'][] = array( |
32 | 28 | 'path' => __FILE__, |
33 | 29 | 'name' => 'Reader Feedback', |
— | — | @@ -56,6 +52,9 @@ |
57 | 53 | ); |
58 | 54 | # How many seconds back should the average rating for a page be based on? |
59 | 55 | $wgFeedbackAge = 7 * 24 * 3600; |
| 56 | +# What number of page votes (for the average above) is considered significant? |
| 57 | +# (number of recent reviews to be a decent sample size) |
| 58 | +$wgFeedbackSizeThreshhold = 15; |
60 | 59 | # How long before stats page is updated? |
61 | 60 | $wgFeedbackStatsAge = 2 * 3600; // 2 hours |
62 | 61 | # Limit people from spamming the system |