Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -261,7 +261,7 @@ |
262 | 262 | ######### |
263 | 263 | |
264 | 264 | # Bump this number every time you change flaggedrevs.css/flaggedrevs.js |
265 | | -$wgFlaggedRevStyleVersion = 50; |
| 265 | +$wgFlaggedRevStyleVersion = 51; |
266 | 266 | |
267 | 267 | $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; |
268 | 268 | |
Index: trunk/extensions/FlaggedRevs/flaggedrevs.css |
— | — | @@ -352,3 +352,7 @@ |
353 | 353 | overflow: auto; |
354 | 354 | font-size: 90%; |
355 | 355 | } |
| 356 | + |
| 357 | +.fr_reader_feedback_stats { |
| 358 | + font-size: 85%; |
| 359 | +} |
Index: trunk/extensions/FlaggedRevs/language/RatingHistory.i18n.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | 'ratinghistory-year' => 'last year', |
21 | 21 | 'ratinghistory-3years' => 'last 3 years', |
22 | 22 | 'ratinghistory-chart' => 'Reader feedback rating over time', |
23 | | - 'ratinghistory-table' => 'Overview of last month', |
| 23 | + 'ratinghistory-table' => 'Overview of ratings last month', |
24 | 24 | 'ratinghistory-users' => 'Users who gave ratings', |
25 | 25 | 'ratinghistory-graph' => '$2 of "$3" ($1 {{PLURAL:$1|review|reviews}})', |
26 | 26 | 'readerfeedback-svg' => 'View as SVG', |
Index: trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | protected function showTable() { |
72 | 72 | global $wgOut; |
73 | 73 | # Show latest month of results |
74 | | - $html = $this->getVoteAggregates( 31 ); |
| 74 | + $html = self::getVoteAggregates( $this->page, 31 ); |
75 | 75 | if( $html ) { |
76 | 76 | $wgOut->addHTML( '<h2>'.wfMsgHtml('ratinghistory-table')."</h2>\n".$html ); |
77 | 77 | } |
— | — | @@ -619,7 +619,7 @@ |
620 | 620 | return $html; |
621 | 621 | } |
622 | 622 | |
623 | | - public function getVoteAggregates( $period ) { |
| 623 | + public static function getVoteAggregates( $page, $period ) { |
624 | 624 | // Set cutoff time for period |
625 | 625 | $dbr = wfGetDB( DB_SLAVE ); |
626 | 626 | $cutoff_unixtime = time() - ($period * 24 * 3600); |
— | — | @@ -628,14 +628,14 @@ |
629 | 629 | // Get the first revision possibly voted on in the range |
630 | 630 | $firstRevTS = $dbr->selectField( 'revision', |
631 | 631 | 'rev_timestamp', |
632 | | - array( 'rev_page' => $this->page->getArticleId(), "rev_timestamp <= $cutoff" ), |
| 632 | + array( 'rev_page' => $page->getArticleId(), "rev_timestamp <= $cutoff" ), |
633 | 633 | __METHOD__, |
634 | 634 | array( 'ORDER BY' => 'rev_timestamp DESC' ) |
635 | 635 | ); |
636 | 636 | // Find average, median, deviation... |
637 | 637 | $res = $dbr->select( array( 'revision', 'reader_feedback' ), |
638 | 638 | array( 'rfb_ratings' ), |
639 | | - array( 'rev_page' => $this->page->getArticleId(), |
| 639 | + array( 'rev_page' => $page->getArticleId(), |
640 | 640 | "rev_id = rfb_rev_id", |
641 | 641 | "rfb_timestamp >= $cutoff", |
642 | 642 | // Trigger INDEX usage |
— | — | @@ -658,7 +658,7 @@ |
659 | 659 | } |
660 | 660 | } |
661 | 661 | // Output multi-column list |
662 | | - $html = "<table class='fr_reader_feedback_stats wikitable' cellspacing='0'><tr>"; |
| 662 | + $html = "<table class='wikitable fr_reader_feedback_stats' cellspacing='0'><tr>"; |
663 | 663 | foreach( FlaggedRevs::getFeedbackTags() as $tag => $w ) { |
664 | 664 | $html .= '<th>'.wfMsgHtml("readerfeedback-$tag").'</th>'; |
665 | 665 | } |
— | — | @@ -711,11 +711,10 @@ |
712 | 712 | return true; |
713 | 713 | } |
714 | 714 | $dbr = wfGetDB( DB_SLAVE ); |
715 | | - $tagTimestamp = $dbr->selectField( 'reader_feedback_pages', |
716 | | - 'rfp_touched', |
| 715 | + $tagTimestamp = $dbr->selectField( 'reader_feedback_pages', 'rfp_touched', |
717 | 716 | array( 'rfp_page_id' => $this->page->getArticleId(), 'rfp_tag' => $tag ), |
718 | 717 | __METHOD__ ); |
719 | | - $tagTimestamp = wfTimestamp( TS_MW, $tagTimestamp ); |
| 718 | + $tagTimestamp = wfTimestamp( TS_UNIX, $tagTimestamp ); |
720 | 719 | $file_unixtime = filemtime($path); |
721 | 720 | # Check max cache time |
722 | 721 | $cutoff_unixtime = time() - (7 * 24 * 3600); |
— | — | @@ -724,8 +723,7 @@ |
725 | 724 | return true; |
726 | 725 | } |
727 | 726 | # If there are new votes, graph is stale |
728 | | - $fileTimestamp = wfTimestamp( TS_MW, $file_unixtime ); |
729 | | - return ( $fileTimestamp < $tagTimestamp); |
| 727 | + return ( $file_unixtime < $tagTimestamp ); |
730 | 728 | } |
731 | 729 | |
732 | 730 | /** |
Index: trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php |
— | — | @@ -168,12 +168,16 @@ |
169 | 169 | $dbw->begin(); |
170 | 170 | $ok = ( $bot || $form->submit() ); // don't submit for mindless drones |
171 | 171 | $dbw->commit(); |
| 172 | + |
| 173 | + wfLoadExtensionMessages( 'RatingHistory' ); |
172 | 174 | if( $ok ) { |
173 | 175 | return '<suc#>'.wfMsgExt( 'readerfeedback-success', array('parseinline'), |
174 | | - $form->page->getPrefixedText(), $graphLink, $talk->getFullUrl( 'action=edit§ion=new' ) ); |
| 176 | + $form->page->getPrefixedText(), $graphLink, $talk->getFullUrl( 'action=edit§ion=new' ) ) . |
| 177 | + '<h4>'.wfMsgHtml('ratinghistory-table')."</h4>\n".RatingHistory::getVoteAggregates( $form->page, 31 ); |
175 | 178 | } else { |
176 | 179 | return '<err#>'.wfMsgExt( 'readerfeedback-voted', array('parseinline'), |
177 | | - $form->page->getPrefixedText(), $graphLink, $talk->getFullUrl( 'action=edit§ion=new' ) ); |
| 180 | + $form->page->getPrefixedText(), $graphLink, $talk->getFullUrl( 'action=edit§ion=new' ) ) . |
| 181 | + '<h4>'.wfMsgHtml('ratinghistory-table')."</h4>\n".RatingHistory::getVoteAggregates( $form->page, 31 ); |
178 | 182 | } |
179 | 183 | } |
180 | 184 | |