Extension:MyVariables/zh

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:MyVariables and the translation is 12% complete.
MediaWiki擴充功能手冊
OOjs UI icon advanced-invert.svg
MyVariables
发布状态: 稳定版
实现 变量
描述 Adds new built-in variables
作者
维护者 WikiTeq team
最新版本 4.3 (2021-09-23)
兼容性方针 遵循MediaWiki版本生命周期。 master分支不向后兼容。
MediaWiki 1.31+
数据庫更改
许可协议 GNU通用公眾授權條款2.0或更新版本
下载
翻譯MyVariables擴充功能如在translatewiki.net可用

检查使用和版本矩阵。

The MyVariables extension adds new built-in variables:

变量 描述 Sample
{{CURRENTUSER}} Login of current user or the IP for anonymous users. "Pastakhov" or "x.x.x.x"
{{CURRENTLOGGEDUSER}} Login of current user or empty for anonymous users. "Pastakhov" or ""
{{CURRENTUSERREALNAME}} Real name of current user. "Pavel Astakhov"
{{HITCOUNTER}} Number of visits (hits) to the current page according to Extension:HitCounters or empty if the extension isn't installed. "123" or ""
{{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.
{{USERREGISTRATION}} Timestamp of the date at which the user registered or empty if the page isn't a user page. "20100809003006" or ""
{{FIRSTREVISIONID}} ID of the first revision of the current page or empty if page isn't yet created. "1" or ""
{{FIRSTREVISIONTIMESTAMP}} Timestamp of the first revision of the current page or empty if page isn't yet created. "20100809003006" or ""
{{FIRSTREVISIONUSER}} The user name (without the User prefix) or IP address associated to the first revision of the current page or empty if page isn't yet created. "Pastakhov", "x.x.x.x" or ""
{{PAGEIMAGE}} The main image of the current page as determined by 扩展:页面图像 . If the extension is not installed or no main image was determined then {{PAGEIMAGE}} will output nothing. "Logo.png" or ""
{{REALNAME}} When used in a user page, will output the real name of the user. However, if used like this {{REALNAME:Jimbo}} it will output the real name of the user Jimbo. This dual behavior is similar to core variables like {{PAGENAME}}. "Pastakhov" or ""
{{REDIRECTS}} Comma-separated list of redirects to the current page or empty if there're no redirects. "Foo, Bar, Baz" or ""
{{SUBPAGES}} The subpages of the current page, in plain text, comma-separated and in alphabetic order. If there are no any subpages, it will output nothing. "Pastakhov/Subpage1, Pastakhov/Subpage2" or ""
{{WHATLINKSHERE}} The titles of the pages that link to the current page, comma-separated and in alphabetic order. It will be empty if there are no any linked pages. "Bar, Baz, Foo" or ""

安装

  • 下载文件,并将其放置在您extensions/文件夹中的MyVariables目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'MyVariables' );
    
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

致使用MediaWiki 1.31或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.31和更早版本)中安装此扩展,而不是wfLoadExtension( 'MyVariables' );,您需要使用:

require_once "$IP/extensions/MyVariables/MyVariables.php";

注释

  • This extension should not be confused with the [[Special:MyLanguage/Extension:Variables|]] extension, which allows the use of variables in the computer programming sense.

参见

Wikiteq - logo.png This extension is professionally maintained by the WikiTeq team.