×
Create a new article
Write your page title here:
We currently have 1,662 articles on The Quelmar Wiki. Type your article name above or click on one of the titles below and start writing!



The Quelmar Wiki

Editing Module:CampaignNavbox

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 9: Line 9:
     -- Check if the page content is available
     -- Check if the page content is available
     if not wikitext then
     if not wikitext then
return "Campaign Page not found?"
        return "Error: Unable to fetch content for page '" .. pageTitle .. "'."
     end
     end


Line 15: Line 15:
         PA = {},
         PA = {},
         MD = {},
         MD = {},
        Twitch = {},
         Online = {}
         Online = {},
     }local function processRow(row)
                International = {}
     }
   
local function processRow(row)
     -- Extract everything up to the first "]]"
     -- Extract everything up to the first "]]"
     local campaignWithLink = row:match("^.-]]")
     local campaignWithLink = row:match("^.-]]")
    campaignWithLink = campaignWithLink:gsub("^|%s*'''", ""):gsub("'''%s*$", ""):gsub("'''", "")
     -- Extract the location, which is the last element before the end of the row
     -- Extract the location, which is the last element before the end of the row
     local location = row:match("[^\n]+$")
     local location = row:match("[^\n]+$")
    location = location:gsub("^|%s*'''", ""):gsub("'''%s*$", "")


     if campaignWithLink and location then
     if campaignWithLink and location then
        campaignWithLink = campaignWithLink:gsub("^|", ""):gsub("'''%s*$", ""):gsub("'''", ""):gsub("|%[%[", "%[%[")
        -- Trim the location string
    location = location:gsub("^|", ""):gsub("'''%s*$", "")
        --location = mw.text.trim(location)
   
 
         -- Add the campaign to the relevant location list
         -- Add the campaign to the relevant location list
         if location:find("PA") then
         if location:find("PA") then
             table.insert(campaigns.PA, campaignWithLink)
             table.insert(campaigns.PA, campaignWithLink)
            end
         elseif location:find("MD") then
         if location:find("MD") then
             table.insert(campaigns.MD, campaignWithLink)
             table.insert(campaigns.MD, campaignWithLink)
            end
         elseif location:find("Online") then
         if location:find("Online") then
             table.insert(campaigns.Online, campaignWithLink)
             table.insert(campaigns.Online, campaignWithLink)
         end
         end
                if location:find("Twitch") then
            table.insert(campaigns.Twitch, campaignWithLink)
                end
                if location:find("🇩🇪") then
            table.insert(campaigns.International, campaignWithLink)
                end
                        if location:find("🏴󠁧󠁢󠁳󠁣󠁴󠁿") then
            table.insert(campaigns.International, campaignWithLink)
            end
     end
     end
end
end
Please note that all contributions to The Quelmar Wiki are considered to be released under the Creative Commons Attribution (see The Quelmar Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page:

Cookies help us deliver our services. By using our services, you agree to our use of cookies. (Hi Margarita's Table. 🇩🇪)

Recent changes

  • Glamourpal • Yesterday at 00:41
  • Glamourpal • Yesterday at 00:37
  • Glamourpal • Yesterday at 00:33
  • Glamourpal • Yesterday at 00:33
  • Cookies help us deliver our services. By using our services, you agree to our use of cookies. (Hi Margarita's Table. 🇩🇪)