Permanently protected template

Difference between revisions of "Template:Card table anime and manga appearances"

From Yugipedia
Jump to: navigation, search
(switch this over to accepting comma-delimited input (no point in waiting, really); add tracking categories for extra and extra2 since these should probably be handled by other params in CardTable2)
(store the earliest date from all "card table anime and manga appearances" on a page in the $debut_date variable.)
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{IfSemantics
+
<!--
| {{
+
-->{{ #vardefine: $ctaama-type | {{ #ifeq: {{{type}}} | Episode | episode | chapter }} }}<!--
    #arraymap: {{ #replace: {{{1}}} | / | , }} | , | $x$ | [[Yu-Gi-Oh! {{ #if: {{{series|}}} | {{{series}}} }} - {{{type}}} {{padleft:$x$|3|0}}|{{padleft:$x$|3|0}}]]
+
-->{{ #vardefine: $ctaama-series | Yu-Gi-Oh! {{{series|}}} }}<!--
 +
-->{{ #arraydefine: @ctaama-episodes | {{{1|}}} | , }}{{ #arrayunique: @ctaama-episodes }}{{ #arrayprint: @ctaama-episodes
 +
| ,&#32;
 +
| $episode
 +
| [[{{ #ifexpr: {{ #len: $episode }} < 4 | Yu-Gi-Oh! {{{series|}}} - {{{type}}} }} $episode|$episode]]{{IfSemantics
 +
  | {{ #set: {{ #var: $ctaama-series }} {{ #var: $ctaama-type }} appearances (linked) | [[{{ #ifexpr: {{ #len: $episode }} < 4 | Yu-Gi-Oh! {{{series|}}} - {{{type}}} }} $episode|$episode]] }}[[{{ #var: $ctaama-series }} {{ #var: $ctaama-type }} appearances::$episode| ]]
 
   }}
 
   }}
| {{
+
}}<!--
    #ifexpr: {{ #len: {{{1}}} }} * 35 < 1000
+
 
    | [[Yu-Gi-Oh! {{ #if: {{{series|}}} | {{{series}}} }} - {{{type}}} {{
+
** Get the earlier date of all appearances **
      #replace: {{
+
 
        #replace: {{
+
# Get the first item in the list
          #replace: {{
+
-->{{ #vardefine: $ctaama-first | {{ #explode: {{{1}}} | , }} }}<!--
            #sub: {{ #replace: {{{1}}} | / | , }}
+
# Get its page
            | 0 | {{ #pos: {{ #replace: {{{1}}} | / | , }} | ,, }}
+
-->{{ #vardefine: $ctaama-first-page
          }}
+
| {{ #ifexpr: {{ #len: {{ #var: $ctaama-first }} }} < 4
          | , | @], [$Yu-Gi-Oh! {{ #if: {{{series|}}} | {{{series}}} }} - {{{type}}}&#32;
+
  | {{trim|Yu-Gi-Oh! {{{series|}}}}} - {{{type}}} {{ #var: $ctaama-first }}
        }}
+
  | {{ #var: $ctaama-first }}
        | $ | [
+
  }}
 +
}}<!--
 +
# Get its release date
 +
-->{{ #vardefine: $ctaama-first-date
 +
| {{ #show: {{ #var: $ctaama-first-page }}
 +
  |?{{ #ifeq: {{{series}}} | Capsule Monsters
 +
    | English air date
 +
    | {{ #ifeq: {{ #var: $ctaama-type }} | episode
 +
      | Japanese air date
 +
      | Japanese release date
 
       }}
 
       }}
      | @ | ]
+
    }}#ISO
    }}]]
+
  }}
    | {{ #replace: {{{1}}} | / | ,&#32; }}
+
}}<!--
 +
# If there is no previously-declared debut date, set this as the debut date
 +
-->{{ #vardefine: $debut_date | {{ #var: $debut_date | {{ #var: $ctaama-first-date | unknown }} }} }}<!--
 +
# Otherwise compare the two dates to see which came first. If previously-declared debut date is unknown, we can't compare.
 +
-->{{ #ifeq: {{ #var: $debut_date }} | unknown
 +
|
 +
|  {{ #ifexpr: {{ #time: U | {{ #var: $ctaama-first-date }} }} < {{ #time: U | {{ #var: $debut_date }} }}
 +
  | {{ #vardefine: $debut_date | {{ #var: $ctaama-first-date }} }}
 
   }}
 
   }}
}}{{
+
}}<!--
  #if: {{{extra|}}} | , {{{extra}}}[[Category:Anime and manga appearances transclusions using extra|{{PAGENAME}}{{NAMESPACE}}]]
+
 
}}{{
+
--><noinclude>
  #if: {{{extra2|}}} | , {{{extra2}}}[[Category:Anime and manga appearances transclusions using extra2|{{PAGENAME}}{{NAMESPACE}}]]
 
}}<noinclude>
 
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 22:31, 1 December 2019