MediaWiki/content programming

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< MediaWiki
Revision as of 02:03, 31 July 2008 by Woozle (talk | contribs) (some stuff from MW doc)
Jump to navigation Jump to 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}} 2024
Month MW: {{CURRENTMONTH}} (zero-padded number) 04
MW: {{CURRENTMONTHNAME}} (name) April
MW: {{CURRENTMONTHNAMEGEN}} (genitive form) April
MW: {{CURRENTMONTHABBREV}} (abbreviation; requires MW 1.5+) Apr
Day-of-month MW: {{CURRENTDAY}} (unpadded number) 19
MW: {{CURRENTDAY2}} (zero-padded number; requires MW 1.6+) 19
Day-of-week MW: {{CURRENTDOW}} (unpadded number) 5
MW: {{CURRENTDAYNAME}} (name) Friday
Week MW: {{CURRENTWEEK}} (number) 16
Time: full MW: {{CURRENTTIME}} (24-hour HH:mm format) 23:19
Time: hour MW: {{CURRENTHOUR}} (24-hour zero-padded number) 23
Timestamp MW: {{CURRENTTIMESTAMP}} 20240419231913
Page Title
Prefix
(namespace only)
DPL: %NAMESPACE%
Suffix
(without namespace)
DPL: %TITLE%
Page Stats
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)
Page creator DPL: %USER% (requires adduser=true and ordermethod=firstedit)
Page last editor DPL: %USER% (requires adduser=true and ordermethod=lastedit)

Sources