<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://atitd.wiki/tale11/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AInfobox</id>
	<title>Module:Infobox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://atitd.wiki/tale11/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AInfobox"/>
	<link rel="alternate" type="text/html" href="https://atitd.wiki/tale11/w/index.php?title=Module:Infobox&amp;action=history"/>
	<updated>2026-04-05T00:00:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://atitd.wiki/tale11/w/index.php?title=Module:Infobox&amp;diff=173320&amp;oldid=prev</id>
		<title>Brad: Fixed</title>
		<link rel="alternate" type="text/html" href="https://atitd.wiki/tale11/w/index.php?title=Module:Infobox&amp;diff=173320&amp;oldid=prev"/>
		<updated>2021-05-27T13:35:23Z</updated>

		<summary type="html">&lt;p&gt;Fixed&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.start( frame )&lt;br /&gt;
	template = frame:getParent()&lt;br /&gt;
	infobox = '&amp;lt;table class=&amp;quot;infobox ' .. template.args[&amp;quot;ibclass&amp;quot;] .. '&amp;quot;&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;th class=&amp;quot;ibname&amp;quot;&amp;gt;'&lt;br /&gt;
	infobox = infobox .. template.args[&amp;quot;ibname&amp;quot;] .. ''&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/th&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	if (notempty(template.args[&amp;quot;image&amp;quot;])) then&lt;br /&gt;
		infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;td align=&amp;quot;center&amp;quot; class=&amp;quot;ibimage&amp;quot;&amp;gt;'&lt;br /&gt;
		infobox = infobox .. '[[File:' .. template.args[&amp;quot;image&amp;quot;] .. '|250px|' .. template.args[&amp;quot;ibname&amp;quot;] .. ']]'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (notempty(template.args[&amp;quot;icon&amp;quot;])) then&lt;br /&gt;
		infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;td align=&amp;quot;center&amp;quot; class=&amp;quot;ibimage&amp;quot;&amp;gt;'&lt;br /&gt;
		infobox = infobox .. '[[File:' .. template.args[&amp;quot;icon&amp;quot;] .. '||' .. template.args[&amp;quot;ibname&amp;quot;] .. ']]'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (notempty(template.args[&amp;quot;ibtype&amp;quot;])) then&lt;br /&gt;
		infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;th class=&amp;quot;ibtype&amp;quot;&amp;gt;'&lt;br /&gt;
		infobox = infobox .. '(' .. template.args[&amp;quot;ibtype&amp;quot;] .. ')'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;/th&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;/tr&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return infobox&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.row( frame )&lt;br /&gt;
	infobox = '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;th&amp;gt;' .. frame.args[1] .. '&amp;lt;/th&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;td&amp;gt;' .. frame.args[2] .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	-----&lt;br /&gt;
	&lt;br /&gt;
	infobox = '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;td&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	infobox = infobox .. '&amp;lt;table class=&amp;quot;ib-row&amp;quot;&amp;gt;'&lt;br /&gt;
&lt;br /&gt;
	-----&lt;br /&gt;
&lt;br /&gt;
	infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;th&amp;gt;' .. frame.args[1] .. '&amp;lt;/th&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;td&amp;gt;' .. frame.args[2] .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
		&lt;br /&gt;
	-----&lt;br /&gt;
	&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/table&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	-----&lt;br /&gt;
	&lt;br /&gt;
	return infobox&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.stacked( frame )&lt;br /&gt;
	infobox = '&amp;lt;tr class=&amp;quot;ib-stacked&amp;quot;&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;th&amp;gt;' .. frame.args[1] .. '&amp;lt;/th&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;tr class=&amp;quot;ib-stacked&amp;quot;&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;td&amp;gt;' .. frame.args[2] .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	return infobox&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.tabulated( frame ) -- Using &amp;quot;tabulated&amp;quot; because the word &amp;quot;table&amp;quot; is a reserved word in Lua... :(&lt;br /&gt;
	template = frame:getParent()&lt;br /&gt;
&lt;br /&gt;
	infobox = '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;td&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	infobox = infobox .. '&amp;lt;table class=&amp;quot;ib-tabulated&amp;quot;&amp;gt;'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;th colspan=&amp;quot;2&amp;quot; class=&amp;quot;ibtype&amp;quot;&amp;gt;' .. frame.args[1] .. '&amp;lt;/th&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	colOne = {}&lt;br /&gt;
	colTwo = {}&lt;br /&gt;
	&lt;br /&gt;
	for k, v in pairs( template.args ) do&lt;br /&gt;
		if (string.find(k, frame.args[2], 1, true)) then&lt;br /&gt;
			key = string.sub(k, (#frame.args[2]+1))&lt;br /&gt;
			colOne[key] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for k, v in pairs( template.args ) do&lt;br /&gt;
		if (string.find(k, frame.args[3], 1, true)) then&lt;br /&gt;
			key = string.sub(k, (string.len(frame.args[3])+1))&lt;br /&gt;
			colTwo[key] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	myTable = {}&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs( colOne ) do&lt;br /&gt;
		myTable[v] = colTwo[k]&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for k,v in spairs(myTable) do&lt;br /&gt;
		&lt;br /&gt;
		infobox = infobox .. '&amp;lt;tr&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;td class=&amp;quot;ib-tabulated-left&amp;quot;&amp;gt;' .. k .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;td class=&amp;quot;ib-tabulated-right&amp;quot;&amp;gt;' .. comma_value(v) .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
		infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
		&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/table&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/td&amp;gt;\n'&lt;br /&gt;
	infobox = infobox .. '&amp;lt;/tr&amp;gt;\n'&lt;br /&gt;
	&lt;br /&gt;
	return infobox&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.finish( frame )&lt;br /&gt;
	infobox = '&amp;lt;/table&amp;gt;\n'&lt;br /&gt;
&lt;br /&gt;
	return infobox&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function notempty( variable )&lt;br /&gt;
	if (variable and #variable &amp;gt; 0) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function spairs(t, order)&lt;br /&gt;
    local keys = {}&lt;br /&gt;
    for k in pairs(t) do keys[#keys+1] = k end&lt;br /&gt;
&lt;br /&gt;
    if order then&lt;br /&gt;
        table.sort(keys, function(a,b) return order(t, a, b) end)&lt;br /&gt;
    else&lt;br /&gt;
        table.sort(keys)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local i = 0&lt;br /&gt;
    return function()&lt;br /&gt;
        i = i + 1&lt;br /&gt;
        if keys[i] then&lt;br /&gt;
            return keys[i], t[keys[i]]&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function comma_value(amount)&lt;br /&gt;
	local formatted = amount&lt;br /&gt;
	while true do  &lt;br /&gt;
		formatted, k = string.gsub(formatted, &amp;quot;^(-?%d+)(%d%d%d)&amp;quot;, '%1,%2')&lt;br /&gt;
		if (k==0) then&lt;br /&gt;
		  break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return formatted&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Brad</name></author>
	</entry>
</feed>