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:NewsSource
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 getArgs = require('Module:Arguments').getArgs local NewsSource = {} local cargo = mw.ext.cargo function NewsSource.main(frame) local args = getArgs(frame) local span = mw.html.create('span') local currentDate = os.date('%Y-%m-%d') local tables = 'Logos' local fields = '_pageName, logoLight, logoDark, logoAll, start, end, iconLight, iconDark, iconAll' local cargoArgs = { where = '_pageName="Company/' .. args.source .. '" AND (start is NULL OR start < "' .. currentDate .. '") AND (end is NULL OR end > "' .. currentDate .. '")' } local results = cargo.query(tables, fields, cargoArgs) if #results > 0 then local result = results[1] local icon = result.iconAll or result.iconLight or result.iconDark or result.logoAll or result.logoLight or result.logoDark or 'Team placeholder light.png' span:wikitext('[[File:' .. icon .. '|30px|link=' .. args.url .. ']]') else span:wikitext('[[File:' .. args.source .. '.png|30px|link=' .. args.url .. ']]') end return span end return NewsSource
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:NewsSource/doc
(
edit
)
No categories
Edit