<?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%3ADYK_nompage_links</id>
	<title>Module:DYK nompage links - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ADYK_nompage_links"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:DYK_nompage_links&amp;action=history"/>
	<updated>2026-04-16T01:45:09Z</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:DYK_nompage_links&amp;diff=135895&amp;oldid=prev</id>
		<title>imported&gt;Nakon: Changed protection level of Module:DYK nompage links: increasing protection, 25k+ transclusions ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only administrators] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:DYK_nompage_links&amp;diff=135895&amp;oldid=prev"/>
		<updated>2015-03-26T19:43:07Z</updated>

		<summary type="html">&lt;p&gt;Changed protection level of Module:DYK nompage links: increasing protection, 25k+ transclusions ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only administrators] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{DYK nompage links}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local formatStringSingle = [[&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks hlist&amp;quot;&amp;gt;&lt;br /&gt;
* ( %s&lt;br /&gt;
* %s )&lt;br /&gt;
&amp;lt;/div&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
local formatStringMulti = [[&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks hlist&amp;quot;&amp;gt;&lt;br /&gt;
* ( %s )&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks hlist&amp;quot;&amp;gt;&lt;br /&gt;
* ( Article history links: %s )&lt;br /&gt;
&amp;lt;/div&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function makeWikitextError(msg)&lt;br /&gt;
	return string.format(&amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: %s&amp;lt;/strong&amp;gt;&amp;#039;, msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeFullUrl(page, query, display)&lt;br /&gt;
	local url = mw.uri.fullUrl(page, query)&lt;br /&gt;
	if not url then&lt;br /&gt;
		url = makeWikitextError(string.format(&lt;br /&gt;
			&amp;#039;&amp;quot;%s&amp;quot; is not a valid page name&amp;#039;,&lt;br /&gt;
			tostring(page)&lt;br /&gt;
		))&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&lt;br /&gt;
		&amp;#039;[%s %s]&amp;#039;,&lt;br /&gt;
		tostring(url),&lt;br /&gt;
		display&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local mArguments = require(&amp;#039;Module:Arguments&amp;#039;)&lt;br /&gt;
	local mTableTools = require(&amp;#039;Module:TableTools&amp;#039;)&lt;br /&gt;
	local args = mArguments.getArgs(frame, {&lt;br /&gt;
		wrappers = &amp;#039;Template:DYK nompage links&amp;#039;&lt;br /&gt;
	})&lt;br /&gt;
	local nominationPage = args.nompage&lt;br /&gt;
	local historyPages = mTableTools.compressSparseArray(args)&lt;br /&gt;
	return p._main(nominationPage, historyPages)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(nominationPage, historyPages)&lt;br /&gt;
	-- Deal with bad input.&lt;br /&gt;
	if not nominationPage then&lt;br /&gt;
		return makeWikitextError(&amp;#039;no nomination page specified&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if not historyPages or not historyPages[1] then&lt;br /&gt;
		return makeWikitextError(&amp;#039;no articles specified&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find out whether we are dealing with multiple history pages.&lt;br /&gt;
	local isMulti = #historyPages &amp;gt; 1&lt;br /&gt;
&lt;br /&gt;
	-- Make the nompage link.&lt;br /&gt;
	local nominationLink&lt;br /&gt;
	do&lt;br /&gt;
		local currentPage = mw.title.getCurrentTitle().prefixedText&lt;br /&gt;
		local dykSubpage = &amp;#039;Template:Did you know nominations/&amp;#039; .. nominationPage&lt;br /&gt;
		if currentPage == dykSubpage then&lt;br /&gt;
			nominationLink = string.format(&lt;br /&gt;
				&amp;#039;[[Template talk:Did you know#%s|Back to T:TDYK]]&amp;#039;,&lt;br /&gt;
				nominationPage&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			nominationLink = makeFullUrl(&lt;br /&gt;
				&amp;#039;Template:Did you know nominations/&amp;#039; .. nominationPage,&lt;br /&gt;
				{action = &amp;#039;edit&amp;#039;},&lt;br /&gt;
				&amp;#039;Review or comment&amp;#039;&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Make the history links.&lt;br /&gt;
	local historyLinks&lt;br /&gt;
	do&lt;br /&gt;
		if isMulti then&lt;br /&gt;
			local links = {}&lt;br /&gt;
			for i, page in ipairs(historyPages) do&lt;br /&gt;
				links[#links + 1] = makeFullUrl(&lt;br /&gt;
					page,&lt;br /&gt;
					{action = &amp;#039;history&amp;#039;},&lt;br /&gt;
					page&lt;br /&gt;
				)&lt;br /&gt;
			end&lt;br /&gt;
			historyLinks = table.concat(links, &amp;#039;\n* &amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			historyLinks = makeFullUrl(&lt;br /&gt;
				historyPages[1],&lt;br /&gt;
				{action = &amp;#039;history&amp;#039;},&lt;br /&gt;
				&amp;#039;Article history&amp;#039;&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the output.&lt;br /&gt;
	local stringToFormat = isMulti and formatStringMulti or formatStringSingle&lt;br /&gt;
	return string.format(stringToFormat, nominationLink, historyLinks)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Nakon</name></author>
	</entry>
</feed>