<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AForumheader</id>
	<title>Module:Forumheader - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AForumheader"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Forumheader&amp;action=history"/>
	<updated>2026-04-30T22:37:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Forumheader&amp;diff=34939&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;-- &lt;nowiki&gt; -- Implements {{Forumheader}} -- -- @todo make types and closures easier on the eye -- @todo add notice to archive old forums to catch when we undelete old forums that aren&#039;t archived -- -- Categories added by this module: -- &gt; Category:Redwood Grove -- &gt; Category:Active threads -- &gt; Category:Forums excluded from the main page -- &gt; Category:Forum archives/$type -- &gt; Category:Forum archives with invalid type parameter -- &gt; [[Category:Forum...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Forumheader&amp;diff=34939&amp;oldid=prev"/>
		<updated>2024-10-16T23:12:07Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- &amp;lt;nowiki&amp;gt; -- Implements {{Forumheader}} -- -- @todo make types and closures easier on the eye -- @todo add notice to archive old forums to catch when we undelete old forums that aren&amp;#039;t archived -- -- Categories added by this module: -- &amp;gt; &lt;a href=&quot;/w/Category:Redwood_Grove&quot; title=&quot;Category:Redwood Grove&quot;&gt;Category:Redwood Grove&lt;/a&gt; -- &amp;gt; &lt;a href=&quot;/w/Category:Active_threads&quot; title=&quot;Category:Active threads&quot;&gt;Category:Active threads&lt;/a&gt; -- &amp;gt; &lt;a href=&quot;/index.php?title=Category:Forums_excluded_from_the_main_page&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Forums excluded from the main page (page does not exist)&quot;&gt;Category:Forums excluded from the main page&lt;/a&gt; -- &amp;gt; &lt;a href=&quot;/index.php?title=Category:Forum_archives/$type&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Forum archives/$type (page does not exist)&quot;&gt;Category:Forum archives/$type&lt;/a&gt; -- &amp;gt; &lt;a href=&quot;/index.php?title=Category:Forum_archives_with_invalid_type_parameter&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Forum archives with invalid type parameter (page does not exist)&quot;&gt;Category:Forum archives with invalid type parameter&lt;/a&gt; -- &amp;gt; [[Category:Forum...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
-- Implements {{Forumheader}}&lt;br /&gt;
--&lt;br /&gt;
-- @todo make types and closures easier on the eye&lt;br /&gt;
-- @todo add notice to archive old forums to catch when we undelete old forums that aren&amp;#039;t archived&lt;br /&gt;
--&lt;br /&gt;
-- Categories added by this module:&lt;br /&gt;
-- &amp;gt; [[Category:Redwood Grove]]&lt;br /&gt;
-- &amp;gt; [[Category:Active threads]]&lt;br /&gt;
-- &amp;gt; [[Category:Forums excluded from the main page]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives/$type]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives with invalid type parameter]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives with missing type parameter]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives by date closed]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives by month/$year]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives with missing date parameter]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives with missing name parameter]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives with missing subject parameter]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives with invalid closure parameter]]&lt;br /&gt;
-- &amp;gt; [[Category:Forum archives with missing closure parameter]]&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local lang = mw.getContentLanguage()&lt;br /&gt;
local title = mw.title.getCurrentTitle()&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- list of type aliases&lt;br /&gt;
local types = {&lt;br /&gt;
    community = {&lt;br /&gt;
        community = true,&lt;br /&gt;
        comm = true&lt;br /&gt;
    },&lt;br /&gt;
    content = {&lt;br /&gt;
        content = true&lt;br /&gt;
    },&lt;br /&gt;
    discussion = {&lt;br /&gt;
        discussion = true,&lt;br /&gt;
        discuss = true,&lt;br /&gt;
        disc = true&lt;br /&gt;
    },&lt;br /&gt;
    miscellaneous = {&lt;br /&gt;
        miscellaneous = true,&lt;br /&gt;
        misc = true&lt;br /&gt;
    },&lt;br /&gt;
    policy = {&lt;br /&gt;
        policy = true&lt;br /&gt;
    },&lt;br /&gt;
    technical = {&lt;br /&gt;
        technical = true,&lt;br /&gt;
        tech = true&lt;br /&gt;
    },&lt;br /&gt;
    [&amp;#039;user-related&amp;#039;] = {&lt;br /&gt;
        [&amp;#039;user-related&amp;#039;] = true,&lt;br /&gt;
        [&amp;#039;user related&amp;#039;] = true,&lt;br /&gt;
        user = true&lt;br /&gt;
    },&lt;br /&gt;
    [&amp;#039;clan chat&amp;#039;] = {&lt;br /&gt;
        [&amp;#039;clan chat&amp;#039;] = true,&lt;br /&gt;
        clan = true&lt;br /&gt;
    },&lt;br /&gt;
    meta = {&lt;br /&gt;
        meta = true&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- list of closure aliases&lt;br /&gt;
local closures = {&lt;br /&gt;
    allow = {&lt;br /&gt;
        allow = true&lt;br /&gt;
    },&lt;br /&gt;
    disallow = {&lt;br /&gt;
        disallow = true&lt;br /&gt;
    },&lt;br /&gt;
    [&amp;#039;no consensus&amp;#039;] = {&lt;br /&gt;
        [&amp;#039;no consensus&amp;#039;] = true,&lt;br /&gt;
        consensus = true,&lt;br /&gt;
        [&amp;#039;no con&amp;#039;] = true&lt;br /&gt;
    },&lt;br /&gt;
    withdrawn = {&lt;br /&gt;
        withdrawn = true,&lt;br /&gt;
        with = true&lt;br /&gt;
    },&lt;br /&gt;
    [&amp;#039;no proposal&amp;#039;] = {&lt;br /&gt;
        [&amp;#039;no proposal&amp;#039;] = true,&lt;br /&gt;
        proposal = true&lt;br /&gt;
    },&lt;br /&gt;
    [&amp;#039;no formal closure&amp;#039;] = {&lt;br /&gt;
        [&amp;#039;no formal closure&amp;#039;] = true,&lt;br /&gt;
        [&amp;#039;no closure&amp;#039;] = true,&lt;br /&gt;
        none = true&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Output archive notice&lt;br /&gt;
--&lt;br /&gt;
-- @todo convert {{Archive}} to a module&lt;br /&gt;
--&lt;br /&gt;
local function archived(frame, args)&lt;br /&gt;
    local ret = &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    if yesno(args.archive) then&lt;br /&gt;
        ret = &amp;#039;{{Archive|date=&amp;#039; .. (args.date  or &amp;#039;&amp;#039;) ..  &amp;#039;|user=&amp;#039; .. (args.user or &amp;#039;&amp;#039;) .. &amp;#039;}}&amp;#039;&lt;br /&gt;
        ret = frame:preprocess(ret)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Output Redwood Grove nav&lt;br /&gt;
--&lt;br /&gt;
local function nav(args)&lt;br /&gt;
    local nav = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
        :addClass(&amp;#039;messagebox&amp;#039;)&lt;br /&gt;
        :css({padding = &amp;#039;1em&amp;#039;, width = &amp;#039;initial&amp;#039;})&lt;br /&gt;
        :wikitext(&amp;#039;&amp;lt;strong&amp;gt;Forums:&amp;lt;/strong&amp;gt; [[Forum:Redwood Grove|Redwood Grove]] &amp;gt; &amp;lt;strong&amp;gt;&amp;#039; .. title.text .. &amp;#039;&amp;lt;/strong&amp;gt;&amp;#039;)&lt;br /&gt;
        :done()&lt;br /&gt;
    &lt;br /&gt;
    return tostring(nav)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Category handler&lt;br /&gt;
--&lt;br /&gt;
local function categories(_args)&lt;br /&gt;
    local cats = {}&lt;br /&gt;
    local args = {}&lt;br /&gt;
    &lt;br /&gt;
    -- make blank params behave like missing params&lt;br /&gt;
    for k, v in pairs(_args) do&lt;br /&gt;
        if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
            args[k] = v&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Redwood grove&lt;br /&gt;
    table.insert(cats, &amp;#039;[[Category:Redwood Grove|&amp;#039; .. title.text .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    -- option to hide the forum on the main page&lt;br /&gt;
    if yesno(args.mainpage) == false and not yesno(args.archive) then&lt;br /&gt;
        table.insert(cats, &amp;#039;[[Category:Forums excluded from the main page]]&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- active/closed threads&lt;br /&gt;
    if yesno(args.archive) then&lt;br /&gt;
        -- handle type&lt;br /&gt;
        if args.type then&lt;br /&gt;
            local catType&lt;br /&gt;
            local lcType = lang:lc(args.type)&lt;br /&gt;
&lt;br /&gt;
            for k, v in pairs(types) do&lt;br /&gt;
                if v[lcType] then&lt;br /&gt;
                    catType = lang:ucfirst(k)&lt;br /&gt;
                    break&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
    &lt;br /&gt;
            if catType then&lt;br /&gt;
                table.insert(cats, &amp;#039;[[Category:Forum archives/&amp;#039; .. catType .. &amp;#039;|&amp;#039;.. title.text .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
            else&lt;br /&gt;
                table.insert(cats, &amp;#039;[[Category:Forum archives with invalid type parameter]]&amp;#039;)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            table.insert(cats, &amp;#039;[[Category:Forum archives with missing type parameter]]&amp;#039;)&lt;br /&gt;
        end&lt;br /&gt;
    &lt;br /&gt;
        -- date closed&lt;br /&gt;
        -- @todo default to revisiontimestamp&lt;br /&gt;
        if args.date then&lt;br /&gt;
            mw.log(args.date)&lt;br /&gt;
            local dateStr = lang:formatDate(&amp;#039;c&amp;#039;, args.date)&lt;br /&gt;
            table.insert(cats, &amp;#039;[[Category:Forum archives by date closed|*&amp;#039; .. dateStr .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
        &lt;br /&gt;
            local year = lang:formatDate(&amp;#039;Y&amp;#039;, args.date)&lt;br /&gt;
            local month = lang:formatDate(&amp;#039;n&amp;#039;, args.date)&lt;br /&gt;
            local day = lang:formatDate(&amp;#039;d H:i&amp;#039;, args.date)&lt;br /&gt;
        &lt;br /&gt;
            month = month&lt;br /&gt;
                :gsub(&amp;#039;10&amp;#039;, &amp;#039;A&amp;#039;)&lt;br /&gt;
                :gsub(&amp;#039;11&amp;#039;, &amp;#039;B&amp;#039;)&lt;br /&gt;
                :gsub(&amp;#039;12&amp;#039;, &amp;#039;C&amp;#039;)&lt;br /&gt;
        &lt;br /&gt;
            table.insert(cats, &amp;#039;[[Category:Forum archives by month/&amp;#039; .. year .. &amp;#039;|&amp;#039; .. month .. &amp;#039; &amp;#039; .. day .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
        else&lt;br /&gt;
            table.insert(cats, &amp;#039;[[Category:Forum archives with missing date parameter]]&amp;#039;)&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
        -- other args&lt;br /&gt;
        if not args.user then&lt;br /&gt;
            -- @todo Should we do anything here?&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        if not args.name then&lt;br /&gt;
            table.insert(cats, &amp;#039;[[Category:Forum archives with missing name parameter]]&amp;#039;)&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        if not args.subject then&lt;br /&gt;
            table.insert(cats, &amp;#039;[[Category:Forum archives with missing subject parameter]]&amp;#039;)&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        if args.closure then&lt;br /&gt;
            local lcClosure = lang:lc(args.closure or &amp;#039;&amp;#039;)&lt;br /&gt;
            local closure&lt;br /&gt;
            &lt;br /&gt;
            for k, v in pairs(closures) do&lt;br /&gt;
                if v[lcClosure] then&lt;br /&gt;
                   closure = k&lt;br /&gt;
                   break&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        &lt;br /&gt;
            if not closure then&lt;br /&gt;
                table.insert(cats, &amp;#039;[[Category:Forum archives with invalid closure parameter]]&amp;#039;)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            table.insert(cats, &amp;#039;[[Category:Forum archives with missing closure parameter]]&amp;#039;)&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        table.insert(cats, &amp;#039;[[Category:Active threads|&amp;#039;.. title.text .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return table.concat(cats, &amp;#039;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Access point&lt;br /&gt;
--&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    local args = frame:getParent().args&lt;br /&gt;
    &lt;br /&gt;
    return nav(args) .. archived(frame, args) .. categories(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>