Module:Update: Skirtumas tarp puslapio versijų

776 pridėti baitai ,  12 balandžio
S
nėra keitimo aprašymo
SNėra keitimo santraukos
SNėra keitimo santraukos
 
(nerodomos 7 tarpinės versijos, sukurtos to paties naudotojo)
61 eilutė: 61 eilutė:
-- used by year func
-- used by year func
local looporder = {
local looporder = {
{ 'December', 31 },
{ 'November', 30 },
{ 'November', 30 },
{ 'October', 31 },
{ 'October', 31 },
72 eilutė: 71 eilutė:
{ 'March', 31 },
{ 'March', 31 },
{ 'February', 29 },
{ 'February', 29 },
{ 'January', 31 }
{ 'January', 31 },
{ 'December', 31 }
}
}


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'},
209 eilutė: 209 eilutė:
if hc(url) then
if hc(url) then
if url == 'no' then
if url == 'no' then
link = 'oficialus pranešimas'
link = 'oficialus'
else
else
link = '[' .. url .. ' oficialus pranešimas]'
link = '[' .. url .. ' oficialus]'
end
end
else
else
229 eilutė: 229 eilutė:
local date_link, day, month, year
local date_link, day, month, year
if hc(a.date) then
if hc(a.date) then
day = lang:formatDate('j', a.date)
    day = lang:formatDate('d', a.date)       -- Day with leading zeros
month = lang:formatDate('F', a.date)
    month = lang:formatDate('m', a.date)     -- Month with leading zeros
year = lang:formatDate('Y', a.date)
    year = lang:formatDate('Y', a.date)       -- Four-digit year
date_link = '[[' .. day .. ' ' .. month .. ']] [[' .. year .. ']]'
    date_link = string.format('[[%s-%s-%s]]', year, month, day)  -- Format as yyyy-MM-dd
else
else
date_link = '(nenurodyta)'
    date_link = '(nenurodyta)' -- If no date is provided
end
end
246 eilutė: 246 eilutė:
if url == 'no' then
if url == 'no' then
postDateInfo = 'Buvo pridėtas ' .. date_link .. ', bet vėliau buvo panaikintas.'
postDateInfo = 'Šis straipsnis buvo sukurtas ' .. date_link .. ', bet vėliau buvo panaikintas.'
else
else
postDateInfo = 'Buvo pridėtas ' .. date_link .. '.'
postDateInfo = 'Šis straipsnis buvo sukurtas ' .. date_link .. '.'
end
end
258 eilutė: 258 eilutė:
--Historical updates
--Historical updates
if a.time == 'historical' then
if a.time == 'historical' then
message = ' yra prieš paleidžiant <b>MCSlime</b> projektą. '
message = ' yra prieš paleidžiant <b>MCSlime</b> projektą '
website = '[https://www.mcslime.lt/ <i>MCSlime.LT</i>]'
website = '[https://www.mcslime.lt/ <i>MCSlime.LT</i>]'
end
end
--OSRS updates
--OSRS updates
else
else
message = ' ir priklauso MCSlime.LT projektui -'
message = ' ir priklauso MCSlime.LT projektui'
website = '[https://mcslime.lt/ <i>MCSlime</i>]'
website = ''
end
end
div:wikitext('Šis ' .. link .. message)
div:wikitext('Šis straipsnis yra ' .. link .. message)
:tag('span')
:tag('span')
:addClass('plainlinks')
:addClass('plainlinks')
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