Tech, emailconfirmed, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Administrators
12,451
edits
Bongolium500 (talk | contribs) No edit summary |
Bongolium500 (talk | contribs) No edit summary |
||
(12 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
function p.recentReleases(frame) | function p.recentReleases(frame) | ||
local args = frame.args | local args = frame.args | ||
if not args["max"] or args["max"] == "" or not type(tonumber(args["max"])) == "number" then | |||
args["max"] = 8 | |||
end | |||
local outputText = "<div class=\"mainpage-box-recent\">\n" | local outputText = "<div class=\"mainpage-box-recent\">\n" | ||
Line 14: | Line 17: | ||
local side = "left" | local side = "left" | ||
while not done do | while not done do | ||
outputText = outputText .. "<div | outputText = outputText .. "<div class=\"recent-release-box\">" .. frame:preprocess(args[i]:gsub("{!%-%-" .. side .. "%-.-%-align%-%-}", ""):gsub("{!%-%-left%-", ""):gsub("{!%-%-right%-", ""):gsub("%-align%-%-}", "")) .. "</div>\n" | ||
if side == "left" then side = "right" else side = "left" end | if side == "left" then side = "right" else side = "left" end | ||
i = i + 1 | i = i + 1 | ||
if i > | if i > tonumber(args["max"]) then | ||
done = true | done = true | ||
elseif args[i] == null or args[i] == "" then | elseif args[i] == null or args[i] == "" then | ||
Line 23: | Line 26: | ||
end | end | ||
end | end | ||
outputText = outputText .. "</div>" | outputText = outputText .. "</table></div>" | ||
return outputText | return outputText | ||
end | end |
edits