Module:UserLinks: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(make an api function, as this was generating errors) |
(add a file uploads link per protected edit request, and make the API function compatible with other projects) |
||
Line 155: | Line 155: | ||
local function makeApiLink() |
local function makeApiLink() |
||
-- Find the full domain, as the API can't be accessed through the interwiki system. |
|||
⚫ | |||
local fulldomain |
|||
table.insert( trackingCategories, '[[Category:UserLinks transclusions with unresolvable interwiki links]]' ) |
|||
local lang = u.lang or 'en' |
|||
⚫ | |||
local domain = interwikiTable[u.projectCode].domain |
|||
local takesLangPrefix = interwikiTable[u.projectCode].takes_lang_prefix |
|||
if not takesLangPrefix then |
|||
fulldomain = domain |
|||
else |
|||
fulldomain = lang .. '.' .. domain |
|||
end |
|||
else |
|||
fulldomain = lang .. '.wikipedia.org' |
|||
end |
end |
||
⚫ | |||
-- Return the API link |
|||
⚫ | |||
end |
|||
local function makeUploadsLink() |
|||
return '[[' .. u.interwiki .. 'Special:ListFiles/' .. u.username .. '|uploads]]' |
|||
end |
end |
||
Line 188: | Line 205: | ||
{'ren' , makeRenamesLink}, |
{'ren' , makeRenamesLink}, |
||
{'rfa' , makeRfaLink}, |
{'rfa' , makeRfaLink}, |
||
{'api' , makeApiLink} |
{'api' , makeApiLink}, |
||
{'up' , makeUploadsLink} |
|||
} |
} |
||