Modul:High-use: Unterschied zwischen den Versionen

K
39 Versionen von wpen:Module:High-use importiert
(Undid revision 1037001710 by Trappist the monk (talk) - this would present very misleading data, as it would be comparing the number of transclusions on all PAGES against the number of ARTICLES. Wait to implement until there is actually a data source to match.)
K (39 Versionen von wpen:Module:High-use importiert)
 
(5 dazwischenliegende Versionen von 5 Benutzern werden nicht angezeigt)
Zeile 40: Zeile 40:
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
end
 
-- Insert percentage of pages if that is likely to be >= 1%
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 then
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
if percent >= 1 then
Zeile 85: Zeile 85:
systemMessages = nil
systemMessages = nil
end
end
local templateCount = ('on [https://templatecount.toolforge.org/index.php?lang=en&namespace=%s&name=%s %s pages]'):format(
-- This retrieves the project URL automatically to simplify localiation.
mw.title.getCurrentTitle().namespace, mw.uri.encode(title.text), p.num(frame, count))
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and (",''' and " .. templateCount) or ("'''"))
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
else
used_on_text = used_on_text .. templateCount .. "'''"
used_on_text = used_on_text .. templateCount .. "'''"