From: Jimmy Collins Date: Tue, 26 Sep 2006 22:45:16 +0000 (+0000) Subject: Fix update made in r16659 - now use field revision_timestamp instead of page_touched. X-Git-Tag: 1.31.0-rc.0~55712 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=1fc51442c5d75cff719dbad214c1744617ace31b;p=lhc%2Fweb%2Fwiklou.git Fix update made in r16659 - now use field revision_timestamp instead of page_touched. --- diff --git a/includes/Parser.php b/includes/Parser.php index 24066912af..cb4020d652 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2412,15 +2412,15 @@ class Parser case 'revisionid': return $this->mRevisionId; case 'revisionday': - return intval( substr( $this->mTitle->getTouched(), 6, 2 ) ); + return intval( substr( wfRevisionTimestamp( $this->mRevisionId ), 6, 2 ) ); case 'revisionday2': - return substr( $this->mTitle->getTouched(), 6, 2 ); + return substr( wfRevisionTimestamp( $this->mRevisionId ), 6, 2 ); case 'revisionmonth': - return intval( substr( $this->mTitle->getTouched(), 4, 2 ) ); + return intval( substr( wfRevisionTimestamp( $this->mRevisionId ), 4, 2 ) ); case 'revisionyear': - return substr( $this->mTitle->getTouched(), 0, 4 ); + return substr( wfRevisionTimestamp( $this->mRevisionId ), 0, 4 ); case 'revisiontimestamp': - return $this->mTitle->getTouched(); + return wfRevisionTimestamp( $this->mRevisionId ); case 'namespace': return str_replace('_',' ',$wgContLang->getNsText( $this->mTitle->getNamespace() ) ); case 'namespacee': @@ -4882,6 +4882,26 @@ function wfLoadSiteStats() { } } +/** + * Get revision timestamp from the database considering timecorrection + * + * @param $id Int: page revision id + * @return integer + */ +function wfRevisionTimestamp( $id ) { + global $wgContLang; + $fname = 'wfRevisionTimestamp'; + + wfProfileIn( $fname ); + $dbr =& wfGetDB( DB_SLAVE ); + $timestamp = $dbr->selectField( 'revision', 'rev_timestamp', + array( 'rev_id' => $id ), __METHOD__ ); + $timestamp = $wgContLang->userAdjust( $timestamp ); + wfProfileOut( $fname ); + + return $timestamp; +} + /** * Escape html tags * Basically replacing " > and < with HTML entities ( ", >, <)