编辑“
Module:PJBSClass/TrackingCategory
”
跳转到导航
跳转到搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
local p = {} local yesno = require('Module:Yesno') local class_normalize = require("Module:Class/convert")._main local TrackingCategory = require('Module:TrackingCategory') local templateExist = require("Module:TemplateExist").templateExist function p.cat_for_wpbs(frame) local args = frame local working_frame = frame if type(frame.args) == type({}) then args = frame.args end if type(frame.preprocess) ~= type(tostring) then working_frame = mw.getCurrentFrame() end --本模板是示例模板,不加分類 if yesno(args.demo) or not yesno(args.category) then return end local wpbs_class = mw.text.trim(args.class or '') local WPBS_count = templateExist({args={"WPBS",count=true}}) if wpbs_class == '' and wpbs_class ~= '¬' then --[[w:en:Category:Articles using WikiProject banner shell with empty class parameter]] TrackingCategory.append(working_frame, "含有空白class參數的WPBS") end if WPBS_count > 1 then TrackingCategory.append(working_frame, "重複放置WPBS模板的條目") end return '' end function p.cat_for_wpbm(frame) local args = frame local working_frame = frame if type(frame.args) == type({}) then args = frame.args end if type(frame.preprocess) ~= type(tostring) then working_frame = mw.getCurrentFrame() end local WPBS_exist = templateExist("WPBS") --本模板是示例模板,不加分類 if yesno(args.demo) or not yesno(args.category) then return '' end --取得WPBS資料 local WPBS_data = mw.loadData("Module:PJBSClass/page") --輸入於本專題橫幅的評級class值 local local_class = mw.text.trim(args.class or '') --輸入於WPBS的評級class值 local article_class = mw.text.trim(WPBS_data.class or '') local raw_class = mw.text.trim(args.raw_class or '¬') local norm_local_class = class_normalize({local_class}) local norm_article_class = class_normalize({article_class}) if WPBS_exist then --如果存在WPBS模板 if article_class == '' then --WPBS模板沒有給定評級 if local_class ~= '' and raw_class ~= '¬' then --但專題橫幅有給定評級 local success, auto_class = pcall(require("Module:PJBSClass/main").getClassAuto, nil, '', yesno(args.demo), args.napagens or '{{{napagens}}}') auto_class = class_normalize({auto_class or "unassessed"}) if auto_class == "unassessed" or auto_class == "" then --[[w:en:Category:Pages using WikiProject banner shell without a project-independent quality rating]] TrackingCategory.append(working_frame, "缺少獨立於專題評級的WPBS") end end elseif norm_local_class == norm_article_class then --專題橫幅的評級與WPBS完全一致 if norm_local_class ~= "unassessed" and raw_class ~= '¬' and raw_class ~= '' then --[[w:en:Category:WikiProject banners with redundant class parameter]] TrackingCategory.append(working_frame, "有不必要class參數的專題橫幅") end end else --如果不存在WPBS模板 --[[w:en:Category:WikiProject banners without banner shells]] TrackingCategory.append(working_frame, "沒有使用WPBS的專題橫幅") end return '' end return p
摘要:
请注意,您对Positive WiKi的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Positive WiKi:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
Module:PJBSClass/TrackingCategory/doc
(
编辑
)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模块
讨论
English
查看
阅读
编辑源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息