Module:High-use: Difference between revisions
Jump to navigation
Jump to search
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.
>Trappist the monk (+support for |article-space=yes;) |
>Ahecht (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.) |
||
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('NUMBEROFPAGES', 'R') ) * 100) + 0.5) | |||
local percent = math.floor( ( (count/frame:callParserFunction( | |||
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 88: | Line 86: | ||
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 pages]'):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)) | ||
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 |