Module:High-use: Difference between revisions

+support for |article-space=yes;
(implement fetch parameter)
(+support for |article-space=yes;)
Line 43:
-- Insert percentage of pages if that is likely to be >= 1%
if count and count > 250000 then
local percentmagic_word = math.floor( (yesno (count/frame:callParserFunctiongetParent().args['NUMBEROFPAGESarticle-space',]) and 'RNUMBEROFARTICLES') )or * 100) + 0.5)'NUMBEROFPAGES';
local percent = math.floor( ( (count/frame:callParserFunction(magic_word, 'R') ) * 100) + 0.5)
 
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
Line 86 ⟶ 88:
end
local templateCount = ('on [https://templatecount.toolforge.org/index.php?lang=en&namespace=%s&name=%s %s pages%s]'):format(
mw.title.getCurrentTitle().namespace, mw.uri.encode(title.text), p.num(frame, count), yesno (frame:getParent().args['article-space']) and 'articles' or 'pages')
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then