Difference between revisions of "OnThisDayRelease/Cargo"
From Sega Retro
Line 1: | Line 1: | ||
− | {{#vardefine: | + | <div style="display:none;"> |
− | * | + | <!-- variable set-up and debugging --> |
− | *'''{{# | + | *go: (PREVIOUS: {{#var:prevname}} {{!}} {{#var:prevconsole}} {{!}} {{#var:prevregion}} {{!}} {{#var:prevyear}}) |
− | }}<noinclude>[[Category:Cargo templates]]</noinclude> | + | **name: {{#vardefine:name|{{{1|}}}}} {{#var:name}} |
+ | **type: {{#vardefine:type|{{{2|}}}}} {{#var:type}} | ||
+ | **console: {{#vardefine:console|{{{3|}}}}} {{#var:console}} | ||
+ | **region: {{#vardefine:region|{{{4|}}}}} {{#var:region}} | ||
+ | **date: {{#vardefine:date|{{{5|}}}}} {{#var:date}} | ||
+ | **year: {{#vardefine:year|{{#sub:{{{5|}}}|0|4)}}}} {{#var:year}} | ||
+ | **localname: {{#vardefine:localname|{{GetLocalisedName|{{FormatSQL|{{{1|}}}}}|{{{4|}}}}}}} {{#var:localname}} | ||
+ | **link: {{#vardefine:link|{{UnformatSQL|{{{1|}}}}}}} {{#var:link}} | ||
+ | **displayname: {{#vardefine:displayname|{{UnformatSQL|{{#if:{{#var:localname}}|{{#var:localname}}|{{#explode:{{#var:name}}|(|0}}}}}}}} {{#var:displayname}} | ||
+ | |||
+ | |||
+ | <!--We are iterating through things released on this day | ||
+ | check to see if the previous year/console/region is the same, so we can combine results and reduce bullet points --> | ||
+ | {{ | ||
+ | #if:{{#var:name}}|{{ | ||
+ | #ifeq:{{#var:year}}|{{#var:prevyear}}|{{ | ||
+ | #ifeq:{{#var:console}}|{{#var:prevconsole}}|{{ | ||
+ | #ifeq:{{#var:region}}|{{#var:prevregion}} | ||
+ | |{{#vardefine:currentresult|, }} | ||
+ | |{{#vardefine:currentresult|{{#if:{{#var:prevconsole}}{{#var:prevregion}}| {{OnThisDayReleaseFormatBrackets|{{#var:prevtype|}}|{{#var:prevconsole}}|{{#var:prevregion}}}} | ||
+ | }} | ||
+ | *<!--NEW REGION-->'''{{#var:year}}:''' }} | ||
+ | }} | ||
+ | |||
+ | |{{#vardefine:currentresult|{{#if:{{#var:prevconsole}}{{#var:prevregion}}| {{OnThisDayReleaseFormatBrackets|{{#var:prevtype|}}|{{#var:prevconsole}}|{{#var:prevregion}}}} | ||
+ | }} | ||
+ | *<!--NEW CONSOLE-->'''{{#var:year}}:''' }} | ||
+ | }} | ||
+ | |||
+ | |{{#vardefine:currentresult|{{#if:{{#var:prevconsole}}{{#var:prevregion}}| {{OnThisDayReleaseFormatBrackets|{{#var:prevtype|}}|{{#var:prevconsole}}|{{#var:prevregion}}}} | ||
+ | }} | ||
+ | *<!--NEW YEAR-->'''{{#var:year}}:''' }} | ||
+ | }} | ||
+ | |||
+ | {{#switch:{{#var:type}} | ||
+ | |1={{#vardefine:currentresult|{{#var:currentresult}} [[{{#var:link}}|{{#var:displayname}}]]}} | ||
+ | |2={{#vardefine:currentresult|{{#var:currentresult}} '''[[{{#var:link}}|{{#var:displayname}}]]'''}} | ||
+ | |#default={{#vardefine:currentresult|{{#var:currentresult}} ''[[{{#var:link}}|{{#var:displayname}}]]''}} | ||
+ | }} | ||
+ | |||
+ | <!-- update result, reset variables | ||
+ | note: because this template doesn't know when we're on the last row, the last result will be finished by template:OnThisDay | ||
+ | --> | ||
+ | {{ | ||
+ | #vardefine:result|{{#var:result}}{{#var:currentresult}}}}{{clearvar|currentresult}}}}{{ | ||
+ | #vardefine:prevname|{{#var:name}}}}{{ | ||
+ | #vardefine:prevconsole|{{#var:console}}}}{{ | ||
+ | #vardefine:prevregion|{{#var:region}}}}{{ | ||
+ | #vardefine:prevyear|{{#var:year}}}} | ||
+ | </div><noinclude><!--{{OnThisDayRelease}}--> | ||
+ | |||
+ | [[Category:Cargo templates]]</noinclude> |