MediaWiki/content programming

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to: navigation, search

Overview

MediaWiki's built-in features already allow some simple dynamic text management and manipulation; with the addition of various extensions, much more sophisticated tasks can be accomplished, making MediaWiki into a sort of "swiss army knife" content manager application.

Information

How to get various bits of information about stuff

Date/Time
Year MW: {{CURRENTYEAR}} 2019
Month MW: {{CURRENTMONTH}} (zero-padded number) 08
MW: {{CURRENTMONTHNAME}} (name) August
MW: {{CURRENTMONTHNAMEGEN}} (genitive form) August
MW: {{CURRENTMONTHABBREV}} (abbreviation; requires MW 1.5+) Aug
Day-of-month MW: {{CURRENTDAY}} (unpadded number) 20
MW: {{CURRENTDAY2}} (zero-padded number; requires MW 1.6+) 20
Day-of-week MW: {{CURRENTDOW}} (unpadded number) 2
MW: {{CURRENTDAYNAME}} (name) Tuesday
Week MW: {{CURRENTWEEK}} (number) 34
Time: full MW: {{CURRENTTIME}} (24-hour HH:mm format) 18:36
Time: hour MW: {{CURRENTHOUR}} (24-hour zero-padded number) 18
Timestamp MW: {{CURRENTTIMESTAMP}} 20190820183654
Site Info
Site's name
($wgSitename)
MW: {{SITENAME}} HTYP
MediaWiki version MW: {{CURRENTVERSION}} 1.31.1
Default language
($wgLanguageCode)
MW: {{CONTENTLANGUAGE}} en
# of wiki pages MW: {{NUMBEROFPAGES}} 4,775
# of pages in main namespace MW: {{NUMBEROFARTICLES}} 2,687
# of uploaded files MW: {{NUMBEROFFILES}} 452
# of page edits MW: {{NUMBEROFEDITS}} 27,774
# of registered users MW: {{NUMBEROFUSERS}} 7,481
# of sysops MW: {{NUMBEROFADMINS}} 2
Page Title
Full Title MW: {{FULLPAGENAME}} MediaWiki/content programming
MW: {{SUBJECTPAGENAME}} - namespace+base MediaWiki/content programming
MW: {{TALKPAGENAME}} - talkpage namespace+base Talk:MediaWiki/content programming
Prefix
(namespace only)
DPL: %NAMESPACE%
Suffix
(without namespace)
DPL: %TITLE%
MW: {{PAGENAME}} MediaWiki/content programming
MW: {{BASEPAGENAME}} - base title, no subpage MediaWiki
MW: {{SUBPAGENAME}} - subpage content programming
Namespace MW: {{NAMESPACE}}
Content namespace MW: {{SUBJECTSPACE}}
Talk namespace MW: {{TALKSPACE}} Talk
Page Info
Usage counter (hits) DPL:  %COUNT% (requires addpagecounter=true)

DPL: %COUNTFS% = a font size number based on usage counter
DPL: %COUNTFS2% = similar to %COUNTFS%, but log(sqrt(counter))

Page size (bytes) DPL: %SIZE% (requires addpagesize=true)

DPL: %SIZEFS% – font size number based on article size

Creation date DPL: %DATE% (requires addeditdate=true and ordermethod=firstedit)
Last edit date DPL: %DATE% (requires addeditdate=true and ordermethod=lastedit)
MW: {{REVISIONDAY}}: Day edit was made (unpadded number) 1
MW: {{REVISIONDAY2}}: Day edit was made (zero-padded number) 01
MW: {{REVISIONMONTH}}: Month edit was made (unpadded number) 08
MW: {{REVISIONYEAR}}: Year edit was made 2008
MW: {{REVISIONTIMESTAMP}}: Timestamp as of time of edit 20080801182318
Page creator DPL: %USER% (requires adduser=true and ordermethod=firstedit)
Page last editor DPL:  %USER% (requires adduser=true and ordermethod=lastedit)
Revision ID MW: {{REVISIONID}} 10045

Sources