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:PageTabs team
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 = {} function p.main(frame) local currentTitle = mw.title.getCurrentTitle().text local split = mw.text.split(currentTitle, '/') local parent = split[1] .. '/' .. split[2] local subPage = split[3] local str = '{{Tabs|name1=Overview|link1=' .. parent local order = 1 if subPage == 'Results' then order = order + 1 str = str .. '|name' .. order .. '=Results' .. '|link' .. order .. '=' .. currentTitle else -- Check if has results local tables = "AllMatches" local fields = '_pageName' local cargoArgs = { where = '(p1 = "' .. parent .. '" OR p2="' .. parent .. '") AND winner IS NOT NULL AND winner != "0"', limit = 1, } local soloMatches = cargo.query(tables, fields, cargoArgs) local hadResults = false if #soloMatches > 0 then hadResults = true else -- Check if part of tournament prizes tables = 'Participants, Prizes' fields = 'Participants._pageName=_pageName' cargoArgs = { join = 'Participants._pageName=Prizes._pageName', where = 'Participants.team = "' .. parent .. '"', limit = 1 } local placementResults = cargo.query(tables, fields, cargoArgs) if #placementResults > 0 then hadResults = true end end if hadResults then order = order + 1 str = str .. '|name' .. order .. '=Results' .. '|link' .. order .. '=' .. parent .. '/Results' end end str = str .. '}}' if order > 1 then return frame:preprocess(str) end 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:PageTabs team/doc
(
edit
)
No categories
Edit