5233
редагування
Admin (обговорення | внесок) Немає опису редагування |
Admin (обговорення | внесок) Немає опису редагування |
||
| Рядок 344: | Рядок 344: | ||
if #player_facts > 0 then | if #player_facts > 0 then | ||
table.insert(result_parts, string.format("==== %s ====", page_title)) | |||
table.insert(result_parts, string.format("=== %s ===", page_title)) | |||
for _, fact in ipairs(player_facts) do | for _, fact in ipairs(player_facts) do | ||
table.insert(result_parts, fact) | table.insert(result_parts, fact) | ||
| Рядок 432: | Рядок 431: | ||
local raw = mw.text.trim(player_info[4]) | local raw = mw.text.trim(player_info[4]) | ||
if raw ~= "Відсутній" and raw ~= "-" and raw ~= "" then | if raw ~= "Відсутній" and raw ~= "-" and raw ~= "" then | ||
recruiter = raw | recruiter = raw | ||
end | end | ||
end | end | ||
| Рядок 445: | Рядок 444: | ||
local output = {} | local output = {} | ||
table.insert(output, "{{MCC Player New") | table.insert(output, "{{MCC Player New") | ||
table.insert(output, "| nickname = " .. player_name) | table.insert(output, "| nickname = " .. player_name) | ||
if stats and #stats >= 6 then | if stats and #stats >= 6 then | ||
local games = stats[3] or "0" | local games = stats[3] or "0" | ||
| Рядок 457: | Рядок 453: | ||
local winrate = stats[6] or "0" | local winrate = stats[6] or "0" | ||
winrate = mw.ustring.gsub(winrate, "%%", "") | winrate = mw.ustring.gsub(winrate, "%%", "") | ||
winrate = mw.text.trim(winrate) | winrate = mw.text.trim(winrate) | ||
| Рядок 476: | Рядок 471: | ||
table.insert(output, "| date_added = " .. date_added) | table.insert(output, "| date_added = " .. date_added) | ||
if foundation and #foundation >= 3 then | if foundation and #foundation >= 3 then | ||
local found = mw.ustring.gsub(foundation[3] or "0", "[^%d]", "") | local found = mw.ustring.gsub(foundation[3] or "0", "[^%d]", "") | ||
| Рядок 484: | Рядок 478: | ||
end | end | ||
if prize_pool and #prize_pool >= 2 then | if prize_pool and #prize_pool >= 2 then | ||
local prize = mw.ustring.gsub(prize_pool[2] or "0", "[^%d]", "") | local prize = mw.ustring.gsub(prize_pool[2] or "0", "[^%d]", "") | ||
| Рядок 492: | Рядок 485: | ||
end | end | ||
if finalist and #finalist >= 3 then | if finalist and #finalist >= 3 then | ||
local fin = mw.ustring.gsub(finalist[3] or "0", "[^%d]", "") | local fin = mw.ustring.gsub(finalist[3] or "0", "[^%d]", "") | ||
| Рядок 504: | Рядок 496: | ||
table.insert(output, "''[Тут додай опис гравця]''") | table.insert(output, "''[Тут додай опис гравця]''") | ||
table.insert(output, "") | table.insert(output, "") | ||
table.insert(output, "== Сезони ==") | table.insert(output, "== Сезони ==") | ||
table.insert(output, "{{#invoke:FetchData|season_achievements|player=" .. player_name .. "}}") | table.insert(output, "{{#invoke:FetchData|season_achievements|player=" .. player_name .. "}}") | ||
table.insert(output, "") | table.insert(output, "") | ||
table.insert(output, "== Нагороди в MCC ==") | table.insert(output, "== Нагороди в MCC ==") | ||
table.insert(output, titles_code) | table.insert(output, titles_code) | ||
table.insert(output, "") | table.insert(output, "") | ||
table.insert(output, "== Записи ігор ({{#invoke:FetchData|games_count_records|player=" .. player_name .. "}}) ==") | table.insert(output, "== Записи ігор ({{#invoke:FetchData|games_count_records|player=" .. player_name .. "}}) ==") | ||
table.insert(output, "{{#invoke:FetchData|player_games|player=" .. player_name .. "}}") | table.insert(output, "{{#invoke:FetchData|player_games|player=" .. player_name .. "}}") | ||
table.insert(output, "") | table.insert(output, "") | ||
table.insert(output, "== Цікаві факти ==") | table.insert(output, "== Цікаві факти ==") | ||
table.insert(output, facts_code) | table.insert(output, facts_code) | ||
-- | -- ВИПРАВЛЕННЯ: Виводимо як syntaxhighlight | ||
local final_code = table.concat(output, "\n") | |||
return frame:extensionTag{ | |||
name = 'syntaxhighlight', | |||
args = {lang = 'text'}, | |||
content = final_code | |||
} | |||
end | end | ||
| Рядок 547: | Рядок 537: | ||
table.insert(output, string.format("=== %d. %s ===", i, player_name)) | table.insert(output, string.format("=== %d. %s ===", i, player_name)) | ||
local player_code = p.generate_single_player({args = {player = player_name}}) | local player_code = p.generate_single_player({args = {player = player_name}}) | ||
table.insert(output, | table.insert(output, player_code) | ||
table.insert(output, "\n----\n") | table.insert(output, "\n----\n") | ||
end | end | ||