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