Modulo:DTBase: differenze tra le versioni

Da Wikitrek.
mNessun oggetto della modifica
Wikimedia Commons description added
 
(13 versioni intermedie di uno stesso utente non sono mostrate)
Riga 132: Riga 132:
demb = 'Memory Beta (tedesco)',
demb = 'Memory Beta (tedesco)',
fanlore = 'Fanlore',
fanlore = 'Fanlore',
trekipedia = 'Trekipedia'
trekipedia = 'Trekipedia',
commonswiki = 'Wikimedia Commons'
}
}
Riga 158: Riga 159:
function p.ExternalID(frame)
function p.ExternalID(frame)
local AllExtID = {}
local AllExtID = {}
local AllSources = {}
local AllSources
local SourcesP = {}
local SourcesP = {}
local Item = mw.wikibase.getEntity()
local Item = mw.wikibase.getEntity()
local AllP
local AllP
local finalList
local finalList = ""
if not Item then
if not Item then
Item = mw.wikibase.getEntity('Q1')
Item = mw.wikibase.getEntity('Q1')
Riga 176: Riga 177:
if (SourcesP[Property]) then
if (SourcesP[Property]) then
--ID is for external source
--ID is for external source
table.insert(AllSources, "* " .. frame:expandTemplate{title = 'CitazioneIEEE', args = {'Contributori Memory Alpha', 'Gaila (Orioniana)', 'Memory Alpha', '2025-03-16', p.ExtIDLink(Property, Item.claims[Property][1].mainsnak.datavalue.value)}})
if AllSources == nil then
AllSources = {}
end
table.insert(AllSources, "* " .. frame:expandTemplate{title = 'CitazioneIEEE', args = {'Contributori Memory Alpha', Item.sitelinks['itma'].title, 'Memory Alpha', Item.claims[Property][1].qualifiers['P201'][1].datavalue.value.time, p.ExtIDLink(Property, Item.claims[Property][1].mainsnak.datavalue.value)}})
else
else
--ID is normal external link
--ID is normal external link
Riga 184: Riga 189:
end
end
finalList = table.concat(AllExtID, string.char(10))
if AllExtID ~= nil and AllExtID ~= "" then
if AllSources ~= nil then
finalList = table.concat(AllExtID, string.char(10))
finalList = finalList .. string.char(10) .. "== Fonti Esterne (experimental) ==" .. string.char(10) .. table.concat(AllSources, string.char(10))
end
end
if AllSources ~= nil and AllSources ~= "" then
finalList = finalList .. string.char(10) .. "== Fonti Esterne (" .. frame:expandTemplate{title = 'Beta'} .. ") ==" .. string.char(10) .. table.concat(AllSources, string.char(10))
end
mw.smw.set("finalList = " .. finalList)
return finalList
return finalList
Riga 205: Riga 214:
URL = mw.wikibase.getEntity(Property).claims[ExtIDP][1].mainsnak.datavalue.value
URL = mw.wikibase.getEntity(Property).claims[ExtIDP][1].mainsnak.datavalue.value
if string.find(Value, "[%%%+%-%*%?]") ~= nil then
if string.find(Value, "[%%%+%-%*%?]") ~= nil and string.find(Value, " ") ~= nil then
FullLink = string.gsub(URL, '$1', mw.uri.encode(Value, "QUERY"):gsub("%%", "%%%%"))
FullLink = string.gsub(URL, '$1', mw.uri.encode(Value, "QUERY"):gsub("%%", "%%%%"))
else
else