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

local p = {}
local cargo = mw.ext.cargo

local commendations = 
{
}

function p.Main( frame )
    local t = {}
    local tables = 'Commendations'
    local fields = 'Commendation, COUNT(*)'

    local args = {
        groupBy = 'Commendation',
        where = 'Recipient = "' .. frame.args[1] .. '" AND Approved = true'
    }

    local results = cargo.query( tables, fields, args )
    local groups = {}
    
    for r = 1, #results do
        local r = results[r]
        groups[r.Commendation] = r["COUNT(*)"]
    end

    local output = "[[Image:Tattoo.png|frameless|600px]]" .. [[<div style="position:relative;">]]
    
    local i = 0
    local d = 170
    local r = 30
    -- n = 1, #results
    for n = 1, 50 do
        local x = math.cos(math.rad(i*r)) * d
        local y = math.sin(math.rad(i*r)) * d*1.5
        output = output .. [[<span style="position:absolute; margin-top:-340px; margin-left:calc(50% + 5px); left:calc(]] .. x .. [[px - 15px); top:calc(]] .. y .. [[px - 15px);">]].. "[[Image:Pip.png|30px]]" .. [[</span>]]
        i = i + 1
        if i > (360/r) then
            i = 0
            d = d + 40
            r = r / 1.5
        end          
    end
    return output .. "</div>"
end

return p


Categories: