首页
随机
登录
设置
关于MCServerWiki
免责声明
MCServerWiki
搜索
欢迎来到MCServerWiki!如果您是第一次来到这里,请点击:
创建账户
编辑“︁
模块:SafeCate
”︁
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
local module = {} local function _isvalid(value) return value ~= nil and type(value) == "string" and mw.text.trim(value) ~= "" end function module.main(frame) local strict = frame local parent = frame:getParent() if not _isvalid(frame.args[1]) then if not (parent and _isvalid(parent.args[1])) then return end local title = parent:getTitle() if title == "Template:SafeCate" then strict, frame = parent, parent elseif mw.title.new(title).namespace == 10 and frame.args["strict"]=="1" then frame = parent else return end end local cate = frame.args[1] local mod = frame.args[2] local nsMap = { } local bExclude, nsids = false, nil if strict.args["nsid"] then nsids = mw.text.split(strict.args["nsid"], ",", true) elseif strict.args["nsidExclude"] then bExclude = true nsids = mw.text.split(strict.args["nsidExclude"], ",", true) end if nsids then for _, value in ipairs(nsids) do nsMap[tonumber(value)] = true end else nsMap[0] = true end local noSubpage = (strict).args["noSubpage"]=="1" local title = mw.title.getCurrentTitle() local curNsid = title.namespace if ((nsMap[curNsid] and (not bExclude)) or ((not nsMap[curNsid]) and bExclude)) and ((not noSubpage) or (not title.isSubpage)) then if curNsid == 10 and title.isSubpage and title.subpageText == "doc" then return end if mod then return "[[Category:"..cate.."|"..mod.."]]" else return "[[Category:"..cate.."]]" end end end return module
摘要:
请注意,所有对MCServerWiki的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
MCServerWiki:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
该页面使用的模板:
模板:Tl
(
编辑
)
模块:SafeCate/doc
(
编辑
)