Module:Professional wrestling results table
Appearance
![]() | This module depends on the following other modules: |
This module implements {{Professional wrestling results table}}. Please see the template page for documentation.
Adding notes
Firstly, familiarize yourself with the format of the notes table:
local notes = {
dark = { 'D', 'a [[dark match]]' },
pre = { 'P', 'broadcast on the pre-show' },
aewd = { 'AD', taped ..'<i>[[AEW Dark|Dark]]</i>' },
aewde = { 'DE', taped ..'<i>[[AEW Dark: Elevation|Dark: Elevation]]</i>' },
bti = { 'B', taped ..'<i>[[Before the Impact]]</i>' },
ffa = { 'F', live ..'<i>[[WWE Free for All|Free for All]]</i>' },
fusion = { 'FT', taped ..'<i>[[MLW Fusion|Fusion]]</i>' },
fusionlive = { 'F', live ..'<i>[[MLW Fusion|Fusion]]</i>' },
heat = { 'H', live ..'<i>[[WWE Heat|Sunday Night Heat]]</i>' },
mem = {'MEM', taped ..'<i>Main Event Mondays</i>' },
regnxt = { 'N', taped ..'<i>[[WWE NXT|NXT]]</i>' },
regnxtuk = { 'UK', taped ..'<i>[[WWE NXT UK|NXT UK]]</i>' },
slam = { 'S', live ..'<i>[[WWF Sunday Night Slam|Sunday Night Slam]]</i>' },
wcwme = { 'ME', live ..'<i>[[WCW Main Event|Main Event]]</i>' },
wcwsn = { 'SN', live ..'<i>[[WCW Saturday Night|Saturday Night]]</i>' },
xplosion = { 'X', taped ..'<i>[[Impact! Xplosion|Xplosion]]</i>' }
}
The notes table has been aligned to be easier to understand for editors inexperienced with Lua. Let's break it down further, with a specific example:
heat = { 'H', live ..'<i>[[WWE Heat|Sunday Night Heat]]</i>' },
- heat is the note value (e.g.,
|note1=heat
) - H is the note symbol that appears beside the match number
- The latter entry is the explanation in the Key. There are live (aired prior to the pay-per-view) and taped (recorded for future broadcast) preset options. This should include a wikilink to the program, enclosed by italic HTML tags (<i></i>).
When adding a note, there are a few things to keep in mind:
- The note value should be short, yet comprehensible. Use an abbreviation or acronym of the program. If the resulting value is common and there is potential for overlap, consider including the acronym of the promotion.
- The note symbol should be limited to one or two characters. If there is potential overlap with other symbols in the same results table, then adjust the symbol accordingly. Avoid using "D" or "P" as they are generalized notes for dark match and pre-show, respectively.
local p = {}
function p.main(frame)
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(frame)
local t = {}
local future_event = false
local future_note = 'took'
local results_label = 'Results'
local times_col = args['time1'] ~= nil and true or false
local notes = {}
local notes_active = {}
local notes_active_filter = {}
local row_num = 1
local live_msg = 'was broadcast prior to the pay-per-view on '
local taped_msg = 'was taped for broadcast on a future episode of '
local error_msg = {}
-- Preprocessing
if args['future'] == 'yes' then
future_event = true
future_note = 'will take'
results_label = 'Matches *'
end
notes = {
dark = { -- Dark match
id = 'D',
key = 'was a [[dark match]]'
},
pre = { -- Pre-show
id = 'P',
key = future_note ..' place on the pre-show'
},
aewd = { -- AEW Dark
id = 'AD',
key = taped_msg ..'<i>[[AEW Dark]]</i>'
},
aewde = { -- AEW Dark: Elevation
id = 'DE',
key = taped_msg ..'<i>[[AEW Dark: Elevation]]</i>'
},
ffa = { -- WWE Free for All
id = 'F',
key = live_msg .. '<i>[[WWE Free for All|Free for All]]</i>'
},
fusion = { -- MLW Fusion (taped)
id = 'FT',
key = taped_msg ..'<i>[[MLW Fusion|Fusion]]</i>'
},
fusionlive = { -- MLW Fusion (live)
id = 'F',
key = live_msg ..'<i>[[MLW Fusion|Fusion]]</i>'
},
heat = { -- WWE Sunday Night Heat
id = 'H',
key = live_msg ..'<i>[[WWE Heat|Sunday Night Heat]]</i>'
},
regnxt = { -- WWE NXT (taped)
id = 'N',
key = taped_msg ..'<i>[[WWE NXT|NXT]]</i>'
},
regnxtuk = { -- WWE NXT UK (taped)
id = 'UK',
key = taped_msg ..'<i>[[WWE NXT UK|NXT UK]]</i>'
},
slam = { -- WWF Sunday Night Slam
id = 'S',
key = live_msg ..'<i>[[WWF Sunday Night Slam|Sunday Night Slam]]</i>'
},
wcwme = { -- WCW Main Event
id = 'ME',
key = live_msg ..'<i>[[WCW Main Event|Main Event]]</i>'
},
wcwsn = { -- WCW Saturday Night
id = 'SN',
key = live_msg ..'<i>[[WCW Saturday Night|Saturday Night]]</i>'
},
xplosion = { -- Impact! Xplosion
id = 'X',
key = taped_msg ..'<i>[[Impact! Xplosion|Xplosion]]</i>'
}
}
-- Begin table
table.insert(t, '{| class="wikitable"'.. (args['align'] == 'center' and ' style="margin:1em auto"' or '') ..' \n')
-- Table header
if args['caption'] ~= nil then
table.insert(t, '|+ '.. args['caption'] ..' \n')
end
table.insert(t, '! scope="col" colspan="2"| No. \n')
table.insert(t, '! scope="col"| '.. results_label .. (args['results'] or '') ..' \n')
table.insert(t, '! scope="col"| Stipulations \n')
if times_col then
table.insert(t, '! scope="col"| Times'.. (args['times'] or '') ..' \n')
end
-- Matches
while args['match'..row_num] ~= nil do
table.insert(t, '|- \n') -- New row
table.insert(t, '! scope="row"') -- Begin note/number col
-- Notes (new)
local row_note = args['note'..row_num]
if row_note ~= nil then
if notes[row_note] ~= nil then
table.insert(notes_active, row_note) -- For sorting
table.insert(t, '| <span style="font-size: 90%">'.. notes[row_note].id ..'</span> \n')
table.insert(t, '! scope="row"')
else -- Error: invalid note
table.insert(error_msg, ' note'.. row_num ..' with args "'.. row_note ..'".')
table.insert(t, ' colspan="2"')
end
else -- Notes (old)
for k,v in pairs(notes) do
if args[k .. row_num] == 'yes' then
table.insert(notes_active, k) -- For sorting
table.insert(t, '| <span style="font-size: 90%">'.. v.id ..'</span> \n')
table.insert(t, '! scope="row"')
row_note = k
break
end
end
if row_note == nil then
table.insert(t, ' colspan="2"')
end
end
table.insert(t, ' style="text-align: right"| ' .. row_num ..' \n') -- Match number
table.insert(t, '| '.. (args['match'..row_num] or '') ..' \n') -- Match
table.insert(t, '| '.. (args['stip'..row_num] or '') ..' \n') -- Stipulation
-- Times
if times_col then
table.insert(t, '| align="center"| '.. (args['time'..row_num] or '') ..' \n')
end
row_num = row_num+1
end
-- Table key
if args['hide'] ~= 'all' then
table.insert(t, '|- \n')
table.insert(t, '! scope="row" colspan="5" style="font-weight: normal;border-top:solid 2px #aaa;text-align:left;"| \n')
table.insert(t, '{| style="margin:0 auto;padding:0;border-spacing:0;line-height:1.4em;" \n')
if args['hide'] ~= 'champions' and args['hide'] ~= 'champs' then
table.insert(t, '| align="right"| (c) \n')
table.insert(t, '| – refers to the champion(s) heading into the match \n')
end
for _,v in ipairs(notes_active) do
if notes_active_filter[v] == nil then -- Filter duplicates
notes_active_filter[v] = true
table.insert(t, '|- \n')
table.insert(t, '| align="right"| <span style="font-size: 90%"><b>'.. notes[v].id ..'</b></span> \n')
table.insert(t, '| – indicates the match '.. notes[v].key ..' \n')
end
end
if future_event then
table.insert(t, '|- \n')
table.insert(t, '| align="center" colspan="2"| <small><b>* Card subject to change</b></small> \n')
end
table.insert(t, '|} \n')
end
-- End table
table.insert(t, '|}')
-- Display errors
if next(error_msg) ~= nil then
table.insert(t, '<strong class="error">Error: invalid value at '.. table.concat(error_msg) .. '</strong>')
-- Add tracking category later
end
return table.concat(t)
end
return p