Module:High-use: Difference between revisions

m
1 revision imported
m (1 revision imported)
m (1 revision imported)
 
(3 intermediate revisions by 3 users not shown)
Line 52:
return return_value
end
 
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
Line 85 ⟶ 86:
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://templatecountlinkcount.toolforge.org/index.php?lang=en&namespaceproject=%s&namepage=%s %s pages]'):format(
mw.title.getCurrentTitle().namespace, mw.uri.encode(title.text), p.num(frame, count))
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.title.getCurrentTitle().namespace, mw.uri.encode(title.textfullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and (",''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"