Module:UserLinks: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
m
45 revisions imported from wikipedia:Module:UserLinks
m (Changed protection level of Module:UserLinks: Allow template editors ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
m (45 revisions imported from wikipedia:Module:UserLinks)
 
(7 intermediate revisions by 4 users not shown)
Line 48:
-- data snippets. New link functions should be added below the existing
-- functions.
--
-- For documentation on how to add new link functions, please see
-- [[Module:UserLinks#Adding new links]].
----------------------------------------------------------------------------
 
Line 81 ⟶ 78:
message('display-contributions')
)
end
function linkFunctions.c64(snippets)
-- Contributions
local first64 = snippets.username:match('^%x+:%x+:%x+:%x+:')
or snippets.username:match('^%x+:%x+:%x+:')
or snippets.username:match('^%x+:%x+:')
or snippets.username:match('^%x+:')
return first64 and makeWikilink(
snippets.interwiki,
-1,
'Contribs/' .. first64 .. ':/64',
'(/64)'
) or ''
end
 
Line 87 ⟶ 98:
return makeUrlLink(
{
host = 'toolsxtools.wmflabs.org',
path = '/xtools-ec/',
query = {
userusername = snippets.username,
project = snippets.toolLang .. '.' .. snippets.projectLong .. '.org'
}
Line 115 ⟶ 126:
'Log/' .. snippets.username,
message('display-logs')
)
end
 
function linkFunctions.ae(snippets)
-- Automated edits (and non-automated contributions).
return makeUrlLink(
{
host = 'xtools.wmflabs.org',
path = '/autoedits/',
query = {
wikiusername = snippets.projectLongusername,
project = snippets.toolLang .. '.' .. snippets.projectLong .. '.org'
}
},
message('display-autoedits')
)
end
Line 183 ⟶ 209:
return makeUrlLink(
{
host = 'toolsxtools.wmflabs.org',
path = '/xtools/editsummary/index.php',
query = {
nameusername = snippets.username,
langproject = snippets.toolLang, .. '.' .. snippets.projectLong .. '.org'
wiki = snippets.projectLong
}
},
Line 615 ⟶ 640:
 
return snippets
end
 
function p.validateProjectCode(s)
Line 623 ⟶ 648:
-- returns nil for both.
interwikiTable = interwikiTable or mw.loadData('Module:InterwikiTable')
for key, t in pairs(interwikiTable) do
for i, prefix in ipairs(t.iw_prefix) do
if s == prefix then
return s, key
end
end
end
end
return nil, nil
end
 
Line 813 ⟶ 838:
ret[#ret + 1] = '|}'
return table.concat(ret, '\n')
end
 
return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu