Module:High-use: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Please be careful not to overwrite local changes when importing) |
mNo edit summary |
||
Line 1: | Line 1: | ||
local p = {} |
local p = {} |
||
local _fetch = require('Module:Transclusion_count').fetch |
|||
function p.num(frame, count) |
function p.num(frame, count) |
||
if count == nil then count = _fetch(frame) end |
|||
-- Build output string |
-- Build output string |
||
local return_value = "" |
local return_value = "" |
||
Line 51: | Line 55: | ||
function p.text(frame, count) |
function p.text(frame, count) |
||
local bot_text = "\n\n----\nTransclusion count updated by [[User:Ahechtbot|Ahechtbot]]." |
|||
if frame.args["nobot"] == true then |
|||
bot_text = "" |
|||
end |
|||
if count == nil then count = _fetch(frame) end |
|||
local return_value = {} |
local return_value = {} |
||
Line 58: | Line 68: | ||
end |
end |
||
local templatecount = string.format("https://templatecount.toolforge.org/index.php?lang=en&namespace=%s&name=%s",mw.title.getCurrentTitle().namespace,mw.uri.encode(title.text)) |
|||
⚫ | |||
⚫ | |||
(mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template"), |
(mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template"), |
||
templatecount, |
|||
p.num(frame, count) |
p.num(frame, count) |
||
) |
) |
||
Line 66: | Line 79: | ||
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"), |
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"), |
||
title.fullText, title.fullText, |
title.fullText, title.fullText, |
||
(mw.title.getCurrentTitle().namespace == 828 and "." or ", or in your own user subpage.") |
(mw.title.getCurrentTitle().namespace == 828 and "." or ", or in your own [[Wikipedia:Subpages#How to create user subpages|user subpage]].") |
||
) |
) |
||
Line 90: | Line 103: | ||
end |
end |
||
return table.concat({used_on_text, sandbox_text, discussion_text, " |
return table.concat({used_on_text, sandbox_text, discussion_text, "before implementing them.", bot_text}) |
||
end |
end |
||
function p.main(frame) |
function p.main(frame) |
||
local |
local count = _fetch(frame) |
||
local count = tonumber(frame:callParserFunction('formatnum', arg1, 'R')) |
|||
local return_value = "" |
local return_value = "" |
||
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]" |
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]" |