Modulo:Vivtempo: Malsamoj inter versioj

[kontrolita revizio][kontrolita revizio]
Enhavo forigita Enhavo aldonita
Problemo riparita: https://eo.wikipedia.org/w/index.php?title=Uzanto-Diskuto%3ARobin_van_der_Vliet&type=revision&diff=6808598&oldid=6799763
Neniu resumo de redakto
Linio 7:
local birth = {}
local death = {}
local living = true
 
local nameArg = frame.args[1] or ""
Linio 16 ⟶ 17:
end
 
if birthArg =~= "" then
for w in birthArg:gmatch("([^/]+)") do
table.insert(birth, w)
end
 
birth[2] = tonumber(birth[2])
elseif id ~= nil then
local birthTable = mw.wikibase.getBestStatements(id, "P569")
 
Linio 23 ⟶ 30:
table.insert(birth, birthTable[1]["mainsnak"]["datavalue"]["value"]["precision"])
end
else
for w in birthArg:gmatch("([^/]+)") do
table.insert(birth, w)
end
 
birth[2] = tonumber(birth[2])
end
 
if deathArg =~= "" then
for w in deathArg:gmatch("([^/]+)") do
table.insert(death, w)
end
 
death[2] = tonumber(death[2])
elseif id ~= nil then
local deathTable = mw.wikibase.getBestStatements(id, "P570")
 
Linio 38 ⟶ 45:
table.insert(death, deathTable[1]["mainsnak"]["datavalue"]["value"]["precision"])
end
else
for w in deathArg:gmatch("([^/]+)") do
table.insert(death, w)
end
 
death[2] = tonumber(death[2])
end
 
if id ~= nil then
local genderTable = mw.wikibase.getBestStatements(id, "P21")
 
for k, v in pairs(genderTable) do
local genderId = v["mainsnak"]["datavalue"]["value"]["id"]
 
if genderId == "Q6581097" or genderId == "Q2449503" then
categories = categories .. "[[Kategorio:Viroj]]"
elseif genderId == "Q6581072" or genderId == "Q1052281" then
categories = categories .. "[[Kategorio:Virinoj]]"
elseif genderId == "Q1097630" then
categories = categories .. "[[Kategorio:Interseksuloj]]"
elseif genderId == "Q48270" or genderId == "Q505371" or genderId == "Q7130936" then
categories = categories .. "[[Kategorio:Neduumuloj]]"
end
end
end
Linio 67 ⟶ 70:
 
if precision >= 9 then
local year = tonumber(string.sub(timeValue, 2, 5))
categories = categories .. "[[Kategorio:Naskiĝintoj en " .. year .. "]]"
 
if year < 1900 then
living = false
end
 
if precision >= 11 then
Linio 111 ⟶ 118:
 
if precision >= 9 then
local year = tonumber(string.sub(timeValue, 2, 5))
categories = categories .. "[[Kategorio:Mortintoj en " .. year .. "]]"
 
Linio 148 ⟶ 155:
categories = categories .. "[[Kategorio:Mortintoj en " .. decade .. "0-" .. decade .. "9]]"
end
 
else
living = false
elseif living then
categories = categories .. "[[Kategorio:Vivantaj homoj]]"
end