* (bug 17844) Redirect users to a specific page when they log in, see
$wgRedirectOnLogin
* Added a link to Special:UserRights on Special:Contributions for privileged users
+* (bug 10336) Added new magic word {{REVISIONUSER}}, which displays the user
+ name of the last user to edit the page
=== Bug fixes in 1.15 ===
* (bug 16968) Special:Upload no longer throws useless warnings.
$this->mOutput->setFlag( 'vary-revision' );
wfDebug( __METHOD__ . ": {{REVISIONTIMESTAMP}} used, setting vary-revision...\n" );
return $this->getRevisionTimestamp();
+ case 'revisionuser':
+ // Let the edit saving system know we should parse the page
+ // *after* a revision ID has been assigned. This is for null edits.
+ $this->mOutput->setFlag( 'vary-revision' );
+ wfDebug( __METHOD__ . ": {{REVISIONUSER}} used, setting vary-revision...\n" );
+ return $this->getRevisionUser();
case 'namespace':
return str_replace('_',' ',$wgContLang->getNsText( $this->mTitle->getNamespace() ) );
case 'namespacee':
return $this->mRevisionTimestamp;
}
+ /**
+ * Get the name of the user that edited the last revision
+ */
+ function getRevisionUser() {
+ // if this template is subst: the revision id will be blank,
+ // so just use the current user's name
+ if( $this->mRevisionId ) {
+ $dbr = wfGetDB( DB_SLAVE );
+ $revuser = $dbr->selectField( 'revision', 'rev_user_text',
+ array( 'rev_id' => $this->mRevisionId ), __METHOD__ );
+ } else {
+ global $wgUser;
+ $revuser = $wgUser->getName();
+ }
+ return $revuser;
+ }
+
/**
* Mutator for $mDefaultSort
*
'revisionmonth' => array( 1, 'REVISIONMONTH' ),
'revisionyear' => array( 1, 'REVISIONYEAR' ),
'revisiontimestamp' => array( 1, 'REVISIONTIMESTAMP' ),
+ 'revisionuser' => array( 1, 'REVISIONUSER' ),
'plural' => array( 0, 'PLURAL:' ),
'fullurl' => array( 0, 'FULLURL:' ),
'fullurle' => array( 0, 'FULLURLE:' ),