Module:AfC
Appearance
![]() | This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
![]() | This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
The AfC module contains code to render rows of Template:AFC statistics.
Usage
{{#invoke:AfC|row|s=status|t=title|z=size|sr=special user|sd=special time|si=special oldid|mr=modify user|md=modify time|mi=modify oldid|…}}
Parameters
{{{s}}}
: status (one of p, a, d, r, m){{{t}}}
: full title of page{{{z}}}
: size of page (number of bytes)
{{{mr}}}
: username of last page modifier{{{md}}}
: time page was last modified{{{mi}}}
: oldid at last modification time
{{{sr}}}
: username of page reviewer/submitter (or any special second case){{{sd}}}
: time page was "specialed"{{{si}}}
: oldid at "special" time
{{{n}}}
: whether or not the template should display special notes about this page{{{nc}}}
: (copyvio) submission is a suspected copyright violation{{{nu}}}
: (unsourced) submission lacks references completely{{{ni}}}
: (no-inline) submission has no inline citations{{{ns}}}
: (short) submission is less than a kilobyte in length{{{nr}}}
: (resubmit) submission was resubmitted after a previous decline{{{no}}}
: (old) submission has not been touched in over four days{{{nj}}}
: (rejected) submission was rejected{{{nb}}}
: (blocked) submitter is currently blocked
Examples
{{#invoke:AfC|row|s=a|t=Walter Erwin Diewert|z=2029|sr=Miniapolis|sd=13:31, 15 Oct 2013|si=577279496|mr=Derek R Bullamore|md=18:52, 15 Oct 2013|mi=577320678}}Lua error at line 29: bad argument #2 to 'format' (string expected, got nil).
Submission | Accepted | Last modified | ||||
---|---|---|---|---|---|---|
Title | Size | Notes | User | Time | User | Time |
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