Module:User: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search
m (Typo)
(v2.1 - Merging {{OT}} into {{Talk Page Notice}} | Minor code optimization)
Line 35: Line 35:
if (data == "User" or data  == "") then
if (data == "User" or data  == "") then
return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Page'''</u></font><br/>''This is a user page for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If there are any problems with this page, please notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]].</div></div></center>")
return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Page'''</u></font><br/>''This is a user page for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If there are any problems with this page, please notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]].</div></div></center>")
end
elseif (data == "Talk") then
if (data == "Talk") then
return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Talk Page'''</u></font><br/>''This is a talk page for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If you came here to send this user a message, you may instead notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]] as this user will most-likely not respond.</div></div></center>")
return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Talk Page'''</u></font><br/>''This is a talk page for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If you came here to send this user a message, you may instead notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]] as this user will most-likely not respond.</div></div></center>")
end
elseif (data == "Sandbox") then
if (data == "Sandbox") then
return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Sandbox'''</u></font><br/>''This is a user sandbox for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If there are any problems with this page, please notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]].</div></div></center>")
return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Sandbox'''</u></font><br/>''This is a user sandbox for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If there are any problems with this page, please notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]].</div></div></center>")
else
utilsError.warn("You entered an invalid value. Accepted values include User, Talk, or Sandbox.")
end
end
end
end
Line 47: Line 47:
if (data == "Controversial") then
if (data == "Controversial") then
return ("<div class=\"mbox nomobile\"><div class=\"mbox-image\"><span style=\"font-size:80px;color:red\">[[File:TLoZ Fire Sprite.png|50px|link=]]</span></div><div class=\"mbox-content\"><span class=\"mbox-header\" style=\"font-size:25px\">'''Controversial Topic'''</span><br/>This series of messages involves a controverisal topic and discussions tend to get heated during debates like these. To prevent this, please direct any messages to the <code>#general</code> channel on the [https://discord.gg/eJnnvYb Zelda Wiki Discord server] or to the [http://zeldauniverse.net/forums/ Zelda Universe formus] unless you have ''substantial evidence'' to add to this discussion and intend only to find a resolution in the discussion.</div></div>")
return ("<div class=\"mbox nomobile\"><div class=\"mbox-image\"><span style=\"font-size:80px;color:red\">[[File:TLoZ Fire Sprite.png|50px|link=]]</span></div><div class=\"mbox-content\"><span class=\"mbox-header\" style=\"font-size:25px\">'''Controversial Topic'''</span><br/>This series of messages involves a controverisal topic and discussions tend to get heated during debates like these. To prevent this, please direct any messages to the <code>#general</code> channel on the [https://discord.gg/eJnnvYb Zelda Wiki Discord server] or to the [http://zeldauniverse.net/forums/ Zelda Universe formus] unless you have ''substantial evidence'' to add to this discussion and intend only to find a resolution in the discussion.</div></div>")
elseif (data == "Off Topic") then
return ("<div class=\"mbox nomobile\"><div class=\"mbox-image\"><span style=\"font-size:80px;color:red\">[[File:ZW Off-Topic Icon.svg|50px|link=]]</span></div><div class=\"mbox-content\"><span class=\"mbox-header\" style=\"font-size:25px\">'''Off-Topic Messages'''</span><br/>This series of messages doesn't relate to improving the page that this talk page corresponds to. Zelda Wiki is an encyclopedia, not a forum, so please direct these messages to the <code>#general</code> channel on the [https://discord.gg/eJnnvYb Zelda Wiki Discord server] or to the [http://zeldauniverse.net/forums/ Zelda Universe formus].</div></div>")
else
utilsError.warn("You entered an invalid value. See [[Template:Talk Page Notice#Usage|here]] for accepted values.")
end
end
end
end

Revision as of 21:48, 9 April 2022


local p = {}

local utilsError = require('Module:UtilsError')

function p.Main(frame)
    return p.main(frame.args)
end

function p.main(args)
	local template = args[1] --The Template that is being used. This parameter does not take user input.
	local data = args[2] --User input
	local data2 = args[3] --Extra user input
	
	if (template == "Archive List") then
		local archives = {}
		local archiveList = ""
		if (data ~= "") then --Error checks
			if ((tonumber(data) <= 0) == false) then
				for i=1,data do
					archives[i] = ("\n* [[/Archive " .. i .. "|Archive ".. i .. "]]")
				end
				for i=1,data do
					archiveList = (archiveList .. archives[i])
				end
				return string.format("{|class=\"messagebox\" style=\"display: flex; border: 4px solid #426787; background-color: #1d578b; float: right; border-radius:10px;\"\n|[[File:Zwlogo2dlarge.png|50px|center]]\n|-\n|<u>'''Archives of %s'''</u>\n|-\n|<small>%s</small>\n|}", data2, archiveList)
			else
				utilsError.warn("The first parameter must be a number greater than 0.")
			end
		else
			utilsError.warn("You must enter the number of archives in the first parameter.")
		end
	end
	
	if (template == "Legacy User") then
		if (data == "User" or data  == "") then
			return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Page'''</u></font><br/>''This is a user page for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If there are any problems with this page, please notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]].</div></div></center>")
		elseif (data == "Talk") then
			return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Talk Page'''</u></font><br/>''This is a talk page for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If you came here to send this user a message, you may instead notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]] as this user will most-likely not respond.</div></div></center>")
		elseif (data == "Sandbox") then
			return string.format("<center><div style=\"display: flex; max-width: 625px; border: 5px solid; background-color: #5e5d5e; border-color: #000000; text-align: center; border-radius: 25px;\"><div style=\"font size=\"95%%\"><font size=\"5%%\"><u>'''Legacy User Sandbox'''</u></font><br/>''This is a user sandbox for a legacy account, which is a very old wiki account that has long been abandoned. This page is locked from editing as it's here to preserve history. If there are any problems with this page, please notify a [[Zelda Wiki:Staff List#Wiki Staff|Staff member]].</div></div></center>")
		else
			utilsError.warn("You entered an invalid value. Accepted values include User, Talk, or Sandbox.")
		end
	end
	
	if (template == "Talk Page Notice") then
		if (data == "Controversial") then
			return ("<div class=\"mbox nomobile\"><div class=\"mbox-image\"><span style=\"font-size:80px;color:red\">[[File:TLoZ Fire Sprite.png|50px|link=]]</span></div><div class=\"mbox-content\"><span class=\"mbox-header\" style=\"font-size:25px\">'''Controversial Topic'''</span><br/>This series of messages involves a controverisal topic and discussions tend to get heated during debates like these. To prevent this, please direct any messages to the <code>#general</code> channel on the [https://discord.gg/eJnnvYb Zelda Wiki Discord server] or to the [http://zeldauniverse.net/forums/ Zelda Universe formus] unless you have ''substantial evidence'' to add to this discussion and intend only to find a resolution in the discussion.</div></div>")
		elseif (data == "Off Topic") then
			return ("<div class=\"mbox nomobile\"><div class=\"mbox-image\"><span style=\"font-size:80px;color:red\">[[File:ZW Off-Topic Icon.svg|50px|link=]]</span></div><div class=\"mbox-content\"><span class=\"mbox-header\" style=\"font-size:25px\">'''Off-Topic Messages'''</span><br/>This series of messages doesn't relate to improving the page that this talk page corresponds to. Zelda Wiki is an encyclopedia, not a forum, so please direct these messages to the <code>#general</code> channel on the [https://discord.gg/eJnnvYb Zelda Wiki Discord server] or to the [http://zeldauniverse.net/forums/ Zelda Universe formus].</div></div>")
		else
			utilsError.warn("You entered an invalid value. See [[Template:Talk Page Notice#Usage|here]] for accepted values.")
		end
	end
end

return p