https://starmadepedia.net/index.php?title=Module:Main&feed=atom&action=history
Module:Main - Revision history
2024-03-29T06:02:30Z
Revision history for this page on the wiki
MediaWiki 1.31.3
https://starmadepedia.net/index.php?title=Module:Main&diff=565&oldid=prev
DukeofRealms: 2 revisions imported
2016-07-08T15:02:04Z
<p>2 revisions imported</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">Revision as of 15:02, 8 July 2016</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
DukeofRealms
https://starmadepedia.net/index.php?title=Module:Main&diff=564&oldid=prev
DukeofRealms: 1 version
2015-05-21T05:42:03Z
<p>1 version</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">Revision as of 05:42, 21 May 2015</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
DukeofRealms
https://starmadepedia.net/index.php?title=Module:Main&diff=563&oldid=prev
DukeofRealms: 1 revision
2014-10-11T06:36:18Z
<p>1 revision</p>
<p><b>New page</b></p><div>--[[<br />
-- This module produces a link to a main article or articles. It implements the<br />
-- template {{main}}.<br />
-- <br />
-- If the module is used in category or category talk space, it produces "The<br />
-- main article for this category is xxx". Otherwise, it produces<br />
-- "Main article: xxx".<br />
--]]<br />
<br />
local mHatnote = require('Module:Hatnote')<br />
local mTableTools -- lazily initialise<br />
local mArguments -- lazily initialise<br />
<br />
local p = {}<br />
<br />
function p.main(frame)<br />
mTableTools = require('Module:TableTools')<br />
mArguments = require('Module:Arguments')<br />
local args = mArguments.getArgs(frame, {parentOnly = true})<br />
local pages = {}<br />
for k, v in pairs(args) do<br />
if type(k) == 'number' then<br />
local display = args['l' .. tostring(k)]<br />
local page = {v, display}<br />
pages[k] = page<br />
end<br />
end<br />
pages = mTableTools.compressSparseArray(pages)<br />
local options = {<br />
selfref = args.selfref<br />
}<br />
return p._main(options, unpack(pages))<br />
end<br />
<br />
function p._main(options, ...)<br />
-- Get the list of pages. If no first page was specified we use the current<br />
-- page name.<br />
local pages = {...}<br />
local currentTitle = mw.title.getCurrentTitle()<br />
local firstPageTable = pages[1]<br />
local firstPage<br />
if firstPageTable then<br />
firstPage = firstPageTable[1]<br />
else<br />
firstPage = currentTitle.text<br />
firstPageTable = {firstPage}<br />
pages[1] = firstPageTable<br />
end<br />
<br />
-- Find the pagetype.<br />
local firstPageNs = mHatnote.findNamespaceId(firstPage)<br />
local pagetype = firstPageNs == 0 and 'article' or 'page'<br />
<br />
-- Make the formatted link text<br />
local links = mHatnote.formatPageTables(unpack(pages))<br />
links = mw.text.listToText(links)<br />
<br />
-- Build the text.<br />
local isPlural = #pages > 1<br />
local currentNs = currentTitle.namespace<br />
local isCategoryNamespace = currentNs - currentNs % 2 == 14<br />
local stringToFormat<br />
if isCategoryNamespace then<br />
if isPlural then<br />
stringToFormat = 'The main %ss for this'<br />
.. ' [[Wikipedia:Categorization|category]] are %s'<br />
else<br />
stringToFormat = 'The main %s for this'<br />
.. ' [[Wikipedia:Categorization|category]] is %s'<br />
end<br />
else<br />
if isPlural then<br />
stringToFormat = 'Main %ss: %s'<br />
else<br />
stringToFormat = 'Main %s: %s'<br />
end<br />
end<br />
local text = string.format(stringToFormat, pagetype, links)<br />
<br />
-- Process the options and pass the text to the _rellink function in<br />
-- [[Module:Hatnote]].<br />
options = options or {}<br />
local hnOptions = {<br />
extraclasses = 'relarticle mainarticle',<br />
selfref = options.selfref<br />
}<br />
return mHatnote._hatnote(text, hnOptions)<br />
end<br />
<br />
return p</div>
DukeofRealms