Module:Available

-- -- LUA script to display Latest Items Info on Main Page -- --

local p = {}

local LatestData = mw.loadData( 'Module:LatestInfo/data' ) local LTE = require ("Module:LTEvent").getLast local Update = require("Module:UpdateNumber").getLast

local function MiniEvents(frame) local retText = ""

if frame == mw.getCurrentFrame then for _, v in ipairs(LatestData["ME"]) do           retText = retText .. "* "                   .. frame:expandTemplate{ title = 'ME', args = { v[1] or "", v[2] or "" }} .. " "                   .. (v[3] or "") .. " \n" end else for _, v in ipairs(LatestData["ME"]) do           retText = retText .. "* "                   .. (v[1] or "") .. " "                   .. (v[3] or "") .. " \n" end end return retText end

local function Characters local retText = "" for _, v in ipairs(LatestData["C"]) do       local linkText = v[1] or ""

if v[2] then linkText = ":Category:" .. (v[1] or "") .. "|"                       .. (v[1] or "") end retText = retText .. "* "               .. linkText                .. " " .. (v[3] or "") .. " \n" end return retText end

function p.latest(frame)

local tArgs

if frame == mw.getCurrentFrame then fParent = frame:getParent tArgs = fParent.args

if (fParent.args[1]) then tArgs = fParent.args else tArgs = frame.args end else tArgs = frame end

local header = '{|width="100%"\n' .. '|- valign="top" cellpadding="0px"' .. ' cellspacing="0px"\n' .. '|style="width:50%; padding: .0em;'                   .. ' border: 1px solid #cbcbcb;'                    .. ' color: #000;'                    .. ' background-color: #e5e5ea;"|\n' local foot1 = '' .. ' For more '

local foot2 = '|here]] \n|}\n'

local outText = '\n' .. '{| class="" style="background-color:transparent;'                   .. ' color:inherit; width:100%;"\n' .. '|-\n' .. '| valign="top" style="width:50%;" |\n\n'

outText = outText .. "==Latest Major Events==\n" .. header .. LTE({"5"}) .. foot1 .. "events, click [[:Category:Events"                   .. foot2

outText = outText .. "==Latest Mini Events==\n" .. header .. MiniEvents(frame) .. foot1 .. "events, click [[:Category:Mini Events"                   .. foot2

outText = outText .. '\n| valign="top" style="width:50%;" |\n\n'

outText = outText .. "==Latest Updates==\n" .. header .. Update({}) .. foot1 .. "updates, click [[Content Updates"                   .. foot2

outText = outText .. "==Latest Characters==\n" .. header .. Characters .. foot1 .. "characters, click [[:Category:Character Collections"                   .. foot2

outText = outText .. "|}\n"

return outText end

return p

-- --