Jump to content

Module:SportsRankings

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jts1882 (talk | contribs) at 11:18, 2 November 2018 (create outline module). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

require('Module:No globals');

local error_msg = '<span style=\"font-size:100%\" class=\"error\"><code style=\"color:inherit; border:inherit; padding:inherit;\">&#124;_template=</code> missing or empty</span>';

local updated = {
	day = 2,
	month = 11,
	year =2018
}
local rankings = { --	{ country code, rank, move },
	             { 'BEL', 1, 0 },
	             { 'FRA', 2, -1 },
	             { 'BRA', 3, 0 },
	             { 'CRO', 4, 0 },
	             { 'ENG', 5, 1 },
	             { 'URU', 6, -1 },
	             { 'POR', 7, 0 },
	             { 'SUI', 8, 0 },
	             { 'ESP', 9, 0 },
	             { 'DEN', 10, 0 },
	             	-- other to fill later
	             { 'GIB', 190, 8 }
}
local p = {}

function getArgs (frame, args)
	local parents = mw.getCurrentFrame():getParent()
		
	for k,v in pairs(parents.args) do
		--check content
		if v and v ~= "" then
			args[k]=v --parents.args[k]
		end
	end
end
function p.main(frame)
	
	local templateArgs = {}   -- need a copy to alter and pass to citation template
    getArgs (frame, templateArgs) -- returns args table having checked for content
    
    local outputString = "Ranking goes here: "
    local country = templateArgs['1']
    
    local outputString = outputString .. country
    
    
    
    return outputString
	
end
return p