Jump to content

Module:AfC

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Martijn Hoekstra (talk | contribs) at 19:49, 17 March 2013 (test creation). 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)

local p = {}
function p.hello(frame)
    return 'Hello'
end

-- current call example: {{AFC statistics/row|s=p|t=Wikipedia talk:Articles for creation/Submissions/Confidential Incident Reporting & Analysis System (CIRAS)|h=Submissions/Confidential Incident Reporting & A...|z=6.7 kB|sr=CIRAS|sd=15:19, 22 Jan 2009|si=265715189|mr=SBaker43|md=04:45, 15 Mar 2013|mi=544281825}}
function p.row(frame)
    local status = frame.args["s"]
    local title = frame.args["t"]
    local short = frame.args["h"]
    local size = tonumber(frame.args["z"])
    local modified_by = frame.args["mr"]
    local modified_at = frame.args["md"]
    local old_id = frame.args["mi"]
    local special_user = frame.args["sr"]
    local special_time = frame.args["sd"]
    local special_id = tonumber(frame.args["si"])
    local display_notes = tonumber(frame.args["n"])
    local is_suspected_copyvio = tonumber(frame.args["nc"])
    local is_unsourced = tonumber(frame.args["nu"])
    local no_inline = tonumber(frame.args["ni"])
    local is_short = tonumber(frame.args["ns"])
    local is_resubmit = tonumber(frame.args["nr"])
    local is_old = tonumber(frame.args["no"])
    local submitter_is_blocked = tonumber(frame.args["nb"])
    local rowtemplate = "<tr style=\"background-color : %s\"> %s </tr>"
    local colorthing =  string.format("{{AFC statistics/color|%s}}", status)
    local cols = {}
    cols[1] = string.format("[[%s]]", short)
    cols[2] = size
    cols[3] = ""
    if special_id then cols[4] = string.format("{{AFC statistics/user|1=%s}}", special_user) else cols[4] = "Unknown" end
    cols[5] = ""
    cols[6] = string.format("{{AFC statistics/user|1=%s}}", modified_by)
    cols[7] = ""
    local colstring = ""
    for i=1, 7 do colstrin = colstring .. string.format("<td>%s</td>", cols[i]) end
    mw.log(string.format(rowtemplate, colorthing, colstring))
    return string.format(rowtemplate, colorthing, colstring)
end


return p