Вычисление количества персоналий с фотографиями.
Вызов функции:
{{#invoke:CountPerson|main}}
Значение функции:
1
local p = {}
function p.main(frame)
local result = frame:preprocess([[{{#cargo_query:tables=Persona |fields=COUNT(*)=Count |where=Persona.Image IS NOT NULL AND Persona.Image<>''}}]])
local count = tonumber(string.match(result, "%d+"))
return count
end
return p