Anonymous user
Module:UserLinks: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
output user links
(save initial version - user talk links only for the moment) |
(output user links) |
||
Line 1:
p = {}
local
local project, username
local function makeUserLink()
end
local function makeTalkLink()
▲ return '[[' .. plink .. 'User talk:' .. username .. '|talk]]'
end
Line 18 ⟶ 21:
local function makeToolbar(args)
local targs = {}
local numArgsExist = false
for k, v in pairs(args) do
if type(k) == 'number' then
numArgsExist = true
targs[k] = getLink(v)
end
Line 25 ⟶ 30:
targs.style = args.small and 'font-size: 90%;'
targs.separator = args.separator or 'dot'
return toolbar.main(targs)▼
if numArgsExist == false then
return -- Don't return a toolbar if no numeric arguments exist.
else
end
end
local function getLinks(args)
--
if args.user == '' or (not args.user and (not args.User or args.User == '')) then
return '<span class="error">Error: No username detected by [[Module:UserLinks]].</span>[[Category:UserLinks transclusions without usernames]]'
Line 35 ⟶ 45:
username = args.user or args.User
end
-- Get the
else
project = ''
end
return makeToolbar(args)▼
if result then
if args.sup then
result = '<sup>' .. result .. '</sup>'
end
result = ' ' .. result
else
result = ''
end
result = '<span>' .. makeUserLink() .. result .. '</span>'
return result
end
|