Модуль:UserInfo
Материал из Space Station 14 Вики
Для документации этого модуля может быть создана страница Модуль:UserInfo/doc
local p = {}
function p.getServersInfo(frame)
local servers = frame.args[1]
local categories = servers
servers = servers:gsub(',', '}}\n*{{abb|')
categories = categories:gsub(',', ']] [[Категория:Редактор ')
return frame:preprocess('*{{abb|'.. servers.. '}} '.. '[[Категория:Редактор '.. categories.. ']]')
end
function p.getRolesInfo(frame)
local roles = frame.args[1]
t = {}
for str in string.gmatch(roles, ', ') do
table.insert(t, str)
end
local categories = ""
for i in pairs(t) do
if t[i] == "Викидел" or t[i] == "викидел" or t[i] == "Кивикед" or t[i] == "кивикед" then categories = categories.. "[[Категория:Викиделы]]" end
if t[i] == "лоровед" or t[i] == "Лоровед" or t[i] == "Лороед" or t[i] == "лороед" then categories = categories.. "[[Категория:Лороведы]]" end
if t[i] == "Куратор вики" or t[i] == "куратор вики" then categories = categories.. "[[Категория:Кураторы раздела]]" end --Потом доделаю
end
return t
--return frame:preprocess(categories)
end
return p