Jump to content

Module:AfC submission catcheck

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Courcelles (talk | contribs) at 04:51, 20 April 2014 (Changed protection level of Module:AFC submission catcheck: Per RFPP request, "mother" template only template protected now ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local i = {}

function i.checkforcats(frame)
    local t = mw.title.getCurrentTitle()
    tc = t:getContent()
    if tc == nil then 
        return ""
    end
    tc = mw.ustring.gsub(tc,"%[%[Category:Articles created via the Article Wizard%]%]","")
    tc = mw.ustring.gsub(tc,"<!--.--->","")
    tc = mw.ustring.gsub(tc,"<nowiki>.-</nowiki>","")
    if mw.ustring.match(tc, "%[%[%s-[Cc]ategory:" ) == nil then
        return ""
    else
        return "[[Category:AfC submissions with categories]]"
    end
end
 
return i