Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/PHansen/Fteam
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} --[[ Feb-2015 * Module:Sandbox/PHansen/Fteam --- User:PHansen/Fteam --- * 'Fteam' : F for Football (soccer) --- team: national teams for adults and youths (21, 19, 17) - men and women * Intention : to replace separate templates with one 'Fm/k/u' via Lua-module - short form : 'Fmku' (men/women/youth) ]] function p.main ( frame ) -- local country = frame.args[1] -- parameter from the template : country local sex = frame.args[2] -- parameter from the template : male or female : m or k local age = frame.args[3] -- parameter from the template : 21, 19, 17, or ? - national team, youth local return_result = "" local dummy = "dummy" local error_msg = '<span class="error"><small>The format is {{Fteam|country|sex|age}}</small></span>' --Error if country == nil or country == "" or country == "m" or country == "k" or country == "[0-9]" then return ( error_msg .. ' - `country` must be first parameter' ) end -- error if no country -- if 'country' seemed OK then continue: -- men AND adults (no age given) if sex == "m" and age == "" then -- was: [[{{{1}}}s fodboldlandshold|{{{1}}}]] return_result = "[[" .. country .. "s" .. " " .. "fodboldlandshold" .. "|" .. country .. "]]" return return_result end -- adult, men -- women AND adults (no age given) if sex == "k" and age == "" then --was: [[{{{1}}}s kvindefodboldlandshold|{{{1}}}]] return_result = "[[" .. country .. "s" .. " " .. "kvindefodboldlandshold" .. "|" .. country .. "]]" return return_result end -- adult, women -- men AND youth (age given 17, 19, 21, or ?) if age ~= "" and sex == "m" then -- was: [[{{{1}}}s U/{{{2}}}-fodboldlandshold|{{{1}}} U/{{{2}}}]] return_result = "[[" .. country .. "s" .. " U/" .. age .. "-fodboldlandshold" .. "|" .. country .. " U/" .. age .. "]]" return return_result end -- men AND youth (age given 17, 19, 21, or ?) -- women AND youth (age given 17, 19, 21, or ?) if age ~= "" and sex == "k" then -- was: [[{{{1}}}s U/{{{2}}}-kvindefodboldlandshold|{{{1}}} U/{{{2}}}]] return_result = "[[" .. country .. "s" .. " U/" .. age .. "-kvindefodboldlandshold" .. "|" .. country .. " U/" .. age .. "]]" return return_result end -- women AND youth (age given 17, 19, 21, or ?) end -- function p.main ( frame ) return p -- export table
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/PHansen/Fteam/doc
(
edit
)