Anonimo

Modulo:DTEpisodio: differenze tra le versioni

Da Wikitrek.
Link alla stagione
(Comments)
(Link alla stagione)
 
(11 versioni intermedie di uno stesso utente non sono mostrate)
Riga 1: Riga 1:
-- Keyword: wikitrek
-- Keyword: wikitrek
local LabelOrLink = require('Modulo:DTBase').LabelOrLink
local LabelOrLink = require('Modulo:DTBase').LabelOrLink
local DescrWithTemplate = require('Modulo:DTGenerico').DescrWithTemplate


local p = {}
local p = {}
Riga 12: Riga 13:
end
end
if not AddSemantic then
if AddSemantic == nil then
AddSemantic = true
AddSemantic = true
end
end
Riga 93: Riga 94:
if MakeWikiLink then
if MakeWikiLink then
if AddSemantic then
if AddSemantic then
--Result['Character'] = Prefix .. '[[Personaggio::' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix .. frame:callParserFunction('#set:', CharLabel .. '=' .. actorLabel)
if string.sub(CharLink, 1, 8) == "Special:" then
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix  .. frame:callParserFunction('#set:', 'Personaggio=' .. CharLabel)
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix .. frame:callParserFunction('#set:', 'Personaggio=' .. CharLabel)
else
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix  .. frame:callParserFunction('#set:', 'Personaggio=' .. CharLink)
end
else
else
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix
Riga 105: Riga 109:
if AddSemantic then
if AddSemantic then
--Result['Actor'] = '[[Interprete::' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLabel)
--Result['Actor'] = '[[Interprete::' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLabel)
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLabel) .. frame:callParserFunction('#set:', 'Interprete=' .. actorLabel)
if string.sub(CharLink, 1, 8) == "Special:" then
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLabel) .. frame:callParserFunction('#set:', 'Interprete=' .. actorLabel)
else
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLink) .. frame:callParserFunction('#set:', 'Interprete=' .. actorLabel)
end
else
else
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]'
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]'
Riga 118: Riga 126:
local CurrItem = mw.wikibase.getEntityIdForCurrentPage()
local CurrItem = mw.wikibase.getEntityIdForCurrentPage()
if not CurrItem then
if not CurrItem then
CurrItem = 'Q1'
return nil
end
end
Riga 127: Riga 135:
local Results = {}
local Results = {}
local Statements = mw.wikibase.getAllStatements(CurrItem, 'P2')
local Statements = mw.wikibase.getAllStatements(CurrItem, 'P2')
if #Statements == 0 then
return nil
end
for _, Statement in pairs(Statements) do
for _, Statement in pairs(Statements) do
local Result
local Result
Riga 285: Riga 298:
if not mw.wikibase.getDescription() then
if not mw.wikibase.getDescription() then
if not mw.wikibase.getEntity().claims['P20'] then
if not mw.wikibase.getEntity().claims['P20'] then
return "'''''" .. mw.title.getCurrentTitle().text .. "''''' è un episodio della stagione " .. SeasonData.SeasonNumber .. " di ''[[" .. SeasonData.SeriesName .. "]]''." .. string.char(10)
return "'''''" .. mw.title.getCurrentTitle().text .. "''''' è un episodio della [[Stagione " .. SeasonData.SeasonNumber .. " di " .. SeasonData.SeriesAbbr .. "|stagione " .. SeasonData.SeasonNumber .. "]] di ''[[" .. SeasonData.SeriesName .. "]]''." .. string.char(10)
else
else
return "''''" .. mw.title.getCurrentTitle().text .. "'''' è " .. mw.wikibase.getEntity().claims['P20'][1].mainsnak.datavalue['value'] .. string.char(10)
return "''''" .. mw.title.getCurrentTitle().text .. "'''' è " .. mw.wikibase.getEntity().claims['P20'][1].mainsnak.datavalue['value'] .. string.char(10)
end
end
else
else
return "'''''" .. mw.title.getCurrentTitle().text .. "'''''" .. " è " .. mw.wikibase.getDescription() .. string.char(10)
--return "'''''" .. mw.title.getCurrentTitle().text .. "'''''" .. " è " .. mw.wikibase.getDescription() .. string.char(10)
return "'''''" .. mw.title.getCurrentTitle().text .. "'''''" .. " è " .. DescrWithTemplate(frame) .. string.char(10)
end
end
end
end
return p
return p