Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -230,11 +230,13 @@ |
231 | 231 | * ResourceLoaderGetConfigVars hook |
232 | 232 | */ |
233 | 233 | public static function resourceLoaderGetConfigVars( &$vars ) { |
234 | | - global $wgArticleFeedbackCategories, |
| 234 | + global $wgArticleFeedbackSMaxage, |
| 235 | + $wgArticleFeedbackCategories, |
235 | 236 | $wgArticleFeedbackLotteryOdds, |
236 | 237 | $wgArticleFeedbackTracking, |
237 | 238 | $wgArticleFeedbackOptions, |
238 | 239 | $wgArticleFeedbackNamespaces; |
| 240 | + $vars['wgArticleFeedbackSMaxage'] = $wgArticleFeedbackSMaxage; |
239 | 241 | $vars['wgArticleFeedbackCategories'] = $wgArticleFeedbackCategories; |
240 | 242 | $vars['wgArticleFeedbackLotteryOdds'] = $wgArticleFeedbackLotteryOdds; |
241 | 243 | $vars['wgArticleFeedbackTracking'] = $wgArticleFeedbackTracking; |
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js |
— | — | @@ -338,7 +338,9 @@ |
339 | 339 | 'list': 'articlefeedback', |
340 | 340 | 'afpageid': mw.config.get( 'wgArticleId' ), |
341 | 341 | 'afanontoken': userrating ? mw.user.id() : '', |
342 | | - 'afuserrating': Number( userrating ) |
| 342 | + 'afuserrating': Number( userrating ), |
| 343 | + 'maxage': 0, |
| 344 | + 'smaxage': mw.config.get( 'wgArticleFeedbackSMaxage' ) |
343 | 345 | }, |
344 | 346 | 'success': function( data ) { |
345 | 347 | var context = this; |
Index: trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | } |
7 | 7 | |
8 | 8 | public function execute() { |
9 | | - global $wgUser, $wgArticleFeedbackRatings; |
| 9 | + global $wgUser, $wgArticleFeedbackRatings, $wgArticleFeedbackSMaxage; |
10 | 10 | $params = $this->extractRequestParams(); |
11 | 11 | |
12 | 12 | if ( $wgUser->isAnon() ) { |
— | — | @@ -80,7 +80,9 @@ |
81 | 81 | 'list' => 'articlefeedback', |
82 | 82 | 'afpageid' => $pageId, |
83 | 83 | 'afanontoken' => '', |
84 | | - 'afuserrating' => 0 |
| 84 | + 'afuserrating' => 0, |
| 85 | + 'maxage' => 0, |
| 86 | + 'smaxage' => $wgArticleFeedbackSMaxage |
85 | 87 | ) ) ) ); |
86 | 88 | $squidUpdate->doUpdate(); |
87 | 89 | |
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.php |
— | — | @@ -15,6 +15,9 @@ |
16 | 16 | |
17 | 17 | /* Configuration */ |
18 | 18 | |
| 19 | +// How long to keep ratings in the squids (they will also be purged when needed) |
| 20 | +$wgArticleFeedbackSMaxage = 25920000; |
| 21 | + |
19 | 22 | // Enable/disable dashboard page |
20 | 23 | $wgArticleFeedbackDashboard = false; |
21 | 24 | |