<?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%3APages_with_authority_control_identifiers%2Fsandbox</id>
	<title>Module:Pages with authority control identifiers/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%3APages_with_authority_control_identifiers%2Fsandbox"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Pages_with_authority_control_identifiers/sandbox&amp;action=history"/>
	<updated>2026-05-12T19:21:10Z</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:Pages_with_authority_control_identifiers/sandbox&amp;diff=144253&amp;oldid=prev</id>
		<title>imported&gt;MSGJ: idlink</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Pages_with_authority_control_identifiers/sandbox&amp;diff=144253&amp;oldid=prev"/>
		<updated>2022-12-08T19:45:23Z</updated>

		<summary type="html">&lt;p&gt;idlink&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
local p = {}&lt;br /&gt;
local ac_conf = require(&amp;#039;Module:Authority control/config&amp;#039;).config&lt;br /&gt;
local rmCats = require(&amp;#039;Module:Suppress categories&amp;#039;).main&lt;br /&gt;
local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
local title = currentTitle.text&lt;br /&gt;
&lt;br /&gt;
-- Local Utility Functions&lt;br /&gt;
local function whichTOC( frame )&lt;br /&gt;
	-- standardize TOC behavior via {{CatAutoTOC}}&lt;br /&gt;
	return frame:expandTemplate{ title = &amp;#039;CatAutoTOC&amp;#039;, args = { align = &amp;#039;center&amp;#039; } }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function redCatCheck( cat ) --cat == &amp;#039;Blah&amp;#039; (not &amp;#039;Category:Blah&amp;#039;, &amp;#039;[[Category:Blah]]&amp;#039;, etc.)&lt;br /&gt;
	if cat and cat ~= &amp;#039;&amp;#039; and mw.title.new(cat, 14).exists == false then&lt;br /&gt;
		return &amp;#039;[[Category:Pages with red-linked authority control categories]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function addCat( cat, id )&lt;br /&gt;
	if id and id ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		return &amp;#039;[[Category:&amp;#039;..cat..&amp;#039;|&amp;#039;..id..&amp;#039;]]&amp;#039;..redCatCheck(cat)&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;[[Category:&amp;#039;..cat..&amp;#039;]]&amp;#039;..redCatCheck(cat)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For use in [[Category:Articles with authority control information]], i.e. on [[Category:Articles with VIAF identifiers]]&lt;br /&gt;
local function wp( frame, id )&lt;br /&gt;
	for _, conf in pairs( ac_conf ) do&lt;br /&gt;
		if conf.category == id or conf[1] == id then&lt;br /&gt;
			local linktarget = conf.idlink or conf[1]..&amp;#039; (identifier)&amp;#039;&lt;br /&gt;
			local link    = &amp;#039;[[&amp;#039;..linktarget..&amp;#039;|&amp;#039;..conf[1]..&amp;#039;]]&amp;#039;&lt;br /&gt;
			local wdpl    = &amp;#039;:d:Property:P&amp;#039;..conf.property&lt;br /&gt;
			--local example = &amp;#039;The &amp;#039;..conf[1]..&amp;#039; identifier appears as &amp;#039;.. rmCats(conf[3](conf[5]))..&amp;#039; in the &amp;#039;..conf[4]..&amp;#039; section.&amp;#039;&lt;br /&gt;
			local txCatExplain = frame:expandTemplate{ title = &amp;#039;Category explanation&amp;#039;, args = {&amp;#039;articles with &amp;#039;..link..&amp;#039; identifiers.&amp;#039;..&amp;#039; Please do not add [[Wikipedia:Categorization#Subcategorization|subcategories]].&amp;#039;} }&lt;br /&gt;
			local txCatMore    = frame:expandTemplate{ title = &amp;#039;Cat more&amp;#039;, args = {&amp;#039;Wikipedia:Authority control&amp;#039;, wdpl} }&lt;br /&gt;
			local txEmptyCat   = frame:expandTemplate{ title = &amp;#039;Possibly empty category&amp;#039; }&lt;br /&gt;
			local txWPCat      = frame:expandTemplate{ title = &amp;#039;Wikipedia category&amp;#039;, args = { hidden = &amp;#039;yes&amp;#039;, tracking = &amp;#039;yes&amp;#039; } }&lt;br /&gt;
			local txTOC = whichTOC( frame )&lt;br /&gt;
			local wpCat = &amp;#039;Articles with authority control information&amp;#039;&lt;br /&gt;
			local outString = txCatExplain..txCatMore..txEmptyCat..txWPCat..txTOC..&amp;#039;\n&amp;#039;..&amp;#039;Pages in this category should only be added by [[Module:Authority control]].&amp;#039;..addCat(wpCat, id)&lt;br /&gt;
			return outString&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--For use in [[Category:Articles with faulty authority control information]], i.e. on [[Category:Articles with faulty VIAF identifiers]]&lt;br /&gt;
local function wpfaulty( frame, id )&lt;br /&gt;
	for _, conf in pairs( ac_conf ) do&lt;br /&gt;
		if conf.category == id or conf[1] == id then&lt;br /&gt;
			local linktarget = conf.idlink or conf[1]..&amp;#039; (identifier)&amp;#039;&lt;br /&gt;
			local wdpl       = &amp;#039;:d:Property:P&amp;#039;..conf.property&lt;br /&gt;
			local txCatMore  = frame:expandTemplate{ title = &amp;#039;Cat more&amp;#039;, args = {&amp;#039;Wikipedia:Authority control&amp;#039;, linktarget, wdpl} }&lt;br /&gt;
			local txEmptyCat = frame:expandTemplate{ title = &amp;#039;Possibly empty category&amp;#039; }&lt;br /&gt;
			local txWPCat    = frame:expandTemplate{ title = &amp;#039;Wikipedia category&amp;#039;, args = { hidden = &amp;#039;yes&amp;#039;, tracking = &amp;#039;yes&amp;#039; } }&lt;br /&gt;
			local txDirtyCat = frame:expandTemplate{ title = &amp;#039;Polluted category&amp;#039; }&lt;br /&gt;
			local txTOC = whichTOC( frame )&lt;br /&gt;
			local idCat = &amp;#039;Articles with &amp;#039;..id..&amp;#039; identifiers&amp;#039;&lt;br /&gt;
			local wpfCat = &amp;#039;Articles with faulty authority control information&amp;#039;&lt;br /&gt;
			local outString = txCatMore..txEmptyCat..txWPCat..txDirtyCat..txTOC..&amp;#039;\n&amp;#039;..&lt;br /&gt;
							&amp;#039;Pages in this category should only be added by [[Module:Authority control]].&amp;#039;..&lt;br /&gt;
							addCat(idCat)..addCat(wpfCat, id)&lt;br /&gt;
			return outString&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Main/External Call&lt;br /&gt;
function p.autoDetect( frame )&lt;br /&gt;
	if currentTitle.namespace == 14 then --cat space&lt;br /&gt;
		local wpfaultyID = mw.ustring.match(title, &amp;#039;Articles with faulty ([%w%.%- ]+) identifiers&amp;#039;)&lt;br /&gt;
		local wpID       = mw.ustring.match(title, &amp;#039;Articles with ([%w%.%- ]+) identifiers&amp;#039;)&lt;br /&gt;
		if wpfaultyID then return wpfaulty( frame, wpfaultyID )     --must be before wpID check, in case they both match&lt;br /&gt;
		elseif wpID       then return wp( frame, wpID )             --to keep the regex simple&lt;br /&gt;
		else   return &amp;#039;[[Category:Pages with authority control identifiers unknown category]]&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;MSGJ</name></author>
	</entry>
</feed>