Index: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc |
— | — | @@ -232,6 +232,11 @@ |
233 | 233 | array('stat_id' => 1, 'ave_review_time' => $aveRT, 'med_review_time' => $medianRT, 'ave_pending_time' => $avePET), |
234 | 234 | __METHOD__ |
235 | 235 | ); |
| 236 | + // Update timestamp |
| 237 | + $dbw->replace( 'querycache_info', array('qci_type'), |
| 238 | + array('qci_type' => 'validationstats', 'qci_timestamp' => $dbw->timestamp()), |
| 239 | + __METHOD__ |
| 240 | + ); |
236 | 241 | $dbw->commit(); |
237 | 242 | // Stats are now up to date! |
238 | 243 | $key = wfMemcKey( 'flaggedrevs', 'statsUpdated' ); |
Index: trunk/extensions/FlaggedRevs/language/ValidationStatistics.i18n.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | and \'\'\'[[Special:ListUsers/reviewer|$2]]\'\'\' {{PLURAL:$2|user|users}} with [[{{MediaWiki:Validationpage}}|Reviewer]] rights. |
15 | 15 | |
16 | 16 | Editors and Reviewers are established users that can spot check revisions to pages.', |
17 | | - 'validationstatistics-time' => '\'\'The following data is cached and may not be up to date.\'\' |
| 17 | + 'validationstatistics-time' => '\'\'The following data was last updated on $5.\'\' |
18 | 18 | |
19 | 19 | Edits that have been checked by established users are considered to be reviewed. |
20 | 20 | |
Index: trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php |
— | — | @@ -25,6 +25,10 @@ |
26 | 26 | $mt = $this->getMeanReviewWait(); |
27 | 27 | $mdt = $this->getMedianReviewWait(); |
28 | 28 | $pt = $this->getMeanPendingWait(); |
| 29 | + $timestamp = $this->getLastUpdate(); |
| 30 | + if( $timestamp != '-' ) { |
| 31 | + $timestamp = $wgLang->timeanddate( $timestamp, true ); |
| 32 | + } |
29 | 33 | |
30 | 34 | $wgOut->addWikiText( wfMsgExt( 'validationstatistics-users', array( 'parsemag' ), |
31 | 35 | $wgLang->formatnum($ec), $wgLang->formatnum($rc) ) |
— | — | @@ -55,7 +59,7 @@ |
56 | 60 | # Show review/pending time stats |
57 | 61 | $wgOut->addWikiText( '<hr/>' . wfMsgExt( 'validationstatistics-time', array( 'parsemag' ), |
58 | 62 | $wgLang->formatTimePeriod($mt), $wgLang->formatTimePeriod($pt), |
59 | | - $wgLang->formatTimePeriod($mdt), $reviewChart ) |
| 63 | + $wgLang->formatTimePeriod($mdt), $reviewChart, $timestamp ) |
60 | 64 | ); |
61 | 65 | |
62 | 66 | $wgOut->addWikiText( wfMsg('validationstatistics-table') ); |
— | — | @@ -202,6 +206,13 @@ |
203 | 207 | return ($val == false ? '-' : $val ); |
204 | 208 | } |
205 | 209 | |
| 210 | + protected function getLastUpdate() { |
| 211 | + if( !$this->db->tableExists( 'querycache_info' ) ) return '-'; |
| 212 | + $val = $this->db->selectField( 'querycache_info', 'qci_timestamp', |
| 213 | + array('qci_type' => 'validationstats') ); |
| 214 | + return ($val == false ? '-' : $val ); |
| 215 | + } |
| 216 | + |
206 | 217 | protected function getTopFiveReviewers() { |
207 | 218 | $key = wfMemcKey( 'flaggedrevs', 'reviewTopUsers' ); |
208 | 219 | $dbCache = wfGetCache( CACHE_DB ); |