Difference between revisions of "MagazineName"

From Sega Retro

(seems to work as intended)
Line 1: Line 1:
<includeonly><div style="display:none;">{{#vardefine:name|{{{1}}}}}{{#vardefine:issueno|{{{2}}}}}{{#vardefine:magname|}}{{
+
<includeonly>{{#ifeq: {{{nomagname|}}} | yes || {{#cargo_query:
#ifeq:{{#var: magname}}||{{MagazineNameUK}}{{
+
tables=magnames
#ifeq:{{#var: magname}}||{{MagazineNameUS}}{{
+
|fields=code,name,link,country
#ifeq:{{#var: magname}}||{{MagazineNameJP}}{{
+
|where=code="{{{1|}}}"
#ifeq:{{#var: magname}}||{{MagazineNameFR}}{{
+
|format=template
#ifeq:{{#var: magname}}||{{MagazineNameDE}}{{
+
|template=MagazineName/Name
#ifeq:{{#var: magname}}||{{MagazineNameES}}{{
+
}}}}{{clearvar|mname|mnum|mdate}}{{#if: {{{2|}}} | {{#cargo_query:
#ifeq:{{#var: magname}}||{{MagazineNameIT}}{{
+
tables=issuenames
#ifeq:{{#var: magname}}||{{MagazineNameAU}}{{
+
|fields=num,name,date,code
#ifeq:{{#var: magname}}||{{MagazineNameBR}}{{
+
|where=code="{{{1|}}}" AND num="{{{2|}}}"
#ifeq:{{#var: magname}}||{{MagazineNameAR}}{{
+
|format=template
#ifeq:{{#var: magname}}||{{MagazineNameNL}}{{
+
|template=MagazineName/Issue
#ifeq:{{#var: magname}}||{{MagazineNamePT}}{{
+
}}}}{{#ifeq:{{#var:mname}}|{{#var:mnum}}|{{clearvar|mname}}}}
#ifeq:{{#var: magname}}||{{MagazineNameGR}}{{
+
{{#if: {{#var:mname}}  
#ifeq:{{#var: magname}}||{{MagazineNameDK}}{{
+
| {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}: "{{#var:mname}}"}}  
#ifeq:{{#var: magname}}||{{MagazineNameSE}}{{
+
| {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}}}  
#ifeq:{{#var: magname}}||{{MagazineNamePL}}{{
+
}}{{#if: {{{2|}}} | {{#ifeq:{{{noissuename|}}}|yes||{{#var:mnamefull}}{{#vardefine:mdate|({{#var:mdate}})}}}} {{#ifeq:{{{nopubdate|}}}|yes|| {{#var:mdate}}}} }}</includeonly><noinclude>
#ifeq:{{#var: magname}}||{{MagazineNameAT}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameFI}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameCZ}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameNZ}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameKR}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameTW}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameTH}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameRU}}{{
 
#ifeq:{{#var: magname}}||{{MagazineNameHU}}{{
 
#ifeq:{{#var: magname}}||{{TVName}}{{
 
#ifeq:{{#var: magname}}||{{OnlineRatingTest|{{#var: name}}}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}|}}</div>{{
 
#ifeq:{{{nomagname}}}|yes||{{#var:magname}}}} {{#ifeq:{{{noissuename}}}|yes||{{#var:issuename}}}} {{#ifeq:{{{nopubdate}}}|yes||{{#ifeq:{{{noissuename}}}|yes||(}}{{#var:pubdate}}{{#ifeq:{{{noissuename}}}|yes||)}}}}{{#vardefine:magname||}}{{#vardefine:issuename||}}{{#vardefine:pubdate||}}</includeonly><noinclude>
 
 
This template generates a full name for a magazine, given a name and an issue number (either a number or a date). This saves having to look up precise release dates of magazines, and should greatly speed up the creation of lists of articles.
 
This template generates a full name for a magazine, given a name and an issue number (either a number or a date). This saves having to look up precise release dates of magazines, and should greatly speed up the creation of lists of articles.
  
Line 37: Line 25:
  
 
==Examples==
 
==Examples==
 +
{|
 +
|<pre>{{MagazineName|dmuk}}</pre>
 +
|}
 +
Returns {{MagazineName|dmuk}}
 +
 +
 
{|
 
{|
 
|<pre>{{MagazineName|dmuk|12}}</pre>
 
|<pre>{{MagazineName|dmuk|12}}</pre>

Revision as of 21:20, 4 July 2018

This template generates a full name for a magazine, given a name and an issue number (either a number or a date). This saves having to look up precise release dates of magazines, and should greatly speed up the creation of lists of articles.

Use

{{MagazineName|<name>|<issueno>|nomagname=|noissuename=|nopubdate=}}

By default this returns a long string - parts can be omitted using the |no(x) fields.

Examples

{{MagazineName|dmuk}}

Returns Dreamcast Magazine (UK)


{{MagazineName|dmuk|12}}

Returns Dreamcast Magazine (UK) #12: "No. 12" (2000-08-10)


{{MagazineName|dmuk|12|nomagname=yes}}

Returns #12: "No. 12" (2000-08-10)


{{MagazineName|dmuk|12|noissuename=yes}}

Returns Dreamcast Magazine (UK) 2000-08-10


{{MagazineName|dmuk|12|nopubdate=yes}}

Returns Dreamcast Magazine (UK) #12: "No. 12"


{{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}}

Returns #12: "No. 12"


{{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}}

Returns 2000-08-10

{{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}}

Returns Dreamcast Magazine (UK)