Module:Transclusion count: Difference between revisions
From Test Wiki
Content deleted Content added
m 1 revision imported |
Add protection level for top 400 rows |
||
| Line 52: | Line 52: | ||
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i))) |
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i))) |
||
for name, count in pairs(data) do |
for name, count in pairs(data) do |
||
local title = mw.title.new(name, "Template") |
|||
table.insert(list, {title, count}) |
|||
end |
end |
||
end |
end |
||
| Line 60: | Line 61: | ||
local lang = mw.getContentLanguage(); |
local lang = mw.getContentLanguage(); |
||
for i = 1, #list do |
for i = 1, #list do |
||
local protLevel = "" |
|||
| ⚫ | |||
local title = list[i][1] |
|||
if i < 400 then |
|||
-- Stop at 400 to avoid breaching the expensive parser function call limit |
|||
protLevel = title.protectionLevels.edit[1] or "(unprotected)" |
|||
end |
|||
| ⚫ | |||
end |
end |
||
return table.concat(list) |
return table.concat(list) |
||