User:PeterVP

From mediawiki.org
Отдельные Wiki могут иметь собственные названия для категории самого верхнего уровня, как, например: Category:Contents в Wikipedia или Категория:Всё в Википедии.


Magic words[edit]

Variables[edit]

Date and time[edit]

Variable Output
Year
{{CURRENTYEAR}} 2024
Month
{{CURRENTMONTH}} 04
{{CURRENTMONTH1}} 4
{{CURRENTMONTHNAME}} April
{{CURRENTMONTHNAMEGEN}} April
{{CURRENTMONTHABBREV}} Apr
Day
{{CURRENTDAY}} 19
{{CURRENTDAY2}} 19
{{CURRENTDOW}} 5
{{CURRENTDAYNAME}} Friday
Time
{{CURRENTTIME}} 22:08
{{CURRENTHOUR}} 22
Other
{{CURRENTWEEK}} 16
{{CURRENTTIMESTAMP}} 20240419220801
Variable Output Description
Year
{{LOCALYEAR}} 2024 Year
Month
{{LOCALMONTH}} 04 Month (zero-padded number)
{{LOCALMONTH1}} 4 Month (unpadded number)
{{LOCALMONTHNAME}} April Month (name)
{{LOCALMONTHNAMEGEN}} April Month (genitive form)
{{LOCALMONTHABBREV}} Apr Month (abbreviation)
Day
{{LOCALDAY}} 19 Day of the month (unpadded number)
{{LOCALDAY2}} 19 Day of the month (zero-padded number)
{{LOCALDOW}} 5 Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)
{{LOCALDAYNAME}} Friday Day of the week (name)
Time
{{LOCALTIME}} 22:08 Time (24-hour HH:mm format)
{{LOCALHOUR}} 22 Hour (24-hour zero-padded number)
Other
{{LOCALWEEK}} 16 Week (number)
{{LOCALTIMESTAMP}} 20240419220801 YYYYMMDDHHmmss timestamp


Technical metadata[edit]

Variable Output Description Versions
Site
{{SITENAME}} MediaWiki The wiki's site name.
{{SERVER}} //www.mediawiki.org Domain URL.
{{SERVERNAME}} www.mediawiki.org Subdomain and domain name (no longer dependent on $wgServerName as of version 1.17).
{{SCRIPTPATH}} /w Relative script path.
{{STYLEPATH}} /w/skins Relative style path.
{{CURRENTVERSION}} 1.43.0-wmf.1 (8e1947e) The wiki's MediaWiki version.
{{CONTENTLANGUAGE}}
{{CONTENTLANG}}
en
en
The wiki's default interface language.
{{DIRMARK}}
{{DIRECTIONMARK}}

Outputs a Unicode directional mark that matches the wiki's default language's direction (‎ on left-to-right wikis, ‏ on right-to-left wikis), useful in text with multi-directional text. Since 1.19, it depends on the page content language.


Page
{{PAGEID}} 581575 Returns the page identifier. 1.20
{{PROTECTIONLEVEL:action}} Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page. Returns an empty string if not protected.
{{PROTECTIONEXPIRY:action}} Outputs the protection expiry (e.g. "20160418155030", "infinity") for a given action (e.g. "edit", "move") on the current page. Returns "infinity" if not protected. 1.27
{{CASCADINGSOURCES}} [Expensive] Returns the sources of any cascading protection acting on the current page. Pages will not return their own title unless they transclude themselves. 1.23


Latest revision to current page
{{REVISIONID}} - Unique revision ID.
{{REVISIONDAY}} 15 Day edit was made (unpadded number).
{{REVISIONDAY2}} 15 Day edit was made (zero-padded number).
{{REVISIONMONTH}} 05 Month edit was made (zero-padded number as of 1.17+, unpadded number in prior versions).
{{REVISIONMONTH1}} 5 Month edit was made (unpadded number).
{{REVISIONYEAR}} 2016 Year edit was made.
{{REVISIONTIMESTAMP}} 20160515125404 Timestamp as of time of edit.
{{REVISIONUSER}} PeterVP The username of the user who made the most recent edit to the page, or the current user when previewing an edit.
{{REVISIONSIZE}} 13008 The size (bytes of wikitext) of the current revision of this page 1.22


Affects page content
{{DISPLAYTITLE:title}} Format the current page's title header. The value must be equivalent to the default title: only capitalization changes to certain parts of the title (not all) and replacing spaces with underscores are allowed (this can be changed with; disabled by default before 1.10+, enabled by default thereafter.


It can take a second argument of noerror or noreplace to suppress error messages when multiple displaytitles are used on one page or to make this displaytitle do nothing if a displaytitle was already specified earlier in the page.

1.7
1.24 (for noerror and noreplace)
{{DEFAULTSORT:sortkey}}
{{DEFAULTSORTKEY:sortkey}}
{{DEFAULTCATEGORYSORT:sortkey}}
{{DEFAULTSORT:sortkey|noerror}}
{{DEFAULTSORT:sortkey|noreplace}}
Used for categorizing pages, sets a default category sort key. For example if you put {{DEFAULTSORT:Smith , John}} at the end of John Smith, the page would be sorted under "S" by default in categories. It can take a second argument of noerror or noreplace to suppress error messages when multiple defaultsortkeys are used on one page or to make this defaultsort do nothing if a defaultsort was already specified earlier in the page. 1.10
1.19 (for noerror and noreplace)


Statistics[edit]


Variable Output Description Versions
{{NUMBEROFPAGES}} 1,654,351 Number of wiki pages.
{{NUMBEROFARTICLES}} 63,652 Number of pages in content namespaces.
{{NUMBEROFFILES}} 2,798 Number of uploaded files.
{{NUMBEROFEDITS}} 6,368,288 Number of wiki edits.
{{NUMBEROFVIEWS}} Number of page views. Usually useless on a wiki using caching. Removed in Gerrit change 150699. 1.14 - 1.24
{{NUMBEROFUSERS}} 17,923,954 Number of registered users.
{{NUMBEROFADMINS}} 132 Number of users in the sysop group.
{{NUMBEROFACTIVEUSERS}} 890 Number of active users, based on the criteria used in Special:Statistics.
{{PAGESINCATEGORY:categoryname}}
{{PAGESINCAT:categoryname}}
140
140
[Expensive] Number of pages (including subcategories and files) in the given category. (Category:Help used for demonstration)
{{PAGESINCATEGORY:categoryname|all}}
{{PAGESINCATEGORY:categoryname|pages}}
{{PAGESINCATEGORY:categoryname|subcats}}
{{PAGESINCATEGORY:categoryname|files}}
140
137
3
0
[Expensive] Respectively, the number of
  • all pages
  • ordinary pages (excluding subcategories and files)
  • subcategories or
  • files

in the given category. (Category:Help used for demonstration)

1.20
{{NUMBERINGROUP:groupname}}
{{NUMINGROUP:groupname}}
21
21
Number of users in a specific group.
({{NUMBERINGROUP:bureaucrat}} used here)
{{PAGESINNS:index}}
{{PAGESINNAMESPACE:index}}
Not enabled [Expensive] Number of pages in the given namespace (replace index with the relevant namespace index). For instance, {{PAGESINNAMESPACE:14}} will output the number of category pages. {{PAGESINNS:0}} differs from {{NUMBEROFARTICLES}} in that the former includes redirects and disambiguation pages. Disabled by default, enable with $wgAllowSlowParserFunctions.


Parser functions[edit]