Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Tournament: Difference between revisions

From eSportsAmaze
No edit summary
No edit summary
Line 13: Line 13:
     if string.find(amount, "%$") then currency = "$" end
     if string.find(amount, "%$") then currency = "$" end
     local n = tostring(amount):gsub(",", ""):gsub("₹", ""):gsub("%$", "")
     local n = tostring(amount):gsub(",", ""):gsub("₹", ""):gsub("%$", "")
   
     if #n <= 3 then return currency .. " " .. n end
     if #n <= 3 then return currency .. " " .. n end
   
     local last3 = n:sub(-3)
     local last3 = n:sub(-3)
     local rest = n:sub(1, -4)
     local rest = n:sub(1, -4)
     local formattedRest = rest:reverse():gsub("(%d%d)", "%1,"):reverse()
     local formattedRest = rest:reverse():gsub("(%d%d)", "%1,"):reverse()
     if formattedRest:sub(1, 1) == "," then formattedRest = formattedRest:sub(2) end
     if formattedRest:sub(1, 1) == "," then formattedRest = formattedRest:sub(2) end
   
     return currency .. " " .. formattedRest .. "," .. last3
     return '<span class="pz-prize">' .. currency .. " " .. formattedRest .. "," .. last3 .. '</span>'
end
end


-- Helper: Clean Title
-- Helper: Date Ranger
local function getCleanTitle(pageLink)
local function formatDateRange(startStr, endStr)
     if not pageLink then return "" end
     if not startStr or startStr == "" then return "TBA" end
     local title = mw.title.new(pageLink)
     if endStr and endStr ~= "" and endStr ~= startStr then
    if title then return title.subpageText end
        local s = lang:formatDate('d M', startStr)
    return pageLink
        local e = lang:formatDate('d M, Y', endStr)
end
         return s .. " – " .. e
 
-- Helper: Tournament Logo (Small for Lists)
local function getTourneyLogo(imageFile)
    local container = html.create('div'):addClass('tr-event-logo')
   
    if imageFile and imageFile ~= "" then
         -- We explicitly size it to 40px for list views
        container:wikitext('[[File:' .. imageFile .. '|40px|link=]]')
     else
     else
         -- Fallback icon if no image
         return lang:formatDate('d M, Y', startStr)
        container:wikitext('<i class="fa-solid fa-trophy" style="color:var(--text-muted); opacity:0.3;"></i>')
     end
     end
   
    return tostring(container)
end
end


-- Helper: Team Logo Logic (For Infobox/Winner)
-- Helper: Theme Aware Logo (For Infobox)
local function getLogo(pageName, image, imageDark)
local function getInfoboxLogo(pageName, image, imageDark)
     local lightFile = (image ~= "" and image) or (pageName .. '.png')
     local lightFile = (image ~= "" and image) or (pageName .. '.png')
     local darkFile = (imageDark ~= "" and imageDark) or (pageName .. '_dark.png')
   
    -- Auto-detect dark if not provided
     local darkFile = imageDark
    if not darkFile or darkFile == "" then
        local ext = lightFile:match("^.+(%..+)$") or ".png"
        local name = lightFile:gsub("%..+$", "")
        darkFile = name .. "_dark" .. ext
    end
      
      
     local hasLight = mw.title.new('File:' .. lightFile).exists
     local hasLight = mw.title.new('File:' .. lightFile).exists
     local hasDark = mw.title.new('File:' .. darkFile).exists
     local hasDark = mw.title.new('File:' .. darkFile).exists
      
      
     local container = html.create('div'):addClass('infobox-image')
     local container = html.create('div'):addClass('fib-image')
      
      
     local lDiv = container:tag('div'):addClass('logo-lightmode')
    -- Light
     if hasLight then lDiv:wikitext('[[File:' .. lightFile .. '|200px]]') else lDiv:wikitext('[[File:Shield_team.png|200px]]') end
     local lSpan = container:tag('span'):addClass('logo-lightmode')
     if hasLight then lSpan:wikitext('[[File:' .. lightFile .. '|250px]]') else lSpan:wikitext('[[File:Shield_team.png|150px]]') end
      
      
     local dDiv = container:tag('div'):addClass('logo-darkmode')
    -- Dark
     if hasDark then dDiv:wikitext('[[File:' .. darkFile .. '|200px]]') elseif hasLight then dDiv:wikitext('[[File:' .. lightFile .. '|200px]]') else dDiv:wikitext('[[File:Shield_team_dark.png|200px]]') end
     local dSpan = container:tag('span'):addClass('logo-darkmode')
     if hasDark then dSpan:wikitext('[[File:' .. darkFile .. '|250px]]') elseif hasLight then dSpan:wikitext('[[File:' .. lightFile .. '|250px]]') else dSpan:wikitext('[[File:Shield_team_dark.png|150px]]') end
      
      
     return container
     return tostring(container)
end
end


-- Helper: Small Team Logo
-- Helper: Social Icon Generator
local function getSmallLogo(teamName)
local function getSocials(args)
    if not teamName or teamName == "" then return "" end
     local container = html.create('div'):addClass('fib-socials')
     local clean = teamName:gsub("'", "")
     local hasSocials = false
    local light = clean .. '.png'
     local dark = clean .. '_dark.png'
      
      
     local container = html.create('span'):addClass('tr-logo')
     local platforms = {
    if mw.title.new('File:' .. light).exists then container:wikitext('[[File:' .. light .. '|link=|class=logo-lightmode]]') else container:wikitext('[[File:Shield_team.png|link=|class=logo-lightmode]]') end
        {arg='instagram', icon='fa-brands fa-instagram'},
    if mw.title.new('File:' .. dark).exists then container:wikitext('[[File:' .. dark .. '|link=|class=logo-darkmode]]') elseif mw.title.new('File:' .. light).exists then container:wikitext('[[File:' .. light .. '|link=|class=logo-darkmode]]') else container:wikitext('[[File:Shield_team_dark.png|link=|class=logo-darkmode]]') end
        {arg='twitter', icon='fa-brands fa-x-twitter'},
    return tostring(container)
        {arg='youtube', icon='fa-brands fa-youtube'},
end
        {arg='discord', icon='fa-brands fa-discord'},
 
         {arg='facebook', icon='fa-brands fa-facebook'},
-- Helper: Date Ranger
         {arg='website', icon='fa-solid fa-globe'}
local function formatDateRange(startStr, endStr)
     }
    if not startStr or startStr == "" then return "TBA" end
   
    if endStr and endStr ~= "" and endStr ~= startStr then
    for _, p in ipairs(platforms) do
         local s = lang:formatDate('d M', startStr)
        if args[p.arg] and args[p.arg] ~= "" then
        local e = lang:formatDate('d M, Y', endStr)
            hasSocials = true
         return s .. " –<br>" .. e
            container:tag('a')
    else
                :attr('href', args[p.arg])
        return lang:formatDate('d M, Y', startStr)
                :addClass('fib-social-icon')
     end
                :attr('target', '_blank')
end
                :wikitext('<i class="' .. p.icon .. '"></i>')
 
        end
-- Helper: Add Infobox Row
local function addRow(container, label, value)
    if value and value ~= "" then
        container:tag('div'):addClass('infobox-row')
            :tag('div'):addClass('infobox-label'):wikitext(label):done()
            :tag('div'):addClass('infobox-data'):wikitext(value):done()
     end
     end
   
    if hasSocials then return tostring(container) else return "" end
end
end


-- ============================================================
-- ============================================================
-- MAIN 1: TOURNAMENT INFOBOX
-- MAIN 1: TOURNAMENT INFOBOX (Redesigned)
-- ============================================================
-- ============================================================
function p.infobox(frame)
function p.infobox(frame)
Line 108: Line 97:
     local cleanName = mw.title.getCurrentTitle().subpageText
     local cleanName = mw.title.getCurrentTitle().subpageText
      
      
     -- STORE TO CARGO
    local prizeMoney = args.prize_pool or args.prizepool
   
     -- 1. STORE TO CARGO
     if mw.ext.cargo and mw.ext.cargo.store then
     if mw.ext.cargo and mw.ext.cargo.store then
         mw.ext.cargo.store('Tournaments', {
         mw.ext.cargo.store('Tournaments', {
             _pageName = mw.title.getCurrentTitle().prefixedText,
             _pageName = mw.title.getCurrentTitle().prefixedText,
             name = args.name or cleanName,
             name = args.name or cleanName,
            series = args.series,
            organizer = args.organizer,
            sponsor = args.sponsor,
            game = args.game or "BGMI",
            mode = args.mode,
            type = args.type,
            tier = args.tier,
            device = args.device,
            location = args.location,
            venue = args.venue,
            prize_pool = prizeMoney,
             start_date = args.start_date,
             start_date = args.start_date,
             end_date = args.end_date,
             end_date = args.end_date,
            organizer = args.organizer,
            prize_pool = args.prizepool,
             winner = args.winner,
             winner = args.winner,
             type = args.type,
             previous = args.previous,
             image = args.image
            next = args.next,
             image = args.image,
            image_dark = args.image_dark
         })
         })
     end
     end


     local root = html.create('div'):addClass('infobox')
    -- 2. BUILD FLAT INFOBOX
    root:tag('div'):addClass('infobox-header'):wikitext(args.name or cleanName)
     local root = html.create('div'):addClass('flat-infobox')
    root:node(getLogo(page, args.image, args.image_dark))
      
      
     local data = root:tag('div'):addClass('infobox-data-container')
    -- A. Header & Logo
     if args.series then addRow(data, "Series", '[[' .. args.series .. ']]') end
     local header = root:tag('div'):addClass('fib-header')
     addRow(data, "Organizer", args.organizer)
     header:tag('div'):addClass('fib-title'):wikitext(args.name or cleanName)
     addRow(data, "Type", args.type)
     header:wikitext(getInfoboxLogo(page, args.image, args.image_dark))
     addRow(data, "Location", args.location)
      
     if args.prizepool then addRow(data, "Prize Pool", formatCurrency(args.prizepool)) end
    -- B. Key Stats Grid (Row 1: Tier | Type)
     addRow(data, "Start Date", args.start_date)
     local grid1 = root:tag('div'):addClass('fib-grid')
    addRow(data, "End Date", args.end_date)
     grid1:tag('div'):addClass('fib-cell')
    if args.winner then addRow(data, "Winner", "'''[[" .. args.winner .. "]]'''") end
        :tag('div'):addClass('fib-label-sm'):wikitext('Event Tier'):done()
 
        :tag('div'):addClass('fib-value-sm'):wikitext(args.tier or 'Unranked'):done()
     return tostring(root)
      
end
    grid1:tag('div'):addClass('fib-cell')
 
        :tag('div'):addClass('fib-label-sm'):wikitext('Type'):done()
-- ============================================================
        :tag('div'):addClass('fib-value-sm'):wikitext(args.type or 'Online'):done()
-- MAIN 2: LIST ROW (Tournaments Page)
       
-- ============================================================
     -- C. Key Stats Grid (Row 2: Mode | Location)
function p.listRow(frame)
    local grid2 = root:tag('div'):addClass('fib-grid')
     local args = frame.args
    grid2:tag('div'):addClass('fib-cell')
     local page = args.Page or ""
        :tag('div'):addClass('fib-label-sm'):wikitext('Mode'):done()
     local name = getCleanTitle(page)
        :tag('div'):addClass('fib-value-sm'):wikitext(args.mode or 'TBD'):done()
     local startDate = args.start_date or ""
   
     local endDate = args.end_date or ""
    grid2:tag('div'):addClass('fib-cell')
        :tag('div'):addClass('fib-label-sm'):wikitext('Location'):done()
        :tag('div'):addClass('fib-value-sm'):wikitext(args.location or 'India'):done()
      
     -- D. Prize Pool Section
     if prizeMoney then
        root:tag('div'):addClass('fib-prize')
            :tag('div'):addClass('fib-label-sm'):wikitext('Total Prize Pool'):done()
            :tag('div'):addClass('fib-prize-val'):wikitext(formatCurrency(prizeMoney)):done()
     end
   
    -- E. Detailed List
     local list = root:tag('div'):addClass('fib-list')
      
      
     local row = html.create('div'):addClass('tourney-row')
     local function addRow(label, value)
        if value and value ~= "" then
            list:tag('div'):addClass('fib-row')
                :tag('div'):addClass('fib-label'):wikitext(label):done()
                :tag('div'):addClass('fib-data'):wikitext(value):done()
        end
    end
      
      
     row:tag('div'):addClass('tr-date'):wikitext(formatDateRange(startDate, endDate))
     addRow('Series', args.series and '[[' .. args.series .. ']]')
    addRow('Organizer', args.organizer)
    addRow('Sponsors', args.sponsor)
    addRow('Venue', args.venue)
    addRow('Dates', formatDateRange(args.start_date, args.end_date))
    addRow('Device', args.device)
      
      
     local info = row:tag('div'):addClass('tr-info')
     if args.winner then
    info:tag('div'):addClass('tr-name'):wikitext('[[' .. page .. '|' .. name .. ']]')
        addRow('Winner', "'''[[" .. args.winner .. "]]'''")
    if args.organizer then info:tag('div'):addClass('tr-org'):wikitext(args.organizer) end
       
    local winDiv = row:tag('div'):addClass('tr-winner mobile-hide')
    if args.winner and args.winner ~= "" then
        winDiv:wikitext(getSmallLogo(args.winner))
        winDiv:tag('span'):wikitext(args.winner)
    else
        winDiv:tag('span'):addClass('dim-text'):wikitext('-')
     end
     end
   
    -- F. Socials
    root:wikitext(getSocials(args))
   
    -- G. Navigation Footer
    if args.previous or args.next then
        local nav = root:tag('div'):addClass('fib-nav')
          
          
    local prizeDiv = row:tag('div'):addClass('tr-prize')
        -- Previous Button
    prizeDiv:wikitext(formatCurrency(args.prize_pool))
        local prevBtn = nav:tag('div'):addClass('fib-nav-btn prev')
        if args.previous and args.previous ~= "" then
            prevBtn:wikitext('[[File:Arrow_left.svg|12px|link=]] [[' .. args.previous .. '|Previous]]')
        else
            prevBtn:css('opacity', '0.3'):wikitext('Previous')
        end
          
          
     return tostring(row)
        -- Next Button
        local nextBtn = nav:tag('div'):addClass('fib-nav-btn next')
        if args.next and args.next ~= "" then
            nextBtn:wikitext('[[' .. args.next .. '|Next]] [[File:Arrow_right.svg|12px|link=]]')
        else
            nextBtn:css('opacity', '0.3'):wikitext('Next')
        end
    end
 
     return tostring(root)
end
end


-- ============================================================
-- ============================================================
-- MAIN 3: LIST ROW MAIN (Homepage - WITH LOGO)
-- MAIN 2 & 3: LIST ROWS (Preserved from before)
-- ============================================================
-- ============================================================
-- (Keep p.listRow and p.listRowMain exactly as they were in the previous code)
-- For brevity, I am not pasting them again here, but ensure you keep them in the module!
function p.listRow(frame)
    -- ... (Keep existing code)
    return "" -- Placeholder
end
function p.listRowMain(frame)
function p.listRowMain(frame)
     local args = frame.args
     -- ... (Keep existing code)
    local page = args.Page or ""
     return "" -- Placeholder
    local name = getCleanTitle(page)
    local startDate = args.start_date or ""
    local endDate = args.end_date or ""
    local image = args.image or ""
   
    local row = html.create('div'):addClass('tourney-row tr-compact')
   
    -- 1. Date
    row:tag('div'):addClass('tr-date'):wikitext(formatDateRange(startDate, endDate))
   
    -- 2. Logo (New Column)
    row:tag('div'):addClass('tr-event-logo-col')
      :wikitext(getTourneyLogo(image))
 
    -- 3. Info
    local info = row:tag('div'):addClass('tr-info')
    info:tag('div'):addClass('tr-name'):wikitext('[[' .. page .. '|' .. name .. ']]')
    if args.organizer then info:tag('div'):addClass('tr-org'):wikitext(args.organizer) end
       
     -- 4. Prize
    local prizeDiv = row:tag('div'):addClass('tr-prize')
    prizeDiv:wikitext(formatCurrency(args.prize_pool))
       
    return tostring(row)
end
end


return p
return p

Revision as of 13:39, 27 January 2026

Documentation for this module may be created at Module:Tournament/doc

local p = {}
local html = mw.html
local lang = mw.getContentLanguage()

-- ============================================================
-- HELPER FUNCTIONS
-- ============================================================

-- Helper: Currency Formatter
local function formatCurrency(amount)
    if not amount or amount == "" or amount == "0" then return "TBD" end
    local currency = "₹" 
    if string.find(amount, "%$") then currency = "$" end
    local n = tostring(amount):gsub(",", ""):gsub("₹", ""):gsub("%$", "")
    if #n <= 3 then return currency .. " " .. n end
    local last3 = n:sub(-3)
    local rest = n:sub(1, -4)
    local formattedRest = rest:reverse():gsub("(%d%d)", "%1,"):reverse()
    if formattedRest:sub(1, 1) == "," then formattedRest = formattedRest:sub(2) end
    return currency .. " " .. formattedRest .. "," .. last3
end

-- Helper: Date Ranger
local function formatDateRange(startStr, endStr)
    if not startStr or startStr == "" then return "TBA" end
    if endStr and endStr ~= "" and endStr ~= startStr then
        local s = lang:formatDate('d M', startStr)
        local e = lang:formatDate('d M, Y', endStr)
        return s .. " – " .. e 
    else
        return lang:formatDate('d M, Y', startStr)
    end
end

-- Helper: Theme Aware Logo (For Infobox)
local function getInfoboxLogo(pageName, image, imageDark)
    local lightFile = (image ~= "" and image) or (pageName .. '.png')
    
    -- Auto-detect dark if not provided
    local darkFile = imageDark
    if not darkFile or darkFile == "" then
        local ext = lightFile:match("^.+(%..+)$") or ".png"
        local name = lightFile:gsub("%..+$", "")
        darkFile = name .. "_dark" .. ext
    end
    
    local hasLight = mw.title.new('File:' .. lightFile).exists
    local hasDark = mw.title.new('File:' .. darkFile).exists
    
    local container = html.create('div'):addClass('fib-image')
    
    -- Light
    local lSpan = container:tag('span'):addClass('logo-lightmode')
    if hasLight then lSpan:wikitext('[[File:' .. lightFile .. '|250px]]') else lSpan:wikitext('[[File:Shield_team.png|150px]]') end
    
    -- Dark
    local dSpan = container:tag('span'):addClass('logo-darkmode')
    if hasDark then dSpan:wikitext('[[File:' .. darkFile .. '|250px]]') elseif hasLight then dSpan:wikitext('[[File:' .. lightFile .. '|250px]]') else dSpan:wikitext('[[File:Shield_team_dark.png|150px]]') end
    
    return tostring(container)
end

-- Helper: Social Icon Generator
local function getSocials(args)
    local container = html.create('div'):addClass('fib-socials')
    local hasSocials = false
    
    local platforms = {
        {arg='instagram', icon='fa-brands fa-instagram'},
        {arg='twitter', icon='fa-brands fa-x-twitter'},
        {arg='youtube', icon='fa-brands fa-youtube'},
        {arg='discord', icon='fa-brands fa-discord'},
        {arg='facebook', icon='fa-brands fa-facebook'},
        {arg='website', icon='fa-solid fa-globe'}
    }
    
    for _, p in ipairs(platforms) do
        if args[p.arg] and args[p.arg] ~= "" then
            hasSocials = true
            container:tag('a')
                :attr('href', args[p.arg])
                :addClass('fib-social-icon')
                :attr('target', '_blank')
                :wikitext('<i class="' .. p.icon .. '"></i>')
        end
    end
    
    if hasSocials then return tostring(container) else return "" end
end

-- ============================================================
-- MAIN 1: TOURNAMENT INFOBOX (Redesigned)
-- ============================================================
function p.infobox(frame)
    local args = frame:getParent().args
    local page = args.name or mw.title.getCurrentTitle().text
    local cleanName = mw.title.getCurrentTitle().subpageText
    
    local prizeMoney = args.prize_pool or args.prizepool
    
    -- 1. STORE TO CARGO
    if mw.ext.cargo and mw.ext.cargo.store then
        mw.ext.cargo.store('Tournaments', {
            _pageName = mw.title.getCurrentTitle().prefixedText,
            name = args.name or cleanName,
            series = args.series,
            organizer = args.organizer,
            sponsor = args.sponsor,
            game = args.game or "BGMI",
            mode = args.mode,
            type = args.type,
            tier = args.tier,
            device = args.device,
            location = args.location,
            venue = args.venue,
            prize_pool = prizeMoney,
            start_date = args.start_date,
            end_date = args.end_date,
            winner = args.winner,
            previous = args.previous,
            next = args.next,
            image = args.image,
            image_dark = args.image_dark
        })
    end

    -- 2. BUILD FLAT INFOBOX
    local root = html.create('div'):addClass('flat-infobox')
    
    -- A. Header & Logo
    local header = root:tag('div'):addClass('fib-header')
    header:tag('div'):addClass('fib-title'):wikitext(args.name or cleanName)
    header:wikitext(getInfoboxLogo(page, args.image, args.image_dark))
    
    -- B. Key Stats Grid (Row 1: Tier | Type)
    local grid1 = root:tag('div'):addClass('fib-grid')
    grid1:tag('div'):addClass('fib-cell')
         :tag('div'):addClass('fib-label-sm'):wikitext('Event Tier'):done()
         :tag('div'):addClass('fib-value-sm'):wikitext(args.tier or 'Unranked'):done()
    
    grid1:tag('div'):addClass('fib-cell')
         :tag('div'):addClass('fib-label-sm'):wikitext('Type'):done()
         :tag('div'):addClass('fib-value-sm'):wikitext(args.type or 'Online'):done()
         
    -- C. Key Stats Grid (Row 2: Mode | Location)
    local grid2 = root:tag('div'):addClass('fib-grid')
    grid2:tag('div'):addClass('fib-cell')
         :tag('div'):addClass('fib-label-sm'):wikitext('Mode'):done()
         :tag('div'):addClass('fib-value-sm'):wikitext(args.mode or 'TBD'):done()
    
    grid2:tag('div'):addClass('fib-cell')
         :tag('div'):addClass('fib-label-sm'):wikitext('Location'):done()
         :tag('div'):addClass('fib-value-sm'):wikitext(args.location or 'India'):done()
    
    -- D. Prize Pool Section
    if prizeMoney then
        root:tag('div'):addClass('fib-prize')
            :tag('div'):addClass('fib-label-sm'):wikitext('Total Prize Pool'):done()
            :tag('div'):addClass('fib-prize-val'):wikitext(formatCurrency(prizeMoney)):done()
    end
    
    -- E. Detailed List
    local list = root:tag('div'):addClass('fib-list')
    
    local function addRow(label, value)
        if value and value ~= "" then
            list:tag('div'):addClass('fib-row')
                :tag('div'):addClass('fib-label'):wikitext(label):done()
                :tag('div'):addClass('fib-data'):wikitext(value):done()
        end
    end
    
    addRow('Series', args.series and '[[' .. args.series .. ']]')
    addRow('Organizer', args.organizer)
    addRow('Sponsors', args.sponsor)
    addRow('Venue', args.venue)
    addRow('Dates', formatDateRange(args.start_date, args.end_date))
    addRow('Device', args.device)
    
    if args.winner then
        addRow('Winner', "'''[[" .. args.winner .. "]]'''")
    end
    
    -- F. Socials
    root:wikitext(getSocials(args))
    
    -- G. Navigation Footer
    if args.previous or args.next then
        local nav = root:tag('div'):addClass('fib-nav')
        
        -- Previous Button
        local prevBtn = nav:tag('div'):addClass('fib-nav-btn prev')
        if args.previous and args.previous ~= "" then
            prevBtn:wikitext('[[File:Arrow_left.svg|12px|link=]] [[' .. args.previous .. '|Previous]]')
        else
            prevBtn:css('opacity', '0.3'):wikitext('Previous')
        end
        
        -- Next Button
        local nextBtn = nav:tag('div'):addClass('fib-nav-btn next')
        if args.next and args.next ~= "" then
            nextBtn:wikitext('[[' .. args.next .. '|Next]] [[File:Arrow_right.svg|12px|link=]]')
        else
            nextBtn:css('opacity', '0.3'):wikitext('Next')
        end
    end

    return tostring(root)
end

-- ============================================================
-- MAIN 2 & 3: LIST ROWS (Preserved from before)
-- ============================================================
-- (Keep p.listRow and p.listRowMain exactly as they were in the previous code)
-- For brevity, I am not pasting them again here, but ensure you keep them in the module!

function p.listRow(frame)
    -- ... (Keep existing code)
    return "" -- Placeholder
end
function p.listRowMain(frame)
    -- ... (Keep existing code)
    return "" -- Placeholder
end

return p