* (bug 6092) Introduce magic words {{REVISIONDAY}}, {{REVISIONDAY2}, {{REVISIONMONTH}},

{{REVISIONYEAR}} and {{REVISIONTIMESTAMP}}
This commit is contained in:
Jimmy Collins 2006-09-26 17:20:36 +00:00
parent 3a515b48b1
commit 57aa38cc61
4 changed files with 22 additions and 0 deletions

View file

@ -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 ==

View file

@ -70,6 +70,11 @@ class MagicWord {
'localweek',
'localdow',
'revisionid',
'revisionday',
'revisionday2',
'revisionmonth',
'revisionyear',
'revisiontimestamp',
'subpagename',
'subpagenamee',
'displaytitle',

View file

@ -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':

View file

@ -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:' ),