Arrowverse Wiki
Advertisement
Arrowverse Wiki
Module documentation

This module has various functions described below and should only be utilized on templates. To call a module in a template, insert {{#invoke:Number|function name|various parameters}} onto the template.[ Data ]

For help on this module, please contact an administrator.
Visit Module:Number/doc to edit this text! (How does this work?)

--[[Category:Lua modules]]
local p = {}
local numData = mw.loadData('Module:Number/data')

function p.getNum(frame)
    local show= frame.args[1]
	local number={}
    if numData[show]
        then number=numData[show][1]
        else number="0[[Category:"
			 .."Broken S link]]"
    end
    return number
end

function p.current(frame)
	local show=frame.args[1]
	local pagename=frame.args[2]
	local currentDisplay=""
	
	local length= mw.ustring.len(show)
    local par={}
    if mw.ustring.find(show,'(',1,true)==nil
        then par=length
        else par=mw.ustring.find(show,'(',1,true)-2
    end
	local title=mw.ustring.sub(show,1,par)
	
	--pagename=mw.ustring.gsub(pagename,"%%26","&")
	pagename = mw.text.decode(pagename,false)
	
	if numData[show]
		then local season=numData[show][2]
			local suggestedPN="Season "
				..season
				.." ("
				..title
				..")"
			if suggestedPN==pagename and numData[show][3]>0
				then currentDisplay="<small>("
						..numData[show][3]
						.." aired)</small>"
			end
	end
	return frame:preprocess(currentDisplay)
end
return p
Advertisement