Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 2: Строка 2:


function p.increment(frame)
function p.increment(frame)
     local count = mw.getContentLanguage():getContentLanguage():getCode()
     local page_title = mw.title.getCurrentTitle().text


     local current_count = mw.getCache():get("call_counter_" .. count) or 0
     local current_count = mw.getCache():get("call_counter_" .. page_title) or 0


     current_count = current_count + 1
     current_count = current_count + 1


     mw.getCache():set("call_counter_" .. count, current_count)
     mw.getCache():set("call_counter_" .. page_title, current_count)


     return "Модуль вызван " .. current_count .. " раз(а) на этой странице."
     return "Модуль вызван " .. current_count .. " раз(а) на странице " .. page_title .. "."
end
end


return p
return p