Difference between revisions of "MagazineName"

From Sega Retro

m (Protected "Template:MagazineName": High-traffic template ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<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.
+
<includeonly>{{#ifeq: {{{nomagname|}}} | yes || {{#cargo_query:
 +
tables=magnames
 +
|fields=code,name,link,country
 +
|where=code="{{{1|}}}"
 +
|default=
 +
|format=template
 +
|template=MagazineName/Name
 +
}}}}{{clearvar|mname|mnum|mdate}}{{#if: {{{2|}}} | {{#cargo_query:
 +
tables=issuenames
 +
|fields=num,name,date,code
 +
|where=code="{{{1|}}}" AND num="{{{2|}}}"
 +
|default=
 +
|format=template
 +
|template=MagazineName/Issue
 +
}}}}{{#ifeq:{{#var:mname}}|{{#var:mnum}}|{{clearvar|mname}}}} {{
 +
#if: {{#var:mname}}
 +
| {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}: "{{#var:mname}}"}}
 +
| {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}}}
 +
}}{{#if:{{#var:mnum}}{{#var:mnum}}{{#var:mdate}}|{{#if: {{{2|}}} | {{#ifeq:{{{noissuename|}}}|yes||{{#var:mnamefull}}{{#vardefine:mdate|({{#var:mdate}})}}}} {{#ifeq:{{{nopubdate|}}}|yes|| {{#var:mdate}}}} }}|}}{{clearvar|mname|mnum|mdate}}</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.
  
 
==Use==
 
==Use==
<pre>
+
{|
{{MagazineName|<name>|<issueno>|dateonly=}}
+
|<pre>{{MagazineName|<name>|<issueno>|nomagname=|noissuename=|nopubdate=}}</pre>
</pre>
+
|}
If "dateonly" is set to yes, only the release date will be returned.
+
By default this returns a long string - parts can be omitted using the |no(x) fields.
  
==Example==
+
==Examples==
<pre>{{MagazineName|dmuk|12}}</pre>
+
{|class="prettytable"
 +
! Code || Result
 +
|-
 +
| <pre>{{MagazineName|dmuk}}</pre>
 +
| {{MagazineName|dmuk}}
 +
|-
 +
|<pre>{{MagazineName|dmuk|12}}</pre>
 +
| {{MagazineName|dmuk|12}}
 +
|-
 +
|<pre>{{MagazineName|dmuk|12|nomagname=yes}}</pre>
 +
| {{MagazineName|dmuk|12|nomagname=yes}}
 +
|-
 +
|<pre>{{MagazineName|dmuk|12|noissuename=yes}}</pre>
 +
| {{MagazineName|dmuk|12|noissuename=yes}}
 +
|-
 +
|<pre>{{MagazineName|dmuk|12|nopubdate=yes}}</pre>
 +
| {{MagazineName|dmuk|12|nopubdate=yes}}
 +
|-
 +
|<pre>{{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}}</pre>
 +
| {{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}}
 +
|-
 +
|<pre>{{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}}</pre>
 +
| {{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}}
 +
|-
 +
|<pre>{{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}}</pre>
 +
| {{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}}
 +
|-
 +
|<pre>{{MagazineName|bums|12}}</pre>
 +
| {{MagazineName|bums|12}}
 +
|}
  
Gives
+
[[Category:Magazine templates]]</noinclude>
{{MagazineName|dmuk|12}}
 
 
 
<pre>{{MagazineName|dmuk|12|dateonly=yes}}</pre>
 
 
 
Gives
 
{{MagazineName|dmuk|12|dateonly=yes}}
 
</noinclude><includeonly><div style="display:none;">
 
{{#vardefine:name|{{{1}}}}}{{#vardefine:issueNo|{{{2}}}}}
 
 
 
{{#vardefine:fullname|}}
 
{{#switch: {{#var:name}}
 
| dmuk={{#vardefine:fullname|[[Dreamcast Magazine (UK)|Dreamcast Magazine]]
 
{{#switch: {{#var:issueNo}}
 
|1|={{#vardefine:fulldate|<nowiki>#</nowiki>1 (1999-09)}}
 
|2|={{#vardefine:fulldate|<nowiki>#</nowiki>2 (1999-10-21)}}
 
|3|={{#vardefine:fulldate|<nowiki>#</nowiki>3 (1999-11-25)}}
 
|4|={{#vardefine:fulldate|<nowiki>#</nowiki>4 (1999-12-23)}}
 
|5|={{#vardefine:fulldate|<nowiki>#</nowiki>5 (2000-01-27)}}
 
|6|={{#vardefine:fulldate|<nowiki>#</nowiki>6 (2000-02-24)}}
 
|7|={{#vardefine:fulldate|<nowiki>#</nowiki>7 (2000-03-23)}}
 
|8|={{#vardefine:fulldate|<nowiki>#</nowiki>8 (2000-04-28)}}
 
|9|={{#vardefine:fulldate|<nowiki>#</nowiki>9 (2000-05-18)}}
 
|10|={{#vardefine:fulldate|<nowiki>#</nowiki>10 (2000-06-15)}}
 
|11|={{#vardefine:fulldate|<nowiki>#</nowiki>11 (2000-07-xx)}}
 
|12|={{#vardefine:fulldate|<nowiki>#</nowiki>12 (2000-08-10)}}
 
|13|={{#vardefine:fulldate|<nowiki>#</nowiki>13 (2000-09-07)}}
 
|14|={{#vardefine:fulldate|<nowiki>#</nowiki>14 (2000-10-05)}}
 
|15|={{#vardefine:fulldate|<nowiki>#</nowiki>15 (200x-xx-xx)}}
 
|16|={{#vardefine:fulldate|<nowiki>#</nowiki>16 (200x-xx-xx)}}
 
|17|={{#vardefine:fulldate|<nowiki>#</nowiki>17 (200x-xx-xx)}}
 
|18|={{#vardefine:fulldate|<nowiki>#</nowiki>18 (200x-xx-xx)}}
 
|19|={{#vardefine:fulldate|<nowiki>#</nowiki>19 (200x-xx-xx)}}
 
|20|={{#vardefine:fulldate|<nowiki>#</nowiki>20 (200x-xx-xx)}}
 
|21|={{#vardefine:fulldate|<nowiki>#</nowiki>21 (200x-xx-xx)}}
 
|22|={{#vardefine:fulldate|<nowiki>#</nowiki>22 (200x-xx-xx)}}
 
|23|={{#vardefine:fulldate|<nowiki>#</nowiki>23 (200x-xx-xx)}}
 
|24|={{#vardefine:fulldate|<nowiki>#</nowiki>24 (200x-xx-xx)}}
 
|25|={{#vardefine:fulldate|<nowiki>#</nowiki>25 (200x-xx-xx)}}
 
|26|={{#vardefine:fulldate|<nowiki>#</nowiki>26 (200x-xx-xx)}}
 
|27|={{#vardefine:fulldate|<nowiki>#</nowiki>27 (200x-xx-xx)}}
 
|28|={{#vardefine:fulldate|<nowiki>#</nowiki>28 (200x-xx-xx)}}
 
|29|={{#vardefine:fulldate|<nowiki>#</nowiki>29 (200x-xx-xx)}}
 
|30|={{#vardefine:fulldate|<nowiki>#</nowiki>30 (2001-12-27)}}
 
|31|={{#vardefine:fulldate|<nowiki>#</nowiki>31 (2002-01-31)}}
 
|32|={{#vardefine:fulldate|<nowiki>#</nowiki>32 (2002-02-28)}}
 
|33|={{#vardefine:fulldate|<nowiki>#</nowiki>33 (2002-03-28)}}
 
|34|={{#vardefine:fulldate|<nowiki>#</nowiki>34 (2002-04-25)}}
 
}}
 
|#default=
 
}}</div>{{#ifeq:{{{dateonly}}}|yes||{{#var:fullname}}}} {{#var:fulldate}}</includeonly>
 

Latest revision as of 18:34, 7 November 2020

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

Code Result
{{MagazineName|dmuk}}
Dreamcast Magazine (UK)
{{MagazineName|dmuk|12}}
Dreamcast Magazine (UK) #12: "No. 12" (2000-08-10)
{{MagazineName|dmuk|12|nomagname=yes}}
#12: "No. 12" (2000-08-10)
{{MagazineName|dmuk|12|noissuename=yes}}
Dreamcast Magazine (UK) 2000-08-10
{{MagazineName|dmuk|12|nopubdate=yes}}
Dreamcast Magazine (UK) #12: "No. 12"
{{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}}
#12: "No. 12"
{{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}}
2000-08-10
{{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}}
Dreamcast Magazine (UK)
{{MagazineName|bums|12}}