<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.americanmusicclub.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=198.102.153.1</id>
	<title>The Official Website for Mark Eitzel &amp; American Music Club - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.americanmusicclub.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=198.102.153.1"/>
	<link rel="alternate" type="text/html" href="https://wiki.americanmusicclub.com/wiki/Special:Contributions/198.102.153.1"/>
	<updated>2026-04-12T06:39:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.americanmusicclub.com/index.php?title=Module:Multiple_image&amp;diff=20600</id>
		<title>Module:Multiple image</title>
		<link rel="alternate" type="text/html" href="https://wiki.americanmusicclub.com/index.php?title=Module:Multiple_image&amp;diff=20600"/>
		<updated>2014-04-24T23:32:10Z</updated>

		<summary type="html">&lt;p&gt;198.102.153.1: test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- implements [[template:multiple image]]&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and s:match( &#039;^%s*(.-)%s*$&#039; ) ~= &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderImageCell(image, width, link, alt, caption, textalign) &lt;br /&gt;
	local root = mw.html.create(&#039;&#039;)&lt;br /&gt;
	&lt;br /&gt;
	local altstr = &#039;|alt=&#039; .. (alt or &#039;&#039;)&lt;br /&gt;
	local linkstr = link and (&#039;|link=&#039; .. link) or &#039;&#039;&lt;br /&gt;
	&lt;br /&gt;
	local imagediv = root:tag(&#039;div&#039;)&lt;br /&gt;
	imagediv:addClass(&#039;thumbimage&#039;)&lt;br /&gt;
	imagediv:wikitext(&#039;[[file:&#039; .. image .. &#039;|&#039; .. tostring(width) .. &#039;px&#039; .. linkstr .. altstr .. &#039;]]&#039;)&lt;br /&gt;
	if isnotempty(caption) then&lt;br /&gt;
		local captiondiv = root:tag(&#039;div&#039;)&lt;br /&gt;
		captiondiv:addClass(&#039;thumbcaption&#039;)&lt;br /&gt;
		captiondiv:css(&#039;clear&#039;, &#039;left&#039;)&lt;br /&gt;
		if isnotempty(textalign) then&lt;br /&gt;
			captiondiv:css(&#039;text-align&#039;, textalign)&lt;br /&gt;
		end&lt;br /&gt;
		captiondiv:wikitext(caption)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getWidth(w1, w2)&lt;br /&gt;
	local w = 0&lt;br /&gt;
	if isnotempty(w1) then&lt;br /&gt;
		w = tonumber(w1)&lt;br /&gt;
	elseif isnotempty(w2) then&lt;br /&gt;
		w = tonumber(w2)&lt;br /&gt;
	else&lt;br /&gt;
		w = 200&lt;br /&gt;
	end&lt;br /&gt;
	return w&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderMultipleImages(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	local width = args[&#039;width&#039;] or &#039;&#039;&lt;br /&gt;
	local dir = args[&#039;direction&#039;] or &#039;&#039;&lt;br /&gt;
	local align = args[&#039;align&#039;] or &#039;&#039;&lt;br /&gt;
	local captionalign = args[&#039;caption_align&#039;] or &#039;&#039;&lt;br /&gt;
	local totalwidth = args[&#039;total_width&#039;] or &#039;&#039;&lt;br /&gt;
	local header = args[&#039;header&#039;] or args[&#039;title&#039;] or &#039;&#039;&lt;br /&gt;
	local footer = args[&#039;footer&#039;] or &#039;&#039;&lt;br /&gt;
	local thumbclass = {&lt;br /&gt;
		[&amp;quot;left&amp;quot;] = &#039;tleft&#039;,&lt;br /&gt;
		[&amp;quot;none&amp;quot;] = &#039;tnone&#039;,&lt;br /&gt;
		[&amp;quot;center&amp;quot;] = &#039;tnone&#039;,&lt;br /&gt;
		[&amp;quot;centre&amp;quot;] = &#039;tnone&#039;,&lt;br /&gt;
		[&amp;quot;right&amp;quot;] = &#039;tright&#039;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	-- find all the nonempty images and corresponding widths&lt;br /&gt;
	-- also compute the sum of widths and maximum width&lt;br /&gt;
	local imagenumbers = {}&lt;br /&gt;
	local widths = {}&lt;br /&gt;
	local imagecount = 0&lt;br /&gt;
	local widthmax = 0&lt;br /&gt;
	local widthsum = 0&lt;br /&gt;
	for k, v in pairs( args ) do&lt;br /&gt;
		local i = tonumber(tostring(k):match( &#039;^%s*image([%d]+)%s*$&#039; ) or &#039;0&#039;)&lt;br /&gt;
		if( i &amp;gt; 0 and isnotempty(v) ) then&lt;br /&gt;
			table.insert( imagenumbers, i)&lt;br /&gt;
			imagecount = imagecount + 1&lt;br /&gt;
			local w = getWidth(width, args[&#039;width&#039; .. i])&lt;br /&gt;
			if (isnotempty( totalwidth ) and dir ~= &#039;vertical&#039;) then&lt;br /&gt;
				-- rescale the width if height has been specified&lt;br /&gt;
				local h = args[&#039;height&#039; .. i] or &#039;&#039;&lt;br /&gt;
				if( isnotempty(h) ) then&lt;br /&gt;
					w = math.floor(w/tonumber(h)*150 + 0.5)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			-- compute maximum width and width sum&lt;br /&gt;
			widthmax = math.max(widthmax, w)&lt;br /&gt;
			widthsum = widthsum + w&lt;br /&gt;
			-- store the modified width&lt;br /&gt;
			widths[i] = w&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- sort the imagenumbers&lt;br /&gt;
	table.sort(imagenumbers)&lt;br /&gt;
	&lt;br /&gt;
	-- if total_width has been specified, rescale the image widths&lt;br /&gt;
	if( isnotempty(totalwidth) ) then&lt;br /&gt;
		totalwidth = tonumber(totalwidth)&lt;br /&gt;
		if( dir == &#039;vertical&#039; ) then&lt;br /&gt;
			width = totalwidth - 12&lt;br /&gt;
		else&lt;br /&gt;
			local tw = totalwidth - 4 * (imagecount - 1) - 12&lt;br /&gt;
			local ws = 0&lt;br /&gt;
			for k=1,imagecount do&lt;br /&gt;
				local i = imagenumbers[k]&lt;br /&gt;
				widths[i] = math.floor((tw/widthsum)*widths[i] + 0.5)&lt;br /&gt;
				ws = ws + widths[i]&lt;br /&gt;
			end&lt;br /&gt;
			widthsum = ws&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
&lt;br /&gt;
	-- start building the array of images, if there are images&lt;br /&gt;
	if( imagecount &amp;gt; 0 ) then&lt;br /&gt;
		local bodywidth = 0&lt;br /&gt;
		local bg = args[&#039;background color&#039;] or &#039;&#039;&lt;br /&gt;
		-- create the array of images&lt;br /&gt;
		local root = mw.html.create(&#039;div&#039;)&lt;br /&gt;
		root:addClass(&#039;thumb&#039;)&lt;br /&gt;
		root:addClass(thumbclass[align] or &#039;tright&#039;)&lt;br /&gt;
		if( dir == &#039;vertical&#039;) then&lt;br /&gt;
			bodywidth = widthmax + 12&lt;br /&gt;
		else&lt;br /&gt;
			bodywidth = widthsum + 4 * (imagecount - 1) + 12&lt;br /&gt;
		end&lt;br /&gt;
		if( align == &#039;center&#039; or align == &#039;centre&#039; ) then&lt;br /&gt;
			root:addClass(&#039;center&#039;)&lt;br /&gt;
		end&lt;br /&gt;
		if( args[&#039;margin_top&#039;] ) then&lt;br /&gt;
			root:css(&#039;margin-top&#039;, args[&#039;margin_top&#039;])&lt;br /&gt;
		end&lt;br /&gt;
		if( args[&#039;margin_bottom&#039;] ) then&lt;br /&gt;
			root:css(&#039;margin-bottom&#039;, args[&#039;margin_bottom&#039;])&lt;br /&gt;
		end&lt;br /&gt;
		if( bg ~= &#039;&#039; ) then&lt;br /&gt;
			root:css(&#039;background-color&#039;, bg)&lt;br /&gt;
		end&lt;br /&gt;
		local div = root:tag(&#039;div&#039;)&lt;br /&gt;
		div:addClass(&#039;thumbinner&#039;)&lt;br /&gt;
		div:css(&#039;width&#039;, tostring(bodywidth - 8) .. &#039;px&#039;)&lt;br /&gt;
		if( bg ~= &#039;&#039; ) then&lt;br /&gt;
			div:css(&#039;background-color&#039;, bg)&lt;br /&gt;
		end&lt;br /&gt;
		-- add the header&lt;br /&gt;
		if( isnotempty(header) ) then&lt;br /&gt;
			div:tag(&#039;div&#039;)&lt;br /&gt;
				:css(&#039;clear&#039;, &#039;both&#039;)&lt;br /&gt;
				:css(&#039;font-weight&#039;, &#039;bold&#039;)&lt;br /&gt;
				:css(&#039;text-align&#039;, args[&#039;header_align&#039;] or &#039;center&#039;)&lt;br /&gt;
				:css(&#039;background-color&#039;, args[&#039;header_background&#039;] or &#039;transparent&#039;)&lt;br /&gt;
				:wikitext(header)&lt;br /&gt;
		end&lt;br /&gt;
		-- loop through the images&lt;br /&gt;
		for k=1,imagecount do&lt;br /&gt;
			imagediv = div:tag(&#039;div&#039;)&lt;br /&gt;
			if dir ~= &#039;vertical&#039; then&lt;br /&gt;
				imagediv:css(&#039;float&#039;, &#039;left&#039;)&lt;br /&gt;
			end&lt;br /&gt;
			imagediv:css(&#039;margin&#039;, &#039;1px&#039;)&lt;br /&gt;
			local i = imagenumbers[k]&lt;br /&gt;
			local img = args[&#039;image&#039; .. i]&lt;br /&gt;
			local w = widths[i]&lt;br /&gt;
			imagediv:css(&#039;width&#039;, tostring(2 + w) .. &#039;px&#039;)&lt;br /&gt;
			imagediv:wikitext(renderImageCell(img, w, args[&#039;link&#039; .. i], args[&#039;alt&#039; .. i], args[&#039;caption&#039; .. i], captionalign))&lt;br /&gt;
		end&lt;br /&gt;
		-- add the footer&lt;br /&gt;
		if( isnotempty(footer) ) then&lt;br /&gt;
			div:tag(&#039;div&#039;)&lt;br /&gt;
				:addClass(&#039;thumbcaption&#039;)&lt;br /&gt;
				:css(&#039;clear&#039;, &#039;left&#039;)&lt;br /&gt;
				:css(&#039;text-align&#039;, args[&#039;footer_align&#039;] or &#039;left&#039;)&lt;br /&gt;
				:css(&#039;background-color&#039;, args[&#039;footer_background&#039;] or &#039;transparent&#039;)&lt;br /&gt;
				:wikitext(footer)&lt;br /&gt;
		end&lt;br /&gt;
		return tostring(root)&lt;br /&gt;
	end&lt;br /&gt;
	return &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.render( frame )&lt;br /&gt;
    return renderMultipleImages( frame )&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>198.102.153.1</name></author>
	</entry>
</feed>