User:Lariat2301/SandBox2: Difference between revisions
Lariat2301 (talk | contribs) No edit summary |
Lariat2301 (talk | contribs) No edit summary |
||
Line 21: | Line 21: | ||
Checking basic timestamping: <nowiki>{{CURRENTTIMESTAMP}}</nowiki>? Is this undefined?: {{CURRENTTIMESTAMP}} | Checking basic timestamping: <nowiki>{{CURRENTTIMESTAMP}}</nowiki>? Is this undefined?: {{CURRENTTIMESTAMP}} | ||
While | |||
While we're at it, lets take a look at some of the other cool stuff from [http://www.mediawiki.org/wiki/Help:Magic_words#Variables the mediawiki page]:<br> | |||
<nowiki>{{LOCALTIME}}</nowiki>? Is this undefined?: {{LOCALTIME}}<br> | |||
<nowiki>{{NUMBEROFUSERS}}</nowiki>? Is this undefined?: {{NUMBEROFUSERS}}<br> | |||
<nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki>? Is this undefined?: {{NUMBEROFACTIVEUSERS}}<br> | |||
<nowiki>{{NUMBEROFADMINS}}</nowiki>? Is this undefined?: {{NUMBEROFADMINS}}<br> | |||
---- | ---- |
Revision as of 12:31, 11 June 2009
With normal transclusion:
{{CURRENTDAY}}-{{CURRENTMONTHNAME}}-{{CURRENTYEAR}} {{CURRENTTIME}}
produces...
22-December-2024 20:09
With subclusion:
{{subst:CURRENTDAY}}-{{subst:CURRENTMONTHNAME}}-{{subst:CURRENTYEAR}} {{subst:CURRENTTIME}}
produces...
11-June-2009 12:19
But in the latter case, the actual source of this page has been changed permanently.
Try it: edit this page and replace the date-and-time information shown under subclusion with the protected version just above it. Then save the page and reopen it.
The question is: can this be used to automate wiki-readable timestamps?
Imagine that a subclusion'd version of the month and date were in a template in such a way that they automatically time-stamped a DangerReport when a user updated it. Comparisons between the 'current' month and date and those so timestamped could be used to automate aging of DangerReports... or at least I think so.
Checking basic timestamping: {{CURRENTTIMESTAMP}}? Is this undefined?: 20241222200943
While we're at it, lets take a look at some of the other cool stuff from the mediawiki page:
{{LOCALTIME}}? Is this undefined?: 20:09
{{NUMBEROFUSERS}}? Is this undefined?: 51,338
{{NUMBEROFACTIVEUSERS}}? Is this undefined?: 18
{{NUMBEROFADMINS}}? Is this undefined?: 7
Other tools to be used in this: {{PREVIOUSMONTH}} isn't implemented here (undefined: Template:PREVIOUSMONTH) but this is what generates it:
{{#expr:(({{CURRENTMONTH}}+10)mod 12)+1}}
Does it work? Only if our wiki has implemented the math functions... Here: {{#expr:((12+10)mod 12)+1}} Nope. Doesn't work.