Modul:ArtikelDesTages: Unterschied zwischen den Versionen

Aus LASK Wiki
Zur Navigation springen Zur Suche springen
Die Seite wurde neu angelegt: „local p = {} local artikel = { "Anleitungen", "Projekte", "Downloads", "FAQ", "Neuigkeiten", "Über das Wiki", "Geschichte", "Technik", "Glossar", "Tipps und Tricks" } function p.main(frame) local tag = tonumber(frame:preprocess("{{CURRENTDAY}}")) local monat = tonumber(frame:preprocess("{{CURRENTMONTH}}")) local jahr = tonumber(frame:preprocess("{{CURRENTYEAR}}")) local wert = jahr * 10000 + mon…“
 
Keine Bearbeitungszusammenfassung
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 2: Zeile 2:


local artikel = {
local artikel = {
    "Anleitungen",
"Saison 2017/18",
    "Projekte",
"Saison 2018/19",
    "Downloads",
     "Saison 2019/20",
     "FAQ",
     "Saison 2020/21",
     "Neuigkeiten",
     "Saison 2021/22",
     "Über das Wiki",
     "Saison 2022/23",
     "Geschichte",
     "Saison 2023/24",
     "Technik",
     "Saison 2024/25",
     "Glossar",
     "Saison 2025/26"
     "Tipps und Tricks"
}
}


Zeile 23: Zeile 22:


     local index = (wert % #artikel) + 1
     local index = (wert % #artikel) + 1
     local titel = artikel[index]
     local titel = artikel[index]


     return string.format(
     return "[[" .. titel .. "|" .. titel .. "]]"
        "[[%s|%s]]",
        titel,
        titel
    )
end
end


return p
return p

Aktuelle Version vom 3. September 2026, 10:28 Uhr

Die Dokumentation für dieses Modul kann unter Modul:ArtikelDesTages/Doku erstellt werden

local p = {}

local artikel = {
	"Saison 2017/18",
	"Saison 2018/19",
    "Saison 2019/20",
    "Saison 2020/21",
    "Saison 2021/22",
    "Saison 2022/23",
    "Saison 2023/24",
    "Saison 2024/25",
    "Saison 2025/26"
}

function p.main(frame)

    local tag = tonumber(frame:preprocess("{{CURRENTDAY}}"))
    local monat = tonumber(frame:preprocess("{{CURRENTMONTH}}"))
    local jahr = tonumber(frame:preprocess("{{CURRENTYEAR}}"))

    local wert = jahr * 10000 + monat * 100 + tag

    local index = (wert % #artikel) + 1

    local titel = artikel[index]

    return "[[" .. titel .. "|" .. titel .. "]]"
end

return p