本站页面(多半)转载自萌娘百科的同名页面,依CC BY-NC-SA 3.0引入,贡献者可以在历史页查询。
因各种原因页面内容可能和源页面有所出入,非本站特有页面内容请以萌娘百科为准。
因各种原因页面内容可能和源页面有所出入,非本站特有页面内容请以萌娘百科为准。
- 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
- 本镜像站和其他萌娘百科的镜像站无关,请注意分别。
Module:Sandbox/滝沢朔太郎/UserGroupSysop
跳到导航
跳到搜索
local module = {} ----- 在下方修改各用户组成员列表 ----- local bureaucrat = { { "Baskice", prefix = "<sub>站长</sub>" }, "AnnAngela", "云霞", { "Etolli", postfix = "<sub>暂不参与站务</sub>", active = false } -- active参数仅在false时表示该用户将被[[Template:大召唤术]]忽略。 } local sysop = { "金萌桥姬", "蓝羽汇", "弗霖凯", "北极星与南十字", "Lyhic" } ----- 在上方修改各用户组成员列表 ----- --[[ 供Module:Summon(大召唤术)读取数据的接口。 --]] function module.enumerate() local users = {} local groups = { bureaucrat, sysop, patroller } -- 在上方添加用户组后,在这里添加引用。 for _, group in ipairs(groups) do for _, user in ipairs(group) do if type(user) == "string" and mw.text.trim(user) ~= "" then table.insert(users, mw.text.trim(user)) elseif type(user) == "table" and type(user[1]) == "string" and mw.text.trim(user[1]) ~= "" and user.active ~= false then table.insert(users, mw.text.trim(user[1])) end end end return users end local UserGroupInfo = function(group, frame) local parent = frame:getParent() if parent and parent:getTitle() == "Template:UserGroup" then frame = parent end if frame.args["Count"] then return #group else local list = {} for _, user in ipairs(group) do if type(user) == "string" and mw.text.trim(user) ~= "" then table.insert(list, frame:expandTemplate{ title = "User", args = { user } }) elseif type(user) == "table" and type(user[1]) == "string" and mw.text.trim(user[1]) ~= "" then table.insert(list, frame:preprocess(user.prefix or "").. frame:expandTemplate{ title = "User", args = { user[1] } }.. frame:preprocess(user.postfix or "") ) end end return table.concat(list, " • ") end end function module.bureaucrat(frame) return UserGroupInfo(bureaucrat, frame) end function module.sysop(frame) return UserGroupInfo(sysop, frame) end return module