Module:Update: Skirtumas tarp puslapio versijų

643 pridėti baitai ,  12 balandžio
S
nėra keitimo aprašymo
SNėra keitimo santraukos
SNėra keitimo santraukos
 
(nerodomos 4 tarpinės versijos, sukurtos to paties naudotojo)
81 eilutė: 81 eilutė:
devblog = {'Developer Blogs', 'Developer Blog'},
devblog = {'Developer Blogs', 'Developer Blog'},
event = {'Event updates', 'Event update'},
event = {'Event updates', 'Event update'},
game = {'Game updates', 'Game update'},
game = {'Serverio restartas', 'Restartas'},
future = {'Future Updates', 'Future update'},
future = {'Future Updates', 'Future update'},
forum = {'forum'},
forum = {'forum'},
409 eilutė: 409 eilutė:
function p.datedpl(frame)
function p.datedpl(frame)
local a = frame:getParent().args
local a = frame:getParent().args
if not a or not a['%TITLE%'] then
    return 'Error: Missing required argument `%TITLE%`.'
end
local page = a['%TITLE%']
local year
local year
local cat
local cat
local page = a['%TITLE%']
if hc(a.year) then
if hc(a.year) then
year = a.year
year = a.year
418 eilutė: 423 eilutė:
end
end
-- Get current day and month from system
local current_day = tonumber(lang:formatDate('j'))      -- 12
local current_month = lang:formatDate('F')              -- April
--  Get day and month from the provided date
local entry_day = tonumber(lang:formatDate('j', a.date))
local entry_month = lang:formatDate('F', a.date)
--  Check if day and month match
if not (current_day == entry_day and current_month == entry_month) then
return ''  -- Don't display this entry
end
-- Set category type
if hc(a.category) then
if hc(a.category) then
-- if it has category, {{Update}}
    local category_key = cat_switch[string.gsub(string.lower(a.category), ' ?updates?', '')]
cat = category_info[cat_switch[string.gsub(string.lower(a.category), ' ?updates?', '')]][2]
    if category_key then
        cat = category_info[category_key][2]
    else
        cat = 'Patch Notes'
    end
else
else
-- missing both probably means {{Patch Notes}}
    cat = 'Patch Notes'
cat = 'Patch Notes'
end
end
 
return string.format("'''%s''' – %s: [[Update:%s|%s]]",year,cat,page,page)
return string.format("'''%s''' – %s: [[%s|%s]]", year, cat, page, page)
end
end