* (bug 6092) Introduce magic words {{REVISIONDAY}}, {{REVISIONDAY2}, {{REVISIONMONTH}},
authorJimmy Collins <collinj@users.mediawiki.org>
Tue, 26 Sep 2006 17:20:36 +0000 (17:20 +0000)
committerJimmy Collins <collinj@users.mediawiki.org>
Tue, 26 Sep 2006 17:20:36 +0000 (17:20 +0000)
  {{REVISIONYEAR}} and {{REVISIONTIMESTAMP}}

RELEASE-NOTES
includes/MagicWord.php
includes/Parser.php
languages/MessagesEn.php

index 0419b9d..a2b01ed 100644 (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 ==
index 4df1c6f..826a7e9 100644 (file)
@@ -70,6 +70,11 @@ class MagicWord {
                'localweek',
                'localdow',
                'revisionid',
+               'revisionday',
+               'revisionday2',
+               'revisionmonth',
+               'revisionyear',
+               'revisiontimestamp',
                'subpagename',
                'subpagenamee',
                'displaytitle',
index 7b31c7b..2406691 100644 (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':
index ba110fe..1331c00 100644 (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:'              ),