Module:Update: Difference between revisions

Created page with "--<nowiki> -- IMPORTS local pt = require('Module:Paramtest') local hc = pt.has_content local dt = pt.default_to -- exposed table local p = {} --[=[ -- -- HELPER TABLES AND..."
 
No edit summary
 
(27 intermediate revisions by the same user not shown)
Line 55: Line 55:
-- converting month names to hex for sortkeys
-- converting month names to hex for sortkeys
local hexmonthconv = {
local hexmonthconv = {
January = '1',
January = '0',
February = '2',
February = '1',
March = '3',
March = '2',
April = '4',
April = '3',
May = '5',
May = '4',
June = '6',
June = '5',
July = '7',
July = '6',
August = '8',
August = '7',
September = '9',
September = '8',
October = 'A',
October = '9',
November = 'B',
November = 'A',
December = 'C',
December = 'B',
}
}


Line 78: Line 78:
future = {'Future updates', 'Future update'},
future = {'Future updates', 'Future update'},
game = {'Game updates', 'Game update'},
game = {'Game updates', 'Game update'},
shop = {'Shop updates', 'Shop update'},
sof = {'Squeal of Fortune updates', 'Squeal of Fortune'},
sgs = {'Solomon\'s Store updates', 'Solomon\'s Store'},
support = {'Support updates', 'Support'},
support = {'Support updates', 'Support'},
technical = {'Technical updates', 'Technical'},
technical = {'Technical updates', 'Technical'},
th = {'Treasure Hunter updates', 'Treasure Hunter'},
website = {'Website updates', 'Website update'},
website = {'Website updates', 'Website update'},
competitions = {'Competition updates', 'Competitions'},
mobile = {'Mobile updates', 'Mobile'},
mobile = {'Mobile updates', 'Mobile'},
['#default'] = {'Missing update category', ''},
['#default'] = {'Missing update category', ''},
Line 107: Line 102:
future = 'future',
future = 'future',
game = 'game',
game = 'game',
shop = 'shop',
ss = 'sgs',
sgs = 'sgs',
solomon = 'sgs',
['solomon\'s store'] = 'sgs',
sof = 'sof',
squeal = 'sof',
cs = 'support',
cs = 'support',
customer = 'support',
customer = 'support',
Line 120: Line 108:
tech = 'technical',
tech = 'technical',
technical = 'technical',
technical = 'technical',
th = 'th',
treasure = 'th',
['treasure hunter'] = 'th',
site = 'website',
site = 'website',
ws = 'website',
ws = 'website',
website = 'website',
website = 'website',
competitions = 'competitions',
mobile = 'mobile',
mobile = 'mobile',
Line 208: Line 192:
end
end
link = '[https://secure.runescape.com/m=news/' .. link .. ' official news post]'
link = '[https://www.geministation.com/patch-notes'..' official news post]'
end
end
Line 217: Line 201:
month = lang:formatDate('F', a.date)
month = lang:formatDate('F', a.date)
year = lang:formatDate('Y', a.date)
year = lang:formatDate('Y', a.date)
date_link = '[[' .. day .. ' ' .. month .. ']] [[' .. year .. ']]'
date_link = '' .. day .. ' ' .. month .. ' [[' .. year .. ']]'
else
else
date_link = '(missing date)'
date_link = '(missing date)'
Line 233: Line 217:
:tag('span')
:tag('span')
:addClass('plainlinks')
:addClass('plainlinks')
:wikitext('[https://www.runescape.com/community \'\'RuneScape\'\' website]')
:wikitext('[https://www.geministation.com \'\'Gemini Station\'\' website]')
:done()
:done()
:wikitext('. It is copyrighted by [[Jagex]].')
:wikitext('. It is copyrighted by [[User:Noresist|The Developer]].')
:tag('br'):done()
:tag('br'):done()
:wikitext('It was added on ' .. date_link .. '.')
:wikitext('It was added on ' .. date_link .. '.')
Line 258: Line 242:
local cat = ''
local cat = ''
-- cats only in update namespace
-- cats only in update namespace
if title.namespace == 100 then
if title.namespace == 3000 then
cat = '[[Category:' .. get_update_category(a.category) .. '|' .. postTitle .. ']]'
cat = '[[Category:' .. get_update_category(a.category) .. '|' .. postTitle .. ']]'
cat = cat .. get_time_categories(day, month, year)
cat = cat .. get_time_categories(day, month, year)
Line 293: Line 277:
-- [[Template:Patch Notes]]
-- [[Template:Patch Notes]]
function p.patchnotes(frame)
function p.patchnotes(frame)
local function qfclink(qfc)
local function qprlink(qpr)
return 'http://services.runescape.com/m=forum/forums.ws?' .. string.gsub(qfc, '%-', ',')
return '' .. string.gsub(qpr, '%-', '%-')
end
end
Line 306: Line 290:
local link
local link
if hc(a.qfc) then
if hc(a.qpr) then
if a.qfc == 'no' then
if a.qpr == 'no' then
link = ' a forum thread'
link = 'the patch note page'
elseif a.qfc == 'none' then
elseif a.qpr == 'none' then
link = ''
link = ''
else
else
link = '[' .. qfclink(a.qfc) .. ' this forum thread]'
link = '[' .. qprlink(a.qpr) .. ' this news post]'
end
end
else
else
link = '(QFC missing)'
link = '(qpr missing)'
cat = cat .. '[[Category:Missing patch notes QFC]]'
cat = cat .. '[[Category:Missing patch notes qpr]]'
end
end
Line 348: Line 332:
:tag('span')
:tag('span')
:addClass('plainlinks')
:addClass('plainlinks')
:wikitext('[http://services.runescape.com/m=forum/forums.ws \'\'RuneScape\'\' forums]')
:wikitext('[https://www.geministation.com \'\'Gemini Station\'\' website]')
:done()
:done()
:wikitext(' or alternatively from ' .. newspostlink .. ' of the ')
:wikitext(' or alternatively from ' .. newspostlink .. ' of the ')
:tag('span')
:tag('span')
:addClass('plainlinks')
:addClass('plainlinks')
:wikitext('[https://secure.runescape.com/m=news/ \'\'RuneScape\'\' news posts]')
:wikitext('[https://www.geministation.com \'\'Gemini Station\'\' website]')
:done()
:done()
:wikitext('. It is copyrighted by [[Jagex]].')
:wikitext('. It is copyrighted by [[User:Noresist|The Developer]].')
:tag('br'):done()
:tag('br'):done()
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
Line 363: Line 347:
:tag('span')
:tag('span')
:addClass('plainlinks')
:addClass('plainlinks')
:wikitext('[http://services.runescape.com/m=forum/forums.ws \'\'RuneScape\'\' forums]')
:wikitext('[https://www.geministation.com \'\'Gemini Station\'\' website]')
:done()
:done()
:wikitext('. It is copyrighted by [[Jagex]].')
:wikitext('. It is copyrighted by [[User:Noresist|The Developer]].')
:tag('br'):done()
:tag('br'):done()
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
Line 373: Line 357:
:tag('span')
:tag('span')
:addClass('plainlinks')
:addClass('plainlinks')
:wikitext('[https://secure.runescape.com/m=news/ \'\'RuneScape\'\' news posts]')
:wikitext('[https://www.geministation.com \'\'Gemini Station\'\' website]')
:done()
:done()
:wikitext('. It is copyrighted by [[Jagex]].')
:wikitext('. It is copyrighted by [[User:Noresist|The Developer]].')
:tag('br'):done()
:tag('br'):done()
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
:done()
:done()
else
else
div:wikitext('These official [[Patch Notes]] are copied verbatim from (missing link). It is copyrighted by [[Jagex]].')
div:wikitext('These official [[Patch Notes]] are copied verbatim from (missing link). It is copyrighted by [[User:Noresist|The Developer]].')
:tag('br'):done()
:tag('br'):done()
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
:wikitext('These Patch Notes were announced on ' .. date_link .. '.')
Line 391: Line 375:
-- not update namespace, remove cat
-- not update namespace, remove cat
if title.namespace ~= 100 then
if title.namespace ~= 3000 then
cat = ''
cat = ''
end
end
Line 422: Line 406:
if hc(a.link) then
if hc(a.link) then
if a.link == 'no' then
if a.link == 'no' then
link = "''RuneScape'' website"
link = "''Gemini Station'' website"
else
else
link = '[' .. a.link .. " ''RuneScape'' website]"
link = '[' .. a.link .. " ''Gemini Station'' website]"
end
end
else
else
Line 436: Line 420:
end
end
link = '[https://secure.runescape.com/m=rswiki/en/DevBlog:' .. link .. " ''RuneScape'' website]"
link = '[https://forum.geministation.com/forumdisplay.php?fid=2'.. link .. " ''Gemini Station'' forum]"
end
end
Line 445: Line 429:
month = lang:formatDate('F', a.date)
month = lang:formatDate('F', a.date)
year = lang:formatDate('Y', a.date)
year = lang:formatDate('Y', a.date)
date_link = '[[' .. day .. ' ' .. month .. ']] [[' .. year .. ']]'
date_link = '' .. day .. ' ' .. month .. ' [[' .. year .. ']]'
else
else
date_link = '(missing date)'
date_link = '(missing date)'
Line 464: Line 448:
:wikitext(link)
:wikitext(link)
:done()
:done()
:wikitext('. It is copyrighted by [[Jagex]].')
:wikitext('. It is copyrighted by [[User:Noresist|The Developer]].')
:tag('br'):done()
:tag('br'):done()
:wikitext('It is written by ' .. authorstr .. ' and is dated ' .. date_link .. '.')
:wikitext('It is written by ' .. authorstr .. ' and is dated ' .. date_link .. '.')
Line 485: Line 469:
-- cats only in update namespace
-- cats only in update namespace
if title.namespace == 100 then
if title.namespace == 3000 then
cat = '[[Category:Developer Blogs|' .. blogtitle .. ']]'
cat = '[[Category:Developer Blogs|' .. blogtitle .. ']]'
cat = cat .. get_time_categories(day, month, year)
cat = cat .. get_time_categories(day, month, year)
Line 571: Line 555:
-- if it has category, {{Update}}
-- if it has category, {{Update}}
cat = category_info[cat_switch[string.gsub(string.lower(a.category), ' ?updates?', '')]][2]
cat = category_info[cat_switch[string.gsub(string.lower(a.category), ' ?updates?', '')]][2]
elseif hc(a.qfc) then
elseif hc(a.qpr) then
-- if it has qfc, {{Patch Notes}}
-- if it has qpr, {{Patch Notes}}
cat = 'Patch Notes'
cat = 'Patch Notes'
else
else