Änderungen

150 Bytes hinzugefügt ,  00:23, 19. Dez. 2021
keine Bearbeitungszusammenfassung
Zeile 3: Zeile 3:  
function p.getOfficalAuthors( frame )
 
function p.getOfficalAuthors( frame )
 
local ReturnString =" "
 
local ReturnString =" "
 +
local AuthorList = {}
 
--liste aller Publikationen, Autoren sind ein attribut der liste
 
--liste aller Publikationen, Autoren sind ein attribut der liste
 
local queryResult =  mw.smw.ask('[[Hauptkategorie::Publikation]][[Kanon::offiziell]]|?Autoren=2|mainlabel=-|limit=500')
 
local queryResult =  mw.smw.ask('[[Hauptkategorie::Publikation]][[Kanon::offiziell]]|?Autoren=2|mainlabel=-|limit=500')
Zeile 9: Zeile 10:  
do
 
do
 
if (type(queryResult[i][1]) == "table") then
 
if (type(queryResult[i][1]) == "table") then
 +
-- mutiple authors so we have a table
 
local n = 1
 
local n = 1
 
while n <= table.getn(queryResult[i][1])  
 
while n <= table.getn(queryResult[i][1])  
Zeile 18: Zeile 20:  
 
 
else
 
else
 +
-- only one author
 +
AuthorList[table.getn(AuthorList +1)] = queryResult[i][1]
 
ReturnString = ReturnString .. queryResult[i][1] .. '<br>'
 
ReturnString = ReturnString .. queryResult[i][1] .. '<br>'
 
end
 
end