<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://staging.twogpedia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AGameLanding%2FFeatured_tournament</id>
	<title>Module:GameLanding/Featured tournament - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://staging.twogpedia.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AGameLanding%2FFeatured_tournament"/>
	<link rel="alternate" type="text/html" href="https://staging.twogpedia.com/index.php?title=Module:GameLanding/Featured_tournament&amp;action=history"/>
	<updated>2026-09-26T07:39:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://staging.twogpedia.com/index.php?title=Module:GameLanding/Featured_tournament&amp;diff=6223&amp;oldid=prev</id>
		<title>Couchor: Created page with &quot;local cargo = mw.ext.cargo local p = {} local prizeToString = require(&#039;Module:Functions&#039;).prizeToString  function p.featured(game) 	local tables = &#039;Tournaments&#039; 	local fields = &#039;_pageName, start, end, prize, logoAll, logoLight, logoDark, iconAll, iconLight, iconDark, venue&#039; 	local currentDate = os.date(&#039;%Y-%m-%d&#039;) 	local cargoArgs = { 		where = &#039;featured=&quot;1&quot; AND _pageName LIKE &quot;&#039; .. game .. &#039;/%&quot;&#039;, 		limit = 1 		-- where = &#039;featured=&quot;Yes&quot; AND _pageName LIKE &quot;&#039; .. args.gam...&quot;</title>
		<link rel="alternate" type="text/html" href="https://staging.twogpedia.com/index.php?title=Module:GameLanding/Featured_tournament&amp;diff=6223&amp;oldid=prev"/>
		<updated>2023-09-29T11:30:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local cargo = mw.ext.cargo local p = {} local prizeToString = require(&amp;#039;Module:Functions&amp;#039;).prizeToString  function p.featured(game) 	local tables = &amp;#039;Tournaments&amp;#039; 	local fields = &amp;#039;_pageName, start, end, prize, logoAll, logoLight, logoDark, iconAll, iconLight, iconDark, venue&amp;#039; 	local currentDate = os.date(&amp;#039;%Y-%m-%d&amp;#039;) 	local cargoArgs = { 		where = &amp;#039;featured=&amp;quot;1&amp;quot; AND _pageName LIKE &amp;quot;&amp;#039; .. game .. &amp;#039;/%&amp;quot;&amp;#039;, 		limit = 1 		-- where = &amp;#039;featured=&amp;quot;Yes&amp;quot; AND _pageName LIKE &amp;quot;&amp;#039; .. args.gam...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local cargo = mw.ext.cargo&lt;br /&gt;
local p = {}&lt;br /&gt;
local prizeToString = require(&amp;#039;Module:Functions&amp;#039;).prizeToString&lt;br /&gt;
&lt;br /&gt;
function p.featured(game)&lt;br /&gt;
	local tables = &amp;#039;Tournaments&amp;#039;&lt;br /&gt;
	local fields = &amp;#039;_pageName, start, end, prize, logoAll, logoLight, logoDark, iconAll, iconLight, iconDark, venue&amp;#039;&lt;br /&gt;
	local currentDate = os.date(&amp;#039;%Y-%m-%d&amp;#039;)&lt;br /&gt;
	local cargoArgs = {&lt;br /&gt;
		where = &amp;#039;featured=&amp;quot;1&amp;quot; AND _pageName LIKE &amp;quot;&amp;#039; .. game .. &amp;#039;/%&amp;quot;&amp;#039;,&lt;br /&gt;
		limit = 1&lt;br /&gt;
		-- where = &amp;#039;featured=&amp;quot;Yes&amp;quot; AND _pageName LIKE &amp;quot;&amp;#039; .. args.game .. &amp;#039;/%&amp;quot; AND (start is NULL OR start &amp;lt; &amp;quot;&amp;#039; .. currentDate .. &amp;#039;&amp;quot;) AND (end is NULL OR end &amp;gt; &amp;quot;&amp;#039; .. currentDate .. &amp;#039;&amp;quot;)&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	local results = cargo.query(tables, fields, cargoArgs)&lt;br /&gt;
&lt;br /&gt;
	if #results &amp;gt; 0 then&lt;br /&gt;
		local monthNames = {&amp;quot;Jan&amp;quot;, &amp;quot;Feb&amp;quot;, &amp;quot;Mar&amp;quot;, &amp;quot;Apr&amp;quot;, &amp;quot;May&amp;quot;, &amp;quot;Jun&amp;quot;, &amp;quot;Jul&amp;quot;, &amp;quot;Aug&amp;quot;, &amp;quot;Sep&amp;quot;, &amp;quot;Oct&amp;quot;, &amp;quot;Nov&amp;quot;, &amp;quot;Dec&amp;quot;}&lt;br /&gt;
		local featuredTournament = mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;box__container&amp;#039;):node(mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;box__title&amp;#039;):wikitext(&amp;#039;Featured tournament&amp;#039;))&lt;br /&gt;
		local result = results[1]&lt;br /&gt;
&lt;br /&gt;
		local icon = result.iconAll ~= &amp;#039;&amp;#039; and result.iconAll or result.iconLight ~= &amp;#039;&amp;#039; and result.iconLight or result.iconDark ~= &amp;#039;&amp;#039; and result.iconDark or result.logoAll ~= &amp;#039;&amp;#039; and result.logoAll or result.logoDark ~= &amp;#039;&amp;#039; and result.logoDark or result.logoLight ~= &amp;#039;&amp;#039; and result.logoLight&lt;br /&gt;
&lt;br /&gt;
		featuredTournament:node(mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;tc&amp;#039;):wikitext(&amp;#039;[[File:&amp;#039; .. icon .. &amp;#039;|200px]]&amp;#039;))&lt;br /&gt;
		featuredTournament:node(mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;tc&amp;#039;):wikitext(&amp;#039;[[&amp;#039; .. result._pageName .. &amp;#039;]]&amp;#039;))&lt;br /&gt;
		&lt;br /&gt;
		local info = mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;featured__info&amp;#039;)&lt;br /&gt;
		local date = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
		local startDate = &amp;#039;TBD&amp;#039;&lt;br /&gt;
		if result.start then&lt;br /&gt;
			local year, month, day = result.start:match(&amp;quot;(%d+)-(%d+)-(%d+)&amp;quot;)&lt;br /&gt;
			local monthName = monthNames[tonumber(month)]&lt;br /&gt;
			startDate = monthName .. &amp;quot; &amp;quot; .. day .. &amp;quot;, &amp;quot; .. year&lt;br /&gt;
		end&lt;br /&gt;
		local endDate = &amp;#039;TBD&amp;#039;&lt;br /&gt;
		if result[&amp;#039;end&amp;#039;] then&lt;br /&gt;
			year, month, day = result[&amp;#039;end&amp;#039;]:match(&amp;quot;(%d+)-(%d+)-(%d+)&amp;quot;)&lt;br /&gt;
			monthName = monthNames[tonumber(month)]&lt;br /&gt;
			endDate = monthName .. &amp;quot; &amp;quot; .. day .. &amp;quot;, &amp;quot; .. year&lt;br /&gt;
		end&lt;br /&gt;
	&lt;br /&gt;
		date:node(mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;fw-600&amp;#039;):wikitext(&amp;#039;Date&amp;#039;)):node(mw.html.create(&amp;#039;div&amp;#039;):wikitext(startDate .. &amp;#039; - &amp;#039; .. endDate))&lt;br /&gt;
		&lt;br /&gt;
		local prize = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
		prize:node(mw.html.create(&amp;#039;div&amp;#039;):addClass(&amp;#039;fw-600&amp;#039;):wikitext(&amp;#039;Prize&amp;#039;)):node(mw.html.create(&amp;#039;div&amp;#039;):wikitext(&amp;#039;$&amp;#039; .. prizeToString(result.prize)))&lt;br /&gt;
		&lt;br /&gt;
		featuredTournament:node(info:node(date):node(prize))&lt;br /&gt;
		&lt;br /&gt;
		return featuredTournament&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Couchor</name></author>
	</entry>
</feed>