Anonimo

Modulo:DTSpecific: differenze tra le versioni

Da Wikitrek.
Modular SecBoxContent
m (Format)
(Modular SecBoxContent)
Riga 215: Riga 215:
local Preposizione
local Preposizione
local Others
local Others
local Separator ="<hr />"
local FullOutput = true
local Output = {}
--Series
--Series
Riga 220: Riga 223:
--Function is called from unliked page
--Function is called from unliked page
Series = mw.wikibase.getEntity(frame.args[1])
Series = mw.wikibase.getEntity(frame.args[1])
Separator = " | "
FullOutput = false
elseif mw.wikibase.getEntity().claims["P14"][1].mainsnak.datavalue.value.id == "Q13" then
elseif mw.wikibase.getEntity().claims["P14"][1].mainsnak.datavalue.value.id == "Q13" then
Series = mw.wikibase.getEntity()
Series = mw.wikibase.getEntity()
Riga 253: Riga 258:
end
end
Categories = tostring(UL)
Categories = tostring(UL)
table.insert(Output, Categories)
Quantity = SeasonsQty(Short)
Quantity = SeasonsQty(Short)
Riga 277: Riga 284:
end
end
Seasons = tostring(UL)
Seasons = tostring(UL)
table.insert(Output, Seasons)
end
end
--Other pages
if FullOutput then
UL = mw.html.create('ul')
--Other pages
UL
UL = mw.html.create('ul')
:attr('class', "compactul")
UL
:attr('title', "Altre pagine")
:attr('class', "compactul")
:attr('title', "Altre pagine")
LI =  mw.html.create('li')
LI:wikitext("[[Personaggi ricorrenti " .. Preposizione .. " " .. Short .. "]]")
UL:node(LI)
LI = mw.html.create('li')
Others = tostring(UL)
LI:wikitext("[[Personaggi ricorrenti " .. Preposizione .. " " .. Short .. "]]")
table.insert(Output, Others)
UL:node(LI)
end
Others = tostring(UL)
if FullOutput then
--All Series
local SeriesQuery = mw.smw.getQueryResult('[[Istanza::Serie]]|?Abbreviazione|sort=Ordinale|order=asc')
if SeriesQuery == nil then
        Series = "''Nessun risultato''"
    end
--All Series
    if type(SeriesQuery) == "table" then
local SeriesQuery = mw.smw.getQueryResult('[[Istanza::Serie]]|?Abbreviazione|sort=Ordinale|order=asc')
    UL = mw.html.create('ul')
UL
if SeriesQuery == nil then
:attr('class', "compactul")
        Series = "''Nessun risultato''"
:attr('title', "Tutte le serie")
    end
    for _, CurrSeries in ipairs(SeriesQuery.results) do
    --In the output, example:
    --"fulltext": "Star Trek: Strange New Worlds",
    LI = mw.html.create('li')
        LI:wikitext("[[" .. CurrSeries.fulltext .. "|" .. CurrSeries.printouts.Abbreviazione[1] .. "]]")
       
        UL:node(LI)
    end
    Series = tostring(UL)
    else
    Series = "''Il risultato non è una TABLE''"
    end
    table.insert(Output, Series)
end


    if type(SeriesQuery) == "table" then
--return Categories .. "<hr />" .. Seasons .. "<hr />" .. Others .. "<hr />" .. Series  
    UL = mw.html.create('ul')
return table.concat(Output, Separator)
UL
:attr('class', "compactul")
:attr('title', "Tutte le serie")
    for _, CurrSeries in ipairs(SeriesQuery.results) do
    --In the output, example:
    --"fulltext": "Star Trek: Strange New Worlds",
    LI =  mw.html.create('li')
        LI:wikitext("[[" .. CurrSeries.fulltext .. "|" .. CurrSeries.printouts.Abbreviazione[1] .. "]]")
       
        UL:node(LI)
    end
    Series = tostring(UL)
    else
    Series = "''Il risultato non è una TABLE''"
    end
return Categories .. "<hr />" .. Seasons .. "<hr />" .. Others .. "<hr />" .. Series  
--[==[
--[==[
<strong>Categorie</strong>
<strong>Categorie</strong>