Modul:Turnierritter: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 28: | Zeile 28: | ||
function ausgabe(zeile) | function ausgabe(zeile) | ||
local | local spalte={} | ||
s= | for k,v in pairs(zeile) do | ||
..'\n|<span style="display:none;">'.. | spalte[k]=robusttrim(zeile[k]) | ||
..'\n|[['.. | end | ||
..'\n|'.. | s='|-' | ||
..'\n|'.. | ..'\n|<span style="display:none;">'..spalte[9]..'</span>[['..spalte[7]..'|50x50px|link=]]' | ||
..'\n|[['..spalte[8]..'|50x50px|link=]]' | |||
..'\n|'..spalte[1] | |||
..'\n|'..spalte[2] | |||
..'\n|' | ..'\n|' | ||
if | if spalte[3]~="unbekannt" then s=s..spalte[3] end | ||
local sort=0 | local sort=0 | ||
if | if spalte[4]=='Neuling' then sort=1 end | ||
if | if spalte[4]=='Mittelmaß' then sort=2 end | ||
if | if spalte[4]=='Favorit' then sort=3 end | ||
if | if spalte[4]=='Legende' then sort=4 end | ||
s=s..'\n|<span style="display:none;">'..sort..'</span>'.. | s=s..'\n|<span style="display:none;">'..sort..'</span>'..spalte[4] | ||
..'\n|' | ..'\n|' | ||
if | if spalte[5]~="unbekannt" then s=s..spalte[5] end | ||
s=s..'|'.. | s=s..'|'..spalte[6] | ||
end | end | ||
Version vom 24. Juni 2024, 18:57 Uhr
Dokumentation unter Modul:Turnierritter/Doku.
require("Modul:Hilfsfunktionen") local p = {} function abfrage(query) local reiter=mw.smw.ask("[[Kategorie:Turnierritter]] "..query .."|mainlabel=-" .."|?#" .."|?Alter" .."|?Turnierstatus" .."|?Turnierklasse" .."|?Turnierpublikum" .."|?Turnieranmerkung" .."|?Wappen ist#" .."|?Bild ist#" .."|?Sortierschlüssel" .."|?Mitgliedswappen ist#" .."|format=template" .."|template=Turnierritter" .."|searchlabel=" .."|limit=500" ) if reiter==nil then return {} end return reiter end function ausgabe(zeile) local spalte={} for k,v in pairs(zeile) do spalte[k]=robusttrim(zeile[k]) end s='|-' ..'\n|<span style="display:none;">'..spalte[9]..'</span>[['..spalte[7]..'|50x50px|link=]]' ..'\n|[['..spalte[8]..'|50x50px|link=]]' ..'\n|'..spalte[1] ..'\n|'..spalte[2] ..'\n|' if spalte[3]~="unbekannt" then s=s..spalte[3] end local sort=0 if spalte[4]=='Neuling' then sort=1 end if spalte[4]=='Mittelmaß' then sort=2 end if spalte[4]=='Favorit' then sort=3 end if spalte[4]=='Legende' then sort=4 end s=s..'\n|<span style="display:none;">'..sort..'</span>'..spalte[4] ..'\n|' if spalte[5]~="unbekannt" then s=s..spalte[5] end s=s..'|'..spalte[6] end function p.turnierreiter(frame) local query=robusttrim(frame.args[1]) local reiter=abfrage(query) local s="" for _,v in pairs(reiter) do s=s..ausgabe(v) end return s end return p