Difference between revisions of "Template:On this day if"

From Co-Optitude Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
Shows a "on this day" block for an episode if today is its air date.
+
Shows an "on this day" block for an episode if today is its air date. Sub-template of [[Template:On this day]] which uses one of these for each anniversary of note.
  
 
Usage:
 
Usage:
 
<pre>
 
<pre>
{{OnThisDayIf|AirDate=2013-02-18|EpNum=F43|Games=Mortal Kombat; Shaq Fu}}
+
{{On this day if|AirDate=2013-02-18|EpNum=F43|Games=Mortal Kombat; Shaq Fu}}
 
</pre>
 
</pre>
  
 
* EpNum is a 3-character episode number, like 003 for a Co-Optitude episode or F43 for a Flog episode
 
* EpNum is a 3-character episode number, like 003 for a Co-Optitude episode or F43 for a Flog episode
</noinclude>
+
</noinclude><includeonly>{{#vardefine:airYear|{{#time:Y|{{{AirDate}}} }} }}<!--
<includeonly>
+
-->{{#vardefine:airMonth|{{#time:n|{{{AirDate}}} }} }}<!--
(
+
-->{{#vardefine:airDay|{{#time:j|{{{AirDate}}} }} }}<!--
{{#vardefine:airYear|{{#time:Y|{{{AirDate}}} }} }}Y={{#var:airYear}},
+
-->{{#vardefine:airYearsAgo|{{#expr:{{LOCALYEAR}} - {{#var:airYear}} }} }}<!--
{{#vardefine:airMonth|{{#time:n|{{{AirDate}}} }} }}M={{#var:airMonth}},
+
-->{{#ifexpr: {{LOCALMONTH1}} = {{#var:airMonth}} and {{LOCALDAY}}={{#var:airDay}}|<!-- (if today matches passed M/D)
{{#vardefine:airDay|{{#time:j|{{{AirDate}}} }} }}D={{#var:airDay}},
+
   -->==On this day==
{{#ifexpr: {{LOCALMONTH1}} = {{#var:airMonth}} and {{LOCALDAY}}={{#var:airDay}}|
+
 
   <div style="background-color: #eeeeff; border: 1px solid #666699; padding: 1em;">
+
* '''{{#dateformat:{{{AirDate|}}}|mdy}}''' ({{#var:airYearsAgo}} years ago): <!--
    {{#ifeq:{{#sub:{{{EpNum}}}|0|1}}|F|
+
  -->{{#ifeq:{{#sub:{{{EpNum}}}|0|1}}|F|<!-- (if Flog episode)
      {{#vardefine:flogEpNum|{{#expr:1 * {{#sub:{{{EpNum}}}|1}} }} }}
+
    -->{{#vardefine:flogEpNum|{{#expr:1 * {{#sub:{{{EpNum}}}|1}} }} }}<!--
      On this day in {{#var:airYear}}, [[The Flog episode {{#var:flogEpNum}}]] aired featuring games {{{Games}}}.
+
    -->[[The Flog episode {{#var:flogEpNum}}]]<!--
     |
+
  -->|<!-- (else if Co-Optitude episode)
      {{#vardefine:coopEpNum|{{#expr:1 * {{{EpNum}}} }} }}
+
    -->{{#vardefine:coopEpNum|{{#expr:1 * {{{EpNum}}} }} }}<!--
       On this day in {{#var:airYear}}, [[Episode {{#var:coopEpNum}}]] aired featuring games {{{Games}}}.
+
    -->[[Episode {{#var:coopEpNum}}|Co-Optitude episode {{#var:coopEpNum}}]]<!--
     }}
+
  -->}}<!--
   </div>
+
  --> aired featuring <!--
}})</includeonly>
+
  -->{{#if:{{#explode:{{{Games}}}|;|2}}|<!-- (if 3 games)
 +
    -->'''{{#explode:{{{Games}}}|;|0}}''', '''{{#explode:{{{Games}}}|;|1}}''', and '''{{#explode:{{{Games}}}|;|2}}'''.
 +
<!--
 +
     -->|<!-- (else)
 +
    -->{{#if:{{#explode:{{{Games}}}|;|1}}|<!-- (if 2 games)
 +
       -->'''{{#explode:{{{Games}}}|;|0}}''' and '''{{#explode:{{{Games}}}|;|1}}'''.
 +
<!--
 +
      (else 1 game) -->|'''{{{Games}}}'''.
 +
<!--
 +
     -->}}<!--
 +
   -->}}<!--
 +
-->}}</includeonly>

Latest revision as of 11:05, 27 April 2020

Shows an "on this day" block for an episode if today is its air date. Sub-template of Template:On this day which uses one of these for each anniversary of note.

Usage:

{{On this day if|AirDate=2013-02-18|EpNum=F43|Games=Mortal Kombat; Shaq Fu}}
  • EpNum is a 3-character episode number, like 003 for a Co-Optitude episode or F43 for a Flog episode