<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ABlockMessages</id>
	<title>Module:BlockMessages - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ABlockMessages"/>
	<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:BlockMessages&amp;action=history"/>
	<updated>2026-04-07T18:18:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://mbwiki.stairwaygames.work/w/index.php?title=Module:BlockMessages&amp;diff=5676&amp;oldid=prev</id>
		<title>Admin coral island: Created page with &quot;--| Module:BlockMessages (v2.2.0) --by &quot;The JoTS&quot;  -- v3.0 (Planned) - Drop requirement for sub&#039;d &quot;:&quot; for &quot;&amp;#58;&quot; -- v2.2 - Support for message headers and footers -- v2.1 - Preparation function for MediaWiki:Ipbreason-dropdown -- v2.0 - Now only accepts named parameters. (To avoid errors with &quot;=&quot;)  --- This module is meant to be used in conjunction to MessageBlock and --- allows for customized block messages for every offense listed in the --- Ipbreason-dropdown sys...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:BlockMessages&amp;diff=5676&amp;oldid=prev"/>
		<updated>2023-08-03T16:58:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--| Module:BlockMessages (v2.2.0) --by &amp;quot;The JoTS&amp;quot;  -- v3.0 (Planned) - Drop requirement for sub&amp;#039;d &amp;quot;:&amp;quot; for &amp;quot;:&amp;quot; -- v2.2 - Support for message headers and footers -- v2.1 - Preparation function for MediaWiki:Ipbreason-dropdown -- v2.0 - Now only accepts named parameters. (To avoid errors with &amp;quot;=&amp;quot;)  --- This module is meant to be used in conjunction to &lt;a href=&quot;/w/index.php?title=MessageBlock&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;MessageBlock (page does not exist)&quot;&gt;MessageBlock&lt;/a&gt; and --- allows for customized block messages for every offense listed in the --- Ipbreason-dropdown sys...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--| Module:BlockMessages (v2.2.0)&lt;br /&gt;
--by &amp;quot;The JoTS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- v3.0 (Planned) - Drop requirement for sub&amp;#039;d &amp;quot;:&amp;quot; for &amp;quot;&amp;amp;#58;&amp;quot;&lt;br /&gt;
-- v2.2 - Support for message headers and footers&lt;br /&gt;
-- v2.1 - Preparation function for MediaWiki:Ipbreason-dropdown&lt;br /&gt;
-- v2.0 - Now only accepts named parameters. (To avoid errors with &amp;quot;=&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
--- This module is meant to be used in conjunction to [[MessageBlock]] and&lt;br /&gt;
--- allows for customized block messages for every offense listed in the&lt;br /&gt;
--- Ipbreason-dropdown system message.&lt;br /&gt;
&lt;br /&gt;
-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-- [==[ Module Start ]==] ------&lt;br /&gt;
local bm = {}&lt;br /&gt;
&lt;br /&gt;
function bm.main(frame)&lt;br /&gt;
    local reasons  = setmetatable({}, {&lt;br /&gt;
        __index = function(t,i)&lt;br /&gt;
            return rawget(t, &amp;quot;__DEFAULT__&amp;quot;)&lt;br /&gt;
                or {&amp;quot;You have been banned for $2 because &amp;quot;, i, &amp;quot;:$1&amp;quot; }&lt;br /&gt;
        end&lt;br /&gt;
    })&lt;br /&gt;
    &lt;br /&gt;
    do local _reasons, currReason&lt;br /&gt;
        -- Get messages&lt;br /&gt;
        _reasons = mw.message.new(&amp;quot;Custom-Ipbreason-messages&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
        assert(_reasons:exists(),&lt;br /&gt;
            &amp;quot;MediaWiki:Custom-Ipbreason-messages does not exist.&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
        -- Parse messages&lt;br /&gt;
        for type, msg in&lt;br /&gt;
                (tostring(_reasons)..&amp;#039;\n&amp;#039;):gmatch(&amp;quot;([;:])(.-)\n&amp;quot;) do&lt;br /&gt;
            if type == &amp;quot;;&amp;quot; then&lt;br /&gt;
                currReason = {}&lt;br /&gt;
                reasons[msg] = currReason&lt;br /&gt;
            elseif type == &amp;quot;:&amp;quot; and currReason then&lt;br /&gt;
                table.insert(currReason, msg)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Get selected message&lt;br /&gt;
    local args = frame.args&lt;br /&gt;
    local offense, notes = args[&amp;quot;reason&amp;quot;]:match(&amp;quot;^(.-):%s*(.+)&amp;quot;)&lt;br /&gt;
    offense = offense or args[&amp;quot;reason&amp;quot;]&lt;br /&gt;
    &lt;br /&gt;
    return frame:preprocess(mw.text.trim(&lt;br /&gt;
        string.gsub(&lt;br /&gt;
            table.concat(rawget(reasons, &amp;quot;__HEADER__&amp;quot;) or {}, &amp;#039;\n&amp;#039;) ..&lt;br /&gt;
            table.concat(reasons[offense], &amp;#039;\n&amp;#039;) ..&lt;br /&gt;
            table.concat(rawget(reasons, &amp;quot;__FOOTER__&amp;quot;) or {}, &amp;#039;\n&amp;#039;),&lt;br /&gt;
            &amp;quot;$%d&amp;quot;, {&lt;br /&gt;
                    [&amp;quot;$1&amp;quot;] = notes or &amp;#039;&amp;#039;,&lt;br /&gt;
                    [&amp;quot;$2&amp;quot;] = args[&amp;quot;expiry&amp;quot;]&lt;br /&gt;
            }&lt;br /&gt;
        )&lt;br /&gt;
    ))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bm.prep(frame)&lt;br /&gt;
    local page = mw.title.getCurrentTitle()&lt;br /&gt;
    local content = page:getContent()&lt;br /&gt;
    &lt;br /&gt;
    if page.fullText ~= &amp;quot;MediaWiki:Ipbreason-dropdown&amp;quot; then&lt;br /&gt;
        return content&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return ( content:gsub(&amp;#039;:&amp;#039;, &amp;quot;&amp;amp;#58;&amp;quot;) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return bm&lt;/div&gt;</summary>
		<author><name>Admin coral island</name></author>
	</entry>
</feed>