From 57aa38cc61a86bf75c763f3fc91ea83b7f17307c Mon Sep 17 00:00:00 2001 From: Jimmy Collins Date: Tue, 26 Sep 2006 17:20:36 +0000 Subject: [PATCH] * (bug 6092) Introduce magic words {{REVISIONDAY}}, {{REVISIONDAY2}, {{REVISIONMONTH}}, {{REVISIONYEAR}} and {{REVISIONTIMESTAMP}} --- RELEASE-NOTES | 2 ++ includes/MagicWord.php | 5 +++++ includes/Parser.php | 10 ++++++++++ languages/MessagesEn.php | 5 +++++ 4 files changed, 22 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0419b9d870..a2b01ed0a4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -231,6 +231,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 6849) Block @ from usernames; interferes with multi-database tools and was meant to be banned years ago... For now existing accounts will not be prevented fromm login. +* (bug 6092) Introduce magic words {{REVISIONDAY}}, {{REVISIONDAY2}, {{REVISIONMONTH}}, + {{REVISIONYEAR}} and {{REVISIONTIMESTAMP}} == Languages updated == diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 4df1c6fc76..826a7e9d04 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -70,6 +70,11 @@ class MagicWord { 'localweek', 'localdow', 'revisionid', + 'revisionday', + 'revisionday2', + 'revisionmonth', + 'revisionyear', + 'revisiontimestamp', 'subpagename', 'subpagenamee', 'displaytitle', diff --git a/includes/Parser.php b/includes/Parser.php index 7b31c7b545..24066912af 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2411,6 +2411,16 @@ class Parser return $subjPage->getPrefixedUrl(); case 'revisionid': return $this->mRevisionId; + case 'revisionday': + return intval( substr( $this->mTitle->getTouched(), 6, 2 ) ); + case 'revisionday2': + return substr( $this->mTitle->getTouched(), 6, 2 ); + case 'revisionmonth': + return intval( substr( $this->mTitle->getTouched(), 4, 2 ) ); + case 'revisionyear': + return substr( $this->mTitle->getTouched(), 0, 4 ); + case 'revisiontimestamp': + return $this->mTitle->getTouched(); case 'namespace': return str_replace('_',' ',$wgContLang->getNsText( $this->mTitle->getNamespace() ) ); case 'namespacee': diff --git a/languages/MessagesEn.php b/languages/MessagesEn.php index ba110fed8c..1331c00b2c 100644 --- a/languages/MessagesEn.php +++ b/languages/MessagesEn.php @@ -270,6 +270,11 @@ $magicWords = array( 'localweek' => array( 1, 'LOCALWEEK' ), 'localdow' => array( 1, 'LOCALDOW' ), 'revisionid' => array( 1, 'REVISIONID' ), + 'revisionday' => array( 1, 'REVISIONDAY' ), + 'revisionday2' => array( 1, 'REVISIONDAY2' ), + 'revisionmonth' => array( 1, 'REVISIONMONTH' ), + 'revisionyear' => array( 1, 'REVISIONYEAR' ), + 'revisiontimestamp' => array( 1, 'REVISIONTIMESTAMP' ), 'plural' => array( 0, 'PLURAL:' ), 'fullurl' => array( 0, 'FULLURL:' ), 'fullurle' => array( 0, 'FULLURLE:' ), -- 2.20.1