Page MenuHomePhabricator

proposal : New magic word {{USERNAME}}
Closed, DuplicatePublic

Description

Author: loustyx

Description:
This magic word is so useful that I really don't understand why this isn't
allready implemented.
For example :
*[http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Monobook]
*[http://en.wikipedia.org/wiki/Template:Delete] improvment
*automatic signature in some templates


Version: 1.7.x
Severity: normal

Details

Reference
bz5738

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:12 PM
bzimport set Reference to bz5738.
bzimport added a subscriber: Unknown Object (MLST).

loustyx wrote:

changes:
$ diff includes/Parser.php includes/Parser.php~
76c76

< * objects: $wgLang, $wgContLang, $wgUser

  • objects: $wgLang, $wgContLang

78c78

< * NOT $wgArticle or $wgTitle. Keep them away!

  • NOT $wgArticle, $wgUser or $wgTitle. Keep them away!

2063c2063
< global $wgContLang, $wgSitename, $wgServer, $wgServerName,

$wgScriptPath, $wgUser;

global $wgContLang, $wgSitename, $wgServer, $wgServerName,

$wgScriptPath;
2102,2105d2101
< case MAG_USERNAME:
< return $wgUser->getName();
< case MAG_USERNAMEE:
< return wfUrlencode( $wgUser->getName() );

$ diff includes/MagicWord.php includes/MagicWord.php~
75,76d74
< 'MAG_USERNAME',
< 'MAG_USERNAMEE',
110,112c108
< MAG_SUBPAGENAMEE,
< MAG_USERNAME,

< MAG_USERNAMEE

MAG_SUBPAGENAMEE

$ diff languages/Language.php languages/Language.php~
232,233c232,233
< MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ),

< MAG_SUBPAGENAMEE => array( 0, 'SUBPAGENAMEE' ),

MAG_SUBPAGENAME          => array( 0,    'SUBPAGENAME'                    ),
MAG_SUBPAGENAMEE                 => array( 0,    'SUBPAGENAMEE'
),

268,269d267
< MAG_USERNAME => array( 1, 'USERNAME' ),
< MAG_USERNAMEE => array( 1, 'USERNAMEE' ),

robchur wrote:

*** This bug has been marked as a duplicate of 4196 ***