r34825 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34824‎ | r34825 | r34826 >
Date:18:39, 14 May 2008
Author:aaron
Status:old
Tags:
Comment:
Use db timestamp functions for PG
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php
@@ -1674,12 +1674,12 @@
16751675 global $wgOut, $wgUser, $wgFlaggedRevsOversightAge;
16761676 $this->setHeaders();
16771677 $wgOut->addHTML( wfMsgExt('qualityoversight-list', array('parse') ) );
1678 - # Create a LogPager item to get the results and a LogEventsList
1679 - # item to format them...
1680 - $cutoff = time() - $wgFlaggedRevsOversightAge;
 1678+ # Create a LogPager item to get the results and a LogEventsList item to format them...
 1679+ $dbr = wfGetDB( DB_SLAVE );
 1680+ $cutoff = $dbr->addQuotes( $dbr->timestamp(time() - $wgFlaggedRevsOversightAge) );
16811681 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
16821682 $pager = new LogPager( $loglist, 'review', '', '', '',
1683 - array('log_action' => array('approve2','unapprove2'), "log_timestamp > '$cutoff'" ) );
 1683+ array('log_action' => array('approve2','unapprove2'), "log_timestamp > $cutoff" ) );
16841684 # Insert list
16851685 $logBody = $pager->getBody();
16861686 if( $logBody ) {
@@ -1706,12 +1706,12 @@
17071707 global $wgOut, $wgUser, $wgFlaggedRevsOversightAge;
17081708 $this->setHeaders();
17091709 $wgOut->addHTML( wfMsgExt('depreciationoversight-list', array('parse') ) );
1710 - # Create a LogPager item to get the results and a LogEventsList
1711 - # item to format them...
1712 - $cutoff = time() - $wgFlaggedRevsOversightAge;
 1710+ # Create a LogPager item to get the results and a LogEventsList item to format them...
 1711+ $dbr = wfGetDB( DB_SLAVE );
 1712+ $cutoff = $dbr->addQuotes( $dbr->timestamp(time() - $wgFlaggedRevsOversightAge) );
17131713 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
17141714 $pager = new LogPager( $loglist, 'review', '', '', '',
1715 - array('log_action' => array('unapprove','unapprove2'), "log_timestamp > '$cutoff'" ) );
 1715+ array('log_action' => array('unapprove','unapprove2'), "log_timestamp > $cutoff" ) );
17161716 # Insert list
17171717 $logBody = $pager->getBody();
17181718 if( $logBody ) {

Status & tagging log