Jump to content

Editing Module:High-use

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 18: Line 18:
if count == nil then
if count == nil then
if frame.args[1] == "risk" then
if frame.args[1] == "risk" then
return_value = "a very large number of"
return "a very large number of"
else
else
return_value = "many"
return "many"
end
end
else
else
Line 52: Line 52:
return return_value
return return_value
end
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
function p.risk(frame)
local return_value = ""
if frame.args[1] == "risk" then
if frame.args[1] == "risk" then
return_value = "risk"
return "risk"
else
else
local count = _fetch(frame)
local count = _fetch(frame)
if count and count >= 100000 then return_value = "risk" end
if count and count >= 100000 then
return "risk"
end
end
end
return return_value
return ""
end
end


Line 86: Line 88:
end
end
-- This retrieves the project URL automatically to simplify localiation.
-- This retrieves the project URL automatically to simplify localization.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
local templateCount = ('on [https://linkcount.toolforge.org/?project=%s&page=%s#transclusions %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
mw.uri.encode(title.fullText), p.num(frame, count))
Line 146: Line 148:
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
local categorise = (nocat == '' or not yesno(nocat))
if categorise then
if categorise and not mw.title.getCurrentTitle().isRedirect then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
end
Please note that all contributions to Micro Pedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Micro Pedia:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: