Module:Contentious topics/talk notice/sandbox: Difference between revisions

Content deleted Content added
accept more date formats
Line 164:
-- Check whether any of the added restrictions are enabled
underRestrictions = #restrictions > 0 or args.other or args.other1
-- total number of topics applicable
Line 219:
messageBody = '<b>The [[Wikipedia:Contentious topics|contentious topics]] procedure applies to this ' .. articleOrPage .. '.</b>'
 
-- if there's only one topic, we make a short blurb
if numberOfTopics == 1 then
Line 292:
addCategory(categoryDatabase[restriction])
end
if args.other or args.other1 then
addToMessage('*-- <b>'we ..have some form of args.other ..restrictions, so add the '</b>\n')category
addCategory(categoryDatabase["other"])
-- then define a helper function to add a restriction
local function addOther(s)
addToMessage('* <b>' .. s .. '</b>\n')
end
-- then add the generic 'other' parameter
if args.other then
addOther(args.other)
end
-- and now we loop to infinity and beyond
local i = 1
while true do
if args['other' .. i] then
addOther(args['other' .. i])
i = i + 1
else
break
end
end
end
end