User:TheOriginalOne/Countdown: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (Missing brace - fix for broken link)
(just not requesting deletion because it may be useful someday)
 
Line 1: Line 1:
<!--It still isn't completely safe to use a duration of 0, as after the event happens the template will be broken. Also gotta add the minutes and seconds. But as the primary problem, there's the fact that the template gets cached-->
{|width="100%" style="background: #{{{1|{{bulba color}}}}}; {{roundy|10px}}"
{{#ifeq:{{#expr: {{#time:U}} < {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}}}}|1|There are {{#ifeq:{{#expr: {{#time:U}} < {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - 86399}}|1|{{#expr:( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}) / 86400 ) -0.5) round 0}} days|}} and {{#ifeq:{{#expr: {{#time:U}} > {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - 3600}}|1|{{#ifeq: {{#expr: ( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}} ) / 60 ) - 0.5 ) round 0 }}|0|{{#expr: {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}}} seconds |{{#expr: ( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}} ) / 60 ) - 0.5 ) round 0 }} minutes}} |{{#expr:{{#expr: ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}} ) / 3600 - ( ( ( ( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}) / 86400 ) - 0.5 ) round 0 )* 24 ) -0.5 ) round 0}} - 1}} hours}} left to {{{event|the event}}}.|{{#ifexist:{{{duration|}}}|{{#ifeq:{{#expr: ({{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} + {{{duration}}}) > {{#time:U}}}}|1|{{{eventstart|{{{event|The event}}} has already started.}}}|{{{eventend|{{{event|the event.}}} has already ended}}}}}|{{{eventend|{{{event|The event}}} has already ended.}}}}}}}<small>({{refresh}})</small>
|- style="text-align: center;"
<noinclude>
| Check [http://bulbapedia.bulbagarden.net/w/index.php?title=User:TheOriginalOne/Countdown&action=history the history] if you're curious about what this used to be.
----
|}
'''WARNING:''' Do not edit the below examples if you see the time is incorrect. On that case, purge the cache.
 
This one is tricky:
 
Typing
<pre>
{{User:TheOriginalOne/Countdown
|year      = 2013
|month      = 10
|day        = 12
|hour      = 0
|minute    = 0
|event      = the worldwide release of [[Pokémon X and Y]]
|duration  = 0
}}
</pre>
will get you this:
 
{{User:TheOriginalOne/Countdown
|year      = 2013
|month      = 10
|day        = 12
|hour      = 0
|minute    = 0
|event      = the worldwide release of [[Pokémon X and Y]]
|duration  = 0
}}
 
 
But now pay attention:
 
If you want to refer to an event with a duration:
 
<pre>
{{User:TheOriginalOne/Countdown
|year      = 2013
|month      = 10
|day        = 12
|hour      = 0
|minute    = 0
|event      = the day of the worldwide release of [[Pokémon X and Y]]
|duration  = 86400
}}
</pre>
→{{User:TheOriginalOne/Countdown
|year      = 2013
|month      = 10
|day        = 12
|hour      = 0
|minute    = 0
|event      = the day of the worldwide release of [[Pokémon X and Y]]
|duration  = 86400
}}
 
Have you noticed? I'm referring to a day (24 hours) with 86400. So make sure to make {{wp|Cross-multiplication#Rule_of_Three|the conversion to that new base}}.
</noinclude>

Latest revision as of 23:59, 30 November 2013

Check the history if you're curious about what this used to be.