Module:File
From Wario Speedrunning Wiki
File is the primary image template Wario Speedrunning uses to provide information on its File pages. This template does a lot to help organize files on your behalf, instead of you having to manually write a lot of things on your own. An example of the empty aboutfile template (which appears automatically in the summary box when uploading a new file) is as follows:
{{File |game= |description= |type= |meta= |user= |source= |license= }}
Now, when filling out these parameters, you will almost certainly not need all of them, and many should be deleted when going through the template upon uploading. Let's look at each parameter and what they mean, and how each should be filled out.
- |description=: This parameter is for writing a summary of what the file contains. A file description should be concise, requiring no more than one sentence to explain. For example, a piece of artwork of Wario from Wario Land 3 could simply be described as "Artwork of Wario from Wario Land 3."
- |game=: This parameter is simple: Enter the name of the game or mode you are covering! Only one can be entered at a time, and files spanning multiple games should use the earliest chronological use. Enter the name exactly as displayed—the file will automatically link it for you!
- |type= and |meta=: This parameter covers a lot of things at once. Primarily, this parameter is to indicate what type of file it is! The list of types is the following:
- animated (Animated image)
- artwork (Artwork)
- audio (Audio)
- boxart (Box artwork)
- control (Controller button)
- diagram (Diagram)
- flag (Flag)
- icon (Icon)
- logo (Logo)
- main (Game image)
- mainimage (Game image)
- map (Map)
- miiverse (Miiverse post)
- model (Model)
- music (Music)
- person (Real life person)
- photo (Real-world photo)
- promotional (Promotional image)
- rating (Rating icon)
- render (Render)
- scan (Scan)
- screenshot (Screenshot)
- sprite (Sprite)
- system (Console images)
- template (Template image)
- texture (Texture)
- titlescreen (Title screen)
- user (User image)
- video (Video)
- wallpaper (Wallpaper)
- wiki (Wario Speedrunning Wiki image)
- Filling out this section is vital to help set up the automatic categorization. For all files that use |type=, they will be added into the entered game='s category. As an example, something with a |game=Wario Land 3 and a |type=screenshot, the file will automatically be added to
Category:Wario Land 3 screenshots
. Up to four types can be used and should be separated with a comma. The |meta= category works similarly, only that the types entered here will not look at the game for its category. For example, an image of a Nintendo Switch that needs to go with other systems will use |meta=System and be added intoCategory:System images
. Files with no entered type will be added to a maintenance category.
- |source=: This is a very important parameter. If you have a file that wasn't directly taken by yourself, it needs to be written or linked here. If you captured the file yourself, use |source=self. For images captured by other people, use |source=user and fill in the next parameter below.
- |user=: This parameter is unlikely to be used. It should only be filled with the name of the user for people that use |source=user or |type=user. For example, if SoapAgent was the source of an image, you would enter |source=user and user=SoapAgent.
- |license=: This parameter is unlikely to be used. It is automatically filled in as fair use by default, and can usually be deleted. The only reason this parameter should be filled out is if a file should be licensed in any way other than fair use, such as public domain, creative commons, or something else. The options for this template are the following:
- ccbysa10 (CC BY-SA 1.0)
- ccby20 (CC BY 2.0)
- ccbysa21jp (CC BY-SA 2.1)
- ccby25 (CC BY 2.5)
- ccbysa25 (CC BY-SA 2.5)
- ccby30 (CC BY 3.0)
- ccbync30 (CC BY-NC 3.0)
- ccbyncsa30 (CC BY-NC-SA 3.0)
- ccbysa30 (CC BY-SA 3.0)
- ccby40 (CC BY 4.0)
- ccbysa40 (CC BY-SA 4.0)
- lgpl (LGPL)
- pd (Public domain, for someone else's work)
- pds (Public domain, if you release it)
- fairuse (Fair use)
- There is an additional parameter, |resized=, where if set to |resized=yes, will add the file to Category:Resized files.
local f = {}
function f.main(frame)
local result = {}
local game = frame:getParent().args["game"] or ""
local description = frame:getParent().args["description"] or ""
local type = mw.ustring.lower(frame:getParent().args["type"] or "")
local meta = mw.ustring.lower(frame:getParent().args["meta"] or "")
local user = frame:getParent().args["user"] or ""
local source = frame:getParent().args["source"] or nil
local license = frame:getParent().args["license"] or nil
local resized = frame:getParent().args["resized"] or nil
local youtube = frame:getParent().args["youtube"] or nil
local fandom = frame:getParent().args["fandom"] or nil
function TEXT(X)
local artwork = "Artwork"
local audio = "Audio"
local animated = "Animated image"
local music = "Music"
local boxart = "Box artwork"
local control = "Controller button"
local css = "<span style='color: red'>This image is used within the site's [[MediaWiki:Common.css|CSS stylesheet]]. This file should not be moved or modified without first checking how it will affect the CSS.</span>"
local diagram = "Diagram"
local favicon = "Favicon"
local flag = "Flag"
local icon = "Icon"
local logo = "Logo"
local map = "Map"
local miiverse = "Miiverse post"
local model = "Model"
local promotional = "Promotional image"
local photo = "Real-world photo"
local person = "Real life person"
local rating = "Rating icon"
local render = "Render"
local texture = "Texture"
local scan = "Scan"
local screenshot = "Screenshot"
local sprite = "Sprite"
local system = "Console images"
local titlescreen = "Title screen"
local user = "This file is a personal file belonging to [[User:".. user .."|".. user .."]]."
local template = "Template image"
local video = "Video"
local wallpaper = "Wallpaper"
local wiki = "Wiki image"
local main = "Game image"
local mainimage = "Game image"
local none = "<span style='color: red'>Error: Invalid type entered, please</span> [[Module:File/doc|consult the list of types]]."
local t = {}
t = {
['2d'] = artwork,
['2dart'] = artwork,
['2d art'] = artwork,
['2d artwork'] = artwork,
['art'] = artwork,
['artwork'] = artwork,
['art work'] = artwork,
['3d'] = render,
['3dart'] = render,
['3d art'] = render,
['3d artwork'] = render,
['render'] = render,
['rendering'] = render,
['anim'] = animated,
['animated'] = animated,
['animation'] = animated,
['animated image'] = animated,
['animated images'] = animated,
['animated img'] = animated,
['gif'] = animated,
['music'] = music,
['song'] = music,
['songs'] = music,
['audio'] = audio,
['sound'] = audio,
['voice clip'] = audio,
['voice'] = audio,
['flag'] = flag,
['box'] = boxart,
['boxart'] = boxart,
['boxartwork'] = boxart,
['box art'] = boxart,
['box artwork'] = boxart,
['button'] = control,
['buttons'] = control,
['control'] = control,
['controller'] = control,
['controller button'] = control,
['joystick'] = control,
['css'] = css,
['site styling'] = css,
['sitestyling'] = css,
['diagram'] = diagram,
['graph'] = diagram,
['graphs'] = diagram,
['chart'] = diagram,
['ico'] = icon,
['icon'] = icon,
['icons'] = icon,
['logo'] = logo,
['logomark'] = logo,
['logos'] = logo,
['logotype'] = logo,
['wordmark'] = logo,
['map'] = map,
['maps'] = map,
['miiverse'] = miiverse,
['main'] = main,
['mainimage'] = mainimage,
['mainimages'] = mainimage,
['3dmodel'] = model,
['3d model'] = model,
['model'] = model,
['models'] = model,
['nsicon'] = nsicon,
['nsoicon'] = nsicon,
['nsoiconpart'] = nsicon,
['nso icon'] = nsicon,
['nso icon part'] = nsicon,
['nintendo switch online icon'] = nsicon,
['nintendo switch online icon part'] = nsicon,
['photo'] = photo,
['photos'] = photo,
['photography'] = photo,
['reallife'] = photo,
['real life'] = photo,
['prerelease'] = prerelease,
['pre-release'] = prerelease,
['p-r'] = prerelease,
['beta'] = prerelease,
['person'] = person,
['real person'] = person,
['human person'] = person,
['people'] = person,
['real people'] = person,
['rating'] = rating,
['ratings'] = rating,
['prtscr'] = screenshot,
['printscreen'] = screenshot,
['print screen'] = screenshot,
['scr'] = screenshot,
['screen'] = screenshot,
['screenshot'] = screenshot,
['scrshot'] = screenshot,
['screen shot'] = screenshot,
['language'] = language,
['lang'] = language,
['pixelart'] = sprite,
['pixel art'] = sprite,
['sprite'] = sprite,
['sprites'] = sprite,
['sys'] = system,
['system'] = system,
['system image'] = system,
['system images'] = system,
['console'] = system,
['switch'] = system,
['gameboy'] = system,
['gba'] = system,
['scan'] = scan,
['scanned'] = scan,
['scans'] = scan,
['template'] = template,
['texture'] = texture,
['titlescreen'] = titlescreen,
['title screen'] = titlescreen,
['title'] = titlescreen,
['personal'] = user,
['personal img'] = user,
['personal image'] = user,
['user'] = user,
['userimg'] = user,
['user image'] = user,
['video'] = video,
['videos'] = video,
['wario speedrunning'] = wiki,
['wiki'] = wiki,
['wallpaper'] = wallpaper,
['wall paper'] = wallpaper,
['screensaver'] = wallpaper,
['background'] = wallpaper,
}
if not t[X]
then return none
else return t[X]
end
end
function CAT(X,Y)
if Y == true then Y = game .. ' ' else Y = "" end
local artwork = "[[Category:".. Y .."artwork]]"
local animated = "[[Category:".. Y .."animated images]]"
local music = "[[Category:".. Y .."music]]"
local audio = "[[Category:".. Y .."audio]]"
local boxart = "[[Category:".. Y .."box artwork]]"
local control = "[[Category:".. Y .."controller icons]]"
local css = "[[Category:Images used in site styling]]"
local diagram = "[[Category:".. Y .."diagrams]]"
local icon = "[[Category:".. Y .."icons]]"
local favicon = "[[Category:Favicons]]"
local flag = "[[Category:".. Y .."flags]]"
local logo = "[[Category:".. Y .."logos]]"
local main = "[[Category:".. Y .."]]"
local mainimage = "[[Category:".. Y .."images]]"
local miiverse = "[[Category:".. Y .."Miiverse posts]]"
local map = "[[Category:".. Y .."maps]]"
local model = "[[Category:".. Y .."models]]"
local promotional = "[[Category:".. Y .."promotional images]]"
local photo = "[[Category:".. Y .."real life images]]"
local person = "[[Category:Real people]]"
local rating = "[[Category:".. Y .."rating icons]]"
local scan = "[[Category:".. Y .."scans]]"
local screenshot = "[[Category:".. Y .."screenshots]]"
local sprite = "[[Category:".. Y .."sprites]]"
local system = "[[Category:Consoles]]"
local render = "[[Category:".. Y .."renders]]"
local texture = "[[Category:".. Y .."textures]]"
local user = "[[Category:User files]]"
local template = "[[Category:".. Y .."Template images]]"
local titlescreen = "[[Category:".. Y .."title screens]]"
local video = "[[Category:".. Y .."videos]]"
local wiki = "[[Category:Wario Speedrunning Wiki images]]"
local wallpaper = "[[Category:".. Y .."wallpapers]]"
local none = "[[Category:Files with invalid types]]"
local t = {}
t = {
['2d'] = artwork,
['2dart'] = artwork,
['2d art'] = artwork,
['2d artwork'] = artwork,
['art'] = artwork,
['artwork'] = artwork,
['art work'] = artwork,
['3d'] = render,
['3dart'] = render,
['3d art'] = render,
['3d artwork'] = render,
['render'] = render,
['rendering'] = render,
['anim'] = animated,
['animated'] = animated,
['animation'] = animated,
['animated image'] = animated,
['animated images'] = animated,
['animated img'] = animated,
['gif'] = animated,
['music'] = music,
['song'] = music,
['songs'] = music,
['audio'] = audio,
['sound'] = audio,
['voice clip'] = audio,
['voice'] = audio,
['flag'] = flag,
['box'] = boxart,
['boxart'] = boxart,
['boxartwork'] = boxart,
['box art'] = boxart,
['box artwork'] = boxart,
['button'] = control,
['buttons'] = control,
['control'] = control,
['controller'] = control,
['controller button'] = control,
['joystick'] = control,
['css'] = css,
['site styling'] = css,
['sitestyling'] = css,
['diagram'] = diagram,
['graph'] = diagram,
['graphs'] = diagram,
['chart'] = diagram,
['ico'] = icon,
['icon'] = icon,
['icons'] = icon,
['logo'] = logo,
['logomark'] = logo,
['logos'] = logo,
['logotype'] = logo,
['wordmark'] = logo,
['map'] = map,
['maps'] = map,
['miiverse'] = miiverse,
['main'] = main,
['mainimage'] = mainimage,
['mainimages'] = mainimage,
['3dmodel'] = model,
['3d model'] = model,
['model'] = model,
['models'] = model,
['nsicon'] = nsicon,
['nsoicon'] = nsicon,
['nsoiconpart'] = nsicon,
['nso icon'] = nsicon,
['nso icon part'] = nsicon,
['nintendo switch online icon'] = nsicon,
['nintendo switch online icon part'] = nsicon,
['photo'] = photo,
['photos'] = photo,
['photography'] = photo,
['reallife'] = photo,
['real life'] = photo,
['prerelease'] = prerelease,
['pre-release'] = prerelease,
['p-r'] = prerelease,
['beta'] = prerelease,
['person'] = person,
['real person'] = person,
['human person'] = person,
['people'] = person,
['real people'] = person,
['rating'] = rating,
['ratings'] = rating,
['prtscr'] = screenshot,
['printscreen'] = screenshot,
['print screen'] = screenshot,
['scr'] = screenshot,
['screen'] = screenshot,
['screenshot'] = screenshot,
['scrshot'] = screenshot,
['screen shot'] = screenshot,
['language'] = language,
['lang'] = language,
['pixelart'] = sprite,
['pixel art'] = sprite,
['sprite'] = sprite,
['sprites'] = sprite,
['sys'] = system,
['system'] = system,
['system image'] = system,
['system images'] = system,
['console'] = system,
['switch'] = system,
['gameboy'] = system,
['gba'] = system,
['scan'] = scan,
['scanned'] = scan,
['scans'] = scan,
['template'] = template,
['texture'] = texture,
['titlescreen'] = titlescreen,
['title screen'] = titlescreen,
['title'] = titlescreen,
['personal'] = user,
['personal img'] = user,
['personal image'] = user,
['user'] = user,
['userimg'] = user,
['user image'] = user,
['video'] = video,
['videos'] = video,
['wario speedrunning'] = wiki,
['wiki'] = wiki,
['wallpaper'] = wallpaper,
['wall paper'] = wallpaper,
['screensaver'] = wallpaper,
['background'] = wallpaper,
}
if not t[X]
then return none
else return t[X]
end
end
function SRC(X)
local myself = "Media created or obtained by the uploader"
local user2 = "Media created or obtained by [[user:".. user .."|".. user .."]]"
local fandom = "FANDOM image [[Category:FANDOM sourced images]]"
local youtube = "YouTube image [[Category:YouTube sourced images]]"
local presskit = "Press kit image [[Category:Non-public press kit images]]"
local missing = "<span style='color: red'>''This file is missing a source.''</span>[[Category:Missing source]]"
local nintendomusic = "This file has been taken from [[Nintendo Music]]. [[Category:Nintendo Music source files]]"
local prima = "This file has been taken from a Prima guide. [[Category:Prima source files]]"
local nso = "This file has been taken from Nintendo Switch Online. [[Category:Nintendo Switch Online source files]]"
local nt = "This file has been taken from [[Nintendo Today!]] [[Category:Nintendo Today! source files]]"
local t = {}
t = {
['me'] = myself,
['my'] = myself,
['myself'] = myself,
['self'] = myself,
['Me'] = myself,
['My'] = myself,
['Myself'] = myself,
['Self'] = myself,
['other'] = user2,
['someone'] = user2,
['someone else'] = user2,
['user'] = user2,
['Other'] = user2,
['Someone'] = user2,
['Someone else'] = user2,
['User'] = user2,
['gamepedia'] = fandom,
['fandom'] = fandom,
['wikia'] = fandom,
['gamefaqs'] = fandom,
['Gamepedia'] = fandom,
['Fandom'] = fandom,
['Wikia'] = fandom,
['Gamefaqs'] = fandom,
['GameFAQs'] = fandom,
['youtube'] = youtube,
['yt'] = youtube,
['Youtube'] = youtube,
['YT'] = youtube,
['YouTube'] = youtube,
['kit'] = presskit,
['press'] = presskit,
['presskit'] = presskit,
['press kit'] = presskit,
['Kit'] = presskit,
['Press'] = presskit,
['Presskit'] = presskit,
['Press kit'] = presskit,
['Prima Official Starter Guide'] = prima,
['Prima Guide'] = prima,
['Prima guide'] = prima,
['prima guide'] = prima,
['Prima Games'] = prima,
['Prima games'] = prima,
['prima games'] = prima,
['prima official starter guide'] = prima,
['Prima'] = prima,
['prima'] = prima,
['nso'] = nso,
['NSO'] = nso,
['Switch Online'] = nso,
['Online'] = nso,
['Nintendo Switch Online'] = nso,
['switch online'] = nso,
['online'] = nso,
['nintendo switch online'] = nso,
['nt'] = nt,
['nintendotoday'] = nt,
['nintendo today'] = nt,
['Nintendo Today'] = nt,
['nintendotoday!'] = nt,
['nintendo today!'] = nt,
['Nintendo Today!'] = nt,
}
if source and source ~= "" then
if not t[X] then
return X
else return t[X]
end
else return missing
end
end
function LIC(X)
local ccbysa10 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by-sa/1.0/deed.en Creative Commons Attribution-ShareAlike 1.0]''' license.''[[Category:Media licensed under CC BY-SA 1.0]]"
local ccby20 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by/2.0/deed.en Creative Commons Attribution 2.0]''' license.''[[Category:Media licensed under CC BY-SA 2.0]]"
local ccbysa21jp = "''This file is distributed under the '''[https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en Creative Commons Attribution-ShareAlike 2.1 Japan]''' license.''[[Category:Media licensed under CC BY-SA 2.1]]"
local ccby25 = "''This file is distributed under the '''[http://creativecommons.org/licenses/by/2.5/deed.en Creative Commons Attribution 2.5]''' license.''[[Category:Media licensed under CC BY 2.5]]"
local ccbysa25 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by-sa/2.5/deed.en Creative Commons Attribution-ShareAlike 2.5]''' license.''[[Category:Media licensed under CC BY-SA 2.5]]"
local ccby30 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by/3.0/deed.en Creative Commons Attribution 3.0]''' license.''[[Category:Media licensed under CC BY 3.0]]"
local ccbync30 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by-nc/3.0/ Creative Commons Attribution Non-Commercial 3.0]''' license.''[[Category:Media licensed under CC BY-NC 3.0]]"
local ccbyncsa30 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons Attribution Non-Commercial 3.0]''' license.''[[Category:Media licensed under CC BY-NC-SA 3.0]]"
local ccbysa30 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by-sa/3.0/deed.en Creative Commons Attribution-ShareAlike 3.0]''' license.''[[Category:Media licensed under CC BY-SA 3.0]]"
local ccby40 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by/4.0/deed.en Creative Commons Attribution 4.0]''' license.''[[Category:Media licensed under CC BY 4.0]]"
local ccbysa40 = "''This file is distributed under the '''[https://creativecommons.org/licenses/by-sa/4.0/deed.en Creative Commons Attribution-ShareAlike 4.0]''' license.''[[Category:Media licensed under CC BY-SA 4.0]]"
local lgpl = "This library is free software; you can redistribute it and/or modify it under the terms of the '''[[wikipedia:GNU Lesser General Public License|GNU Lesser General Public License]]''' as published by the [[wikipedia:Free Software Foundation|Free Software Foundation]]; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See [http://www.gnu.org/licenses/lgpl.html the GNU Lesser General Public License] for more details."
local pd = "''This file has been released into the '''[[Wikipedia:Public domain|public domain]]''' by the copyright holder, its copyright has expired, or it is ineligible for copyright. This applies worldwide.''[[Category:Media released to public domain]]"
local pds = "''This file has been released into the '''[[Wikipedia:Public domain|public domain]]''' by the uploading user. This applies worldwide.''[[Category:Media released to public domain]]"
local fairuse = "''This file is subject to [[Wario Speedrunning:Copyrights|copyright]]. Copyright is most likely held by the company that published the game or the media portrayed. Wario Speedrunning Wiki's use of this work qualifies as '''fair use''' under '''[[Wikipedia:Fair use#U.S. fair use factors|United States copyright law]]''', or the author's permission is given. It is used on the wiki only in the belief that the information the file portrays is designed to be an accompaniment to playing the game or media, and its use here will not:''<ol><li>''Detract from the experience of playing the game or using the media in question.''</li><li>''Harm the author's sales or reputation.''</li></ol>[[Category:Media assumed fair use]]"
local t = {}
t = {
['ccbysa10'] = ccbysa10,
['ccybysa1.0'] = ccbysa10,
['cc by sa 1.0'] = ccbysa10,
['cc-by-sa-1.0'] = ccbysa10,
['cc-by-sa 1.0'] = ccbysa10,
['cc by-sa-1.0'] = ccbysa10,
['cc by-sa 1.0'] = ccbysa10,
['ccby20'] = ccby20,
['ccyby2.0'] = ccby20,
['cc by 2.0'] = ccby20,
['cc-by-2.0'] = ccby20,
['cc-by 2.0'] = ccby20,
['cc by-2.0'] = ccby20,
['cc by 2.0'] = ccby20,
['ccbysa21jp'] = ccbysa21jp,
['ccybysa2.1jp'] = ccbysa21jp,
['cc by sa 2.1 jp'] = ccbysa21jp,
['cc-by-sa-2.1 jp'] = ccbysa21jp,
['cc-by-sa 2.1 jp'] = ccbysa21jp,
['cc by-sa-2.1 jp'] = ccbysa21jp,
['cc by-sa 2.1 jp'] = ccbysa21jp,
['cc-by-sa 2.1 japan'] = ccbysa21jp,
['ccby25'] = ccby25,
['ccyby2.5'] = ccby25,
['cc by 2.5'] = ccby25,
['cc-by-2.5'] = ccby25,
['cc-by-2.5'] = ccby25,
['cc by-2.5'] = ccby25,
['cc by-2.5'] = ccby25,
['ccbysa25'] = ccbysa25,
['ccybysa2.5'] = ccbysa25,
['cc by sa 2.5'] = ccbysa25,
['cc-by-sa-2.5'] = ccbysa25,
['cc-by-sa 2.5'] = ccbysa25,
['cc by-sa-2.5'] = ccbysa25,
['cc by-sa 2.5'] = ccbysa25,
['ccby30'] = ccby30,
['ccyby3.0'] = ccby30,
['cc by 3.0'] = ccby30,
['cc-by-3.0'] = ccby30,
['cc-by-3.0'] = ccby30,
['ccbysa30'] = ccbysa30,
['ccybysa3.0'] = ccbysa30,
['cc by sa 3.0'] = ccbysa30,
['cc-by-sa-3.0'] = ccbysa30,
['cc-by-sa 3.0'] = ccbysa30,
['cc by-sa-3.0'] = ccbysa30,
['cc by-sa 3.0'] = ccbysa30,
['ccbync30'] = ccbync30,
['ccybync3.0'] = ccbync30,
['cc by nc 3.0'] = ccbync30,
['cc-by-nc-3.0'] = ccbync30,
['cc-by-nc 3.0'] = ccbync30,
['cc by-nc-3.0'] = ccbync30,
['cc by-nc 3.0'] = ccbync30,
['ccbyncsa30'] = ccbyncsa30,
['ccybyncsa3.0'] = ccbyncsa30,
['cc by nc sa 3.0'] = ccbyncsa30,
['cc-by-nc-sa-3.0'] = ccbyncsa30,
['cc-by-nc-sa 3.0'] = ccbyncsa30,
['cc by-nc-sa-3.0'] = ccbyncsa30,
['cc by-nc-sa 3.0'] = ccbyncsa30,
['ccby40'] = ccby40,
['ccyby4.0'] = ccby40,
['cc by 4.0'] = ccby40,
['cc-by-4.0'] = ccby40,
['cc-by-4.0'] = ccby40,
['ccbysa40'] = ccbysa40,
['ccybysa4.0'] = ccbysa40,
['cc by sa 4.0'] = ccbysa40,
['cc-by-sa-4.0'] = ccbysa40,
['cc-by-sa 4.0'] = ccbysa40,
['cc by-sa-4.0'] = ccbysa40,
['cc by-sa 4.0'] = ccbysa40,
['pd'] = pd,
['public'] = pd,
['publicdomain'] = pd,
['public domain'] = pd,
['lgpl'] = lgpl,
['GNU Lesser'] = lgpl,
['pds'] = pds,
['publicself'] = pds,
['publicdomain self'] = pds,
['public domain self'] = pds,
['public domain by myself'] = pds,
}
if not t[X]
then return fairuse
else return t[X]
end
end
local panel_type = ""
local panel_meta = ""
if not type or type == ""
then type = {}
else
type = mw.text.split(type, ',%s*')
for i = 1, #type do
type[i] = TEXT(type[i]) .. CAT(type[i],true)
end
if #type > 4
then panel_type = '<tr><th>Type(s)</th><td style="color: red">Way too many types!<br />Try using up to 4 types max.</td></tr>'
else panel_type = '<tr><th>Type(s)</th><td>'.. table.concat(type,", ") ..'</td></tr>'
end
end
if not meta or meta == ""
then meta = {}
else
meta = mw.text.split(meta, ',%s*')
for i = 1, #meta do
meta[i] = TEXT(meta[i]) .. CAT(meta[i],false)
end
if #meta > 4
then panel_meta = '<tr><th>Meta Type(s)</th><td style="color: red">Way too many types!<br />Try using up to 4 types max.</td></tr>'
else panel_meta = '<tr><th>Meta Type(s)</th><td>'.. table.concat(meta,", ") ..'</td></tr>'
end
end
local panel_game = '<tr><th>Game</th><td>\'\'[['.. game ..']]\'\'</td></tr>'
local panel_description = '<tr><th>Description</th><td>'.. description ..'</td></tr>'
local panel_user = '<tr><th>User</th><td>[[user:'.. user ..'|'.. user ..']]</td></tr>'
local panel_source = '<tr><th>Source</th><td>'.. SRC(source) ..'</td></tr>'
local panel_license = '<tr><th>License</th><td>'.. LIC(license) ..'</td></tr>'
local panel_resized = '<tr><th>Resized</th><td>This file has been resized.[[Category:Resized files]]</td></tr>'
local panel_youtube = '<tr><th>YouTube</th><td>This file has been taken from YouTube, and should be re-captured in-game when possible.[[Category:YouTube sourced images]]</td></tr>'
local panel_fandom = '<tr><th>FANDOM</th><td>This file has been taken from FANDOM (or a subsidiary) and should be re-captured as soon as possible.[[Category:FANDOM sourced images]]</td></tr>'
if game == "" then panel_game = "" end
if user == "" then panel_user = "" end
if resized ~= "yes" then panel_resized = "" end
if youtube ~= "yes" then panel_youtube = "" end
if fandom ~= "yes" then panel_fandom = "" end
if description == "" or description == nil then
panel_description = "[[Category:Files without a description]]"
end
if source == "" or source == nil then
panel_source = "[[Category:Files without a source]]"
end
local panel = '<table class="wikitable" style="width: 100%"><tr><th colspan="2">File information</th></tr>'.. panel_game .. panel_description .. panel_type .. panel_meta .. panel_user .. panel_source .. panel_resized .. panel_youtube .. panel_fandom .. panel_license ..'</table>'
table.insert(result, panel)
return table.concat(result, "")
end
return f