Module:High-use: Difference between revisions
Jump to navigation
Jump to search
+support for |article-space=yes;
>Ahecht (implement fetch parameter) |
>Trappist the monk (+support for |article-space=yes;) |
||
Line 43: | Line 43: | ||
-- Insert percentage of pages if that is likely to be >= 1% | -- Insert percentage of pages if that is likely to be >= 1% | ||
if count and count > 250000 then | if count and count > 250000 then | ||
local percent = math.floor( ( (count/frame:callParserFunction( | local magic_word = yesno (frame:getParent().args['article-space']) and 'NUMBEROFARTICLES' or 'NUMBEROFPAGES'; | ||
local percent = math.floor( ( (count/frame:callParserFunction(magic_word, 'R') ) * 100) + 0.5) | |||
if percent >= 1 then | if percent >= 1 then | ||
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent) | return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent) | ||
Line 86: | Line 88: | ||
end | end | ||
local templateCount = ('on [https://templatecount.toolforge.org/index.php?lang=en&namespace=%s&name=%s %s | local templateCount = ('on [https://templatecount.toolforge.org/index.php?lang=en&namespace=%s&name=%s %s %s]'):format( | ||
mw.title.getCurrentTitle().namespace, mw.uri.encode(title.text), p.num(frame, count)) | 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 '; | local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used '; | ||
if systemMessages then | if systemMessages then |