词条 | Module:Members |
释义 | local members = {} -- Prints a project membership table. Used like {{#invoke:Members|cols=name,project_roles|name1|role1|name2|role2}}members.printMembersTable = function(frame) -- Cols argument will determine the form of the table printed. For example, if cols is -- "name,date,role," a three column table will be printed for each of those values for each -- user passed in. -- Possible column names include: -- name: Will print a link to the user page (ie, " -- name1: Will print a link to the user page and talk page (ie, " -- name2: Will print a link to the user page, talk page, and contributions page (ie, " -- NOTE - The three "name[#]" arguments above are currently the only ones that will add text; the rest will just print as passed in in the desired order. -- member_since: Will print the date the user has been a member since (ie, "00:43, 9 October 2014 (UTC)") -- project_roles: Will print the users' project roles (ie, "Article Editor, Mentor") -- member_status: Member status. Should be one of Active, Inactive, or ???. -- Not yet implemented, potentially desireable: -- edits: Will print the users edit count for the last 30 days. -- ??? - Add additional ideas here local cols = frame.args.cols a_cols = {} for col in string.gmatch(cols, "[^,]+") do table.insert(a_cols, col) end -- The arguments after cols should iterate over each member, with each argument being the -- next column value (ie, frame.args % split(cols, "|").length should equal 0) res = "" for i in ipairs(frame.args) do -- Create the new row if required if i % #a_cols == 1 then res = res .. "|-\" end -- Then print the user values with HTML comments labeling the column name for each if a_cols[i % #a_cols] == "name" then res = res .. "| " .. frame.args[i] .. "\" elseif a_cols[i % #a_cols] == "name1" then res = res .. "| " .. frame.args[i] .. " • Talk\" elseif a_cols[i % #a_cols] == "name2" then res = res .. "| " .. frame.args[i] .. " • Talk • Contribs\" else --res = res .. "| " .. frame.args[i] .. "\" res = res .. "| " .. frame.args[i] .. "\" end --if i ~= #a_cols then res = res .. "\" end end return res end return members |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。