Extension:MyVariables

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
MyVariables

Release status: stable

Implementation Variable
Description Adds new built-in variables
Author(s) Aran Dunkley, Pavel Astakhov
Latest version 3.2.0 (2014-04-01)
MediaWiki 1.17+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download
Example test.foxway.org
Hooks used
MagicWordwgVariableIDs

ParserGetVariableValueSwitch

Translate the MyVariables extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The MyVariables extension adds new built-in variables:

Variable Description Sample
{{CURRENTUSER}} Login of current user "Pastakhov"
{{CURRENTLOGGEDUSER}} Login of current user or empty for anonymous users "Pastakhov" or ""
{{CURRENTUSERREALNAME}} Real name of current user "Pavel Astakhov"
{{LOGO}} Path to wiki logo "/w/skins/common/images/wiki.png"
{{UUID}} Random (v4) UUID "65ba1a51-c723-4b9d-b1f3-13148d628322"
{{USERLANGUAGECODE}} Language that the user specified in the preferences "en", "en-ca", "ru", etc.

Installation[edit | edit source]

  • Download and extract the tarball in your extensions/ folder. It should generate a new folder called MyVariables directly inside your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/MyVariables/MyVariables.php";
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Note[edit | edit source]

  • This extension should not be confused with the Variables extension, which allows the use of variables in the computer programming sense.

See also[edit | edit source]

Language: English  • 日本語