User:Lariat2301/SandBox2: Difference between revisions
Lariat2301 (talk | contribs) No edit summary |
Lariat2301 (talk | contribs) No edit summary |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>See: [[User:Lariat2301/SandPit|Sand Pit]], [[User:Lariat2301/SandBox|Sand Box]], [[User:Lariat2301/SandBox2|SandBox2]] and [[User:Lariat2301/SandBox3|SandBox3]]. | |||
__TOC__</noinclude> | |||
With normal transclusion: | With normal transclusion: | ||
<pre> | <pre> | ||
Line 9: | Line 11: | ||
{{subst:CURRENTDAY}}-{{subst:CURRENTMONTHNAME}}-{{subst:CURRENTYEAR}} {{subst:CURRENTTIME}} | {{subst:CURRENTDAY}}-{{subst:CURRENTMONTHNAME}}-{{subst:CURRENTYEAR}} {{subst:CURRENTTIME}} | ||
</pre>produces... <!-- And paste it to this line: --> | </pre>produces... <!-- And paste it to this line: --> | ||
11-June-2009 | 11-June-2009 15:54 | ||
But in the latter case, the actual source of this page has been changed permanently. | But in the latter case, the actual source of this page has been changed permanently. | ||
Line 20: | Line 22: | ||
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. | 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: <nowiki>{{CURRENTTIMESTAMP}}</nowiki>? Is this undefined?: {{CURRENTTIMESTAMP}} | |||
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]:<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> | |||
This one might be cool: <nowiki>__NEWSECTIONLINK__</nowiki>? If this works, there should be a "+" at the top of this page for new sections. | |||
__NEWSECTIONLINK__ | |||
Yup, that one works. | |||
Ah, what is the mediawiki version of the UD wiki? <nowiki>{{CURRENTVERSION}}</nowiki>: {{CURRENTVERSION}}<br> | |||
Finally, anything the UD wiki can do specially? It'll be listed on the [[Special:Version]] page. | |||
<br> | |||
---- | |||
<br> | |||
Other tools to be used in this: | Other tools to be used in this: | ||
<nowiki>{{PREVIOUSMONTH}}</nowiki> | <nowiki>{{PREVIOUSMONTH}}</nowiki> isn't implemented here (undefined: {{PREVIOUSMONTH}}) but this is what generates it: | ||
<pre>{{#expr:(({{CURRENTMONTH}}+10)mod 12)+1}}</pre> | |||
Does it work? Only if our wiki has implemented the math functions... | |||
Here: {{#expr:(({{CURRENTMONTH}}+10)mod 12)+1}} | |||
Nope. Doesn't work. | |||
What is missing comes from [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions here]. | |||
<br clear=both /> | |||
---- | |||
OK: | |||
<pre> | |||
[[Image:mall-{{{status|unknown}}}-small.jpg]] | |||
</pre> | |||
[[Image:mall-{{{status|unknown}}}-small.jpg]] | |||
<pre> | |||
{| style="width:7px; height:7px; background:{{StatusMap {{{status|unknown}}}}}" | <!-- Hah! Nothing in the box! --> | |||
|} | |||
</pre> | |||
{| style="width:7px; height:7px; background:{{StatusMap {{{status|unknown}}}}}" | <!-- Hah! Nothing in the box! --> | |||
|} |
Latest revision as of 16:14, 11 June 2009
See: Sand Pit, Sand Box, SandBox2 and SandBox3.
With normal transclusion:
{{CURRENTDAY}}-{{CURRENTMONTHNAME}}-{{CURRENTYEAR}} {{CURRENTTIME}}
produces...
22-December-2024 20:37
With subclusion:
{{subst:CURRENTDAY}}-{{subst:CURRENTMONTHNAME}}-{{subst:CURRENTYEAR}} {{subst:CURRENTTIME}}
produces...
11-June-2009 15:54
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?: 20241222203746
While we're at it, lets take a look at some of the other cool stuff from [1]:
{{LOCALTIME}}? Is this undefined?: 20:37
{{NUMBEROFUSERS}}? Is this undefined?: 51,339
{{NUMBEROFACTIVEUSERS}}? Is this undefined?: 18
{{NUMBEROFADMINS}}? Is this undefined?: 7
This one might be cool: __NEWSECTIONLINK__? If this works, there should be a "+" at the top of this page for new sections.
Yup, that one works.
Ah, what is the mediawiki version of the UD wiki? {{CURRENTVERSION}}: 1.39.1
Finally, anything the UD wiki can do specially? It'll be listed on the Special:Version page.
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. What is missing comes from here.
OK:
[[Image:mall-{{{status|unknown}}}-small.jpg]]
{| style="width:7px; height:7px; background:{{StatusMap {{{status|unknown}}}}}" | <!-- Hah! Nothing in the box! --> |}