Homepage
Games
News
News βΎ
All
Transfers
Drama
Business
Sponsors
Mergers
Investors
Hires
Companies
More
People
Tournaments
Brands
Brands βΎ
Companies
Organizations
Sponsors
Other
Locations
Search
Editing
Module:GameLanding/Upcoming matches
From TwogPedia
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local cargo = mw.ext.cargo local p = {} local Functions = require('Module:Functions') local getTeamLogo = Functions.getTeamLogo local prizeToString = Functions.prizeToString local timeUntil = Functions.timeUntil function p.upcomingMatches(game) local tables = 'AllMatches' local fields = '_pageName, date, p1, p2, winner' local currentDate = os.date('%Y-%m-%d') local cargoArgs = { where = '_pageName LIKE "' .. game .. '/%" AND ( date > "' .. currentDate .. '" OR winner=0)', orderBy = 'date ASC', limit = 10 } local results = cargo.query(tables, fields, cargoArgs) if #results > 0 then local list = '' local header = mw.html.create('div'):addClass('transfer__header transfer__row'):node(mw.html.create('div'):wikitext('Time')):node(mw.html.create('div'):wikitext('Team 1')):node(mw.html.create('div'):wikitext('')):node(mw.html.create('div'):wikitext('Team 2')) local wrapper = mw.html.create('div'):addClass('transfer__container'):node(header) local header = mw.html.create('div'):addClass('transfer__header'):node(mw.html.create('div'):wikitext('Time')):node(mw.html.create('div'):wikitext('Team 1')):node(mw.html.create('div'):wikitext('')):node(mw.html.create('div'):wikitext('Team 2')) local container = mw.html.create('div'):addClass('box__container'):node(mw.html.create('div'):addClass('box__title'):wikitext('Upcoming matches')):node(wrapper) for i = 1, #results do local result = results[i] if result.p1 or result.p2 then result.p1 = result.p1 or 'TBD' result.p2 = result.p2 or 'TBD' local row = mw.html.create('div'):addClass('transfer__row') local time = mw.html.create('div') local team1 = mw.html.create('div') local vs = mw.html.create('div'):wikitext('[[' .. result._pageName .. '|vs]]') local team2 = mw.html.create('div') time:wikitext(timeUntil(result.date)) team1:node(mw.html.create('div'):addClass('transfer__player'):node(getTeamLogo(result.p1, game)):node('[[' .. result.p1 .. '|' .. string.gsub(result.p1, game .. '/', '') .. ']]')) team2:node(mw.html.create('div'):addClass('transfer__player'):node(getTeamLogo(result.p2, game)):node('[[' .. result.p2 .. '|' .. string.gsub(result.p2, game .. '/', '') .. ']]')) row:node(time):node(team1):node(vs):node(team2) wrapper:node(row) end end return container end return nil end return p
Summary:
Please note that all contributions to TwogPedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
TwogPedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Template used on this page:
Module:GameLanding/Upcoming matches/doc
(
edit
)
No categories
Edit