<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AJct%2Fcity%2Fsandbox</id>
	<title>Module:Jct/city/sandbox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AJct%2Fcity%2Fsandbox"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Jct/city/sandbox&amp;action=history"/>
	<updated>2026-05-24T12:53:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Jct/city/sandbox&amp;diff=137087&amp;oldid=prev</id>
		<title>imported&gt;Philroc at 03:04, 27 August 2021</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Jct/city/sandbox&amp;diff=137087&amp;oldid=prev"/>
		<updated>2021-08-27T03:04:07Z</updated>

		<summary type="html">&lt;p&gt;&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;
local concat = table.concat&lt;br /&gt;
local insert = table.insert&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local city&lt;br /&gt;
local location&lt;br /&gt;
local areadab&lt;br /&gt;
local countydab&lt;br /&gt;
local state&lt;br /&gt;
local pageContainsLink&lt;br /&gt;
&lt;br /&gt;
local function stateName(args)&lt;br /&gt;
	local AUSabbrs = {NT = &amp;quot;Northern Territory&amp;quot;, WA = &amp;quot;Western Australia&amp;quot;}&lt;br /&gt;
	&lt;br /&gt;
	local data = mw.loadData(&amp;quot;Module:Jct/statename&amp;quot;)&lt;br /&gt;
	local abbr = args.state or args.province&lt;br /&gt;
	local country = args.country&lt;br /&gt;
	if country == &amp;#039;AUS&amp;#039; then&lt;br /&gt;
		return AUSabbrs[abbr] or data[abbr]&lt;br /&gt;
	else&lt;br /&gt;
		return data[abbr]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function generateText(num, insertPrefix)&lt;br /&gt;
	local parts&lt;br /&gt;
	if insertPrefix then&lt;br /&gt;
		if num == 1 then&lt;br /&gt;
			parts = {&amp;quot;– &amp;quot;}&lt;br /&gt;
		else&lt;br /&gt;
			parts = {&amp;quot;, &amp;quot;}&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if location then&lt;br /&gt;
		insert(parts, location)&lt;br /&gt;
		return concat(parts)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not pageContainsLink then&lt;br /&gt;
	    insert(parts, &amp;quot;[[&amp;quot; .. city)&lt;br /&gt;
		if areadab then&lt;br /&gt;
			insert(parts, &amp;quot; (&amp;quot; .. areadab .. &amp;quot;)&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
		if countydab then&lt;br /&gt;
			insert(parts, &amp;quot;, &amp;quot; .. countydab .. &amp;quot; County&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
		if state then&lt;br /&gt;
			insert(parts, &amp;quot;, &amp;quot; .. state)&lt;br /&gt;
		end&lt;br /&gt;
		insert(parts, &amp;quot;|&amp;quot; .. city .. &amp;quot;]]&amp;quot;)&lt;br /&gt;
		&lt;br /&gt;
		return concat(parts)&lt;br /&gt;
	else &lt;br /&gt;
		insert(parts, city)&lt;br /&gt;
		return concat(parts)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function _location(args, num, page)&lt;br /&gt;
	city = args[&amp;quot;city&amp;quot; .. num]&lt;br /&gt;
	location = args[&amp;quot;location&amp;quot; .. num]&lt;br /&gt;
	areadab = args[&amp;quot;areadab&amp;quot; .. num]&lt;br /&gt;
	countydab = args[&amp;quot;countydab&amp;quot; .. num]&lt;br /&gt;
	&lt;br /&gt;
	if not(city or location) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if pageContainsLink == false then&lt;br /&gt;
		local place = city or location&lt;br /&gt;
		&lt;br /&gt;
		local jctString = &amp;quot;{{jct/sandbox|&amp;quot; .. &amp;quot;.+&amp;quot; .. place .. &amp;quot;.+&amp;quot; .. &amp;quot;}}&amp;quot;&lt;br /&gt;
		local linkString = generateText(num, false)&lt;br /&gt;
		&lt;br /&gt;
		local firstPosition = strfind(page, linkString)&lt;br /&gt;
		&lt;br /&gt;
		if firstPosition then&lt;br /&gt;
			local secondPosition = strfind(page, linkString, firstPosition)&lt;br /&gt;
			if secondPosition or string.find(page, jctString) then &lt;br /&gt;
				pageContainsLink = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return generateText(num, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.city(args, page)&lt;br /&gt;
	state = stateName(args)&lt;br /&gt;
	local cities = {}&lt;br /&gt;
	local locationCount = 1&lt;br /&gt;
	repeat&lt;br /&gt;
		local location = _location(args, locationCount, page)&lt;br /&gt;
		insert(cities, location)&lt;br /&gt;
		local empty = (location == &amp;#039;&amp;#039;)&lt;br /&gt;
		locationCount = locationCount + 1&lt;br /&gt;
	until empty&lt;br /&gt;
	return concat(cities)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Philroc</name></author>
	</entry>
</feed>