Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sports results/blank
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!
-- This module generates a blank invocation of the sports results module -- using the values of team1, team2, ... local p = {} local function isnotempty(s) return s and s:match( '^%s*(.-)%s*$' ) ~= '' end function p.main(frame) local args = (frame.args['team1'] ~= nil) and frame.args or frame:getParent().args local processed = {} -- Count the number of teams local numteams = 0 while isnotempty(args['team' .. (numteams + 1)]) do numteams = numteams + 1 end local res = '{{#invoke:sports results|main\n' if args['template_name'] then res = res .. '| template_name = ' .. (args['template_name'] or '<!-- to add v-t-e links -->') .. '\n' processed['template_name'] = 1 end res = res .. '| source = ' .. (args['source'] or '<!-- source -->') .. '\n' processed['source'] = 1 res = res .. '| update = ' .. (args['update'] or '<!-- last updated -->') .. '\n' processed['update'] = 1 if args['start_date'] then res = res .. '| start_date = ' .. args['start_date'] .. '\n' processed['start_date'] = 1 end if args['match_col_width'] then res = res .. '| match_col_width = ' .. args['match_col_width'] .. '\n' processed['match_col_width'] = 1 end if args['matches_style'] then res = res .. '| matches_style = ' .. args['matches_style'] .. '\n' processed['matches_style'] = 1 end if args['a_note'] then res = res .. '| a_note = ' .. args['a_note'] .. '\n' processed['a_note'] = 1 end if args['showteam'] then res = res .. '| showteam = ' .. (args['showteam'] or '<!-- for bolding one team results -->') .. '\n' processed['showteam'] = 1 end for i=1,numteams do local ab = args['team' .. i] processed['team' .. i] = 1 res = res .. '| team' .. i .. '= ' .. ab .. ' ' end res = res .. '\n\n' for i=1,numteams do local ab = args['team' .. i] res = res .. '| name_'..ab ..' = '.. (args['name_'..ab] or '') .. '\n' processed['name_'..ab] = 1 if (args['short_'..ab]) then res = res .. '| short_'..ab ..' = '.. (args['short_'..ab] or '') .. '\n' processed['short_'..ab] = 1 end end res = res .. '\n' for i=1,numteams do local abi = args['team' .. i] for j=1,numteams do local abj = args['team' .. j] if i ~= j then local mij = 'match_' .. abi .. '_' .. abj res = res .. '| ' .. mij .. ' = ' .. (args[mij] or '') .. '\n' processed[mij] = 1 end end res = res .. '\n' end local comment = '<!-- Other parameters -->\n' for k, v in pairs( args ) do if v ~=nil and processed[k] == nil then res = res .. comment .. '| ' .. k .. ' = ' .. v .. '\n' comment = '' end end res = res .. '}}' return res end return p
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)
Templates used on this page:
Template:Error
(
edit
)
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Template:Sandbox other
(
edit
)
Module:Arguments
(
edit
)
Module:Error
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Sports results/blank/doc
(
edit
)
Module:String
(
edit
)
Module:Yesno
(
edit
)