Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Reply to/sandbox
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local function makeError(msg) msg ='Error in [[Template:Reply to]]: ' .. msg return mw.text.tag('strong', {['class']='error'}, msg) end local function makeLink(u, l) return '[[User:' .. u .. '|' .. (l or u) .. ']]' end function p.replyto(frame) local outArray, argIndex = {}, {} local args = frame:getParent().args args.label1 = args.label1 or args.label for k, v in pairs(args) do if type(k) == 'number' and string.match(v,'%S') then table.insert(argIndex, k) end end table.sort(argIndex) for _, k in ipairs(argIndex) do local title = mw.title.new(args[k]) if not title then return makeError('Input contains forbidden characters.') end title = title.rootText local label = args['label'..tostring(k)] if label == '' then label = '​' end table.insert( outArray, makeLink(title, label) ) end if #outArray > (tonumber(frame.args.max) or 50) then return makeError('More than ' .. tostring(frame.args.max or 50) .. ' names specified.') end if #outArray < 1 then if frame.args.example then outArray[1] = makeLink(frame.args.example) else return makeError('Username not given.') end end local conjuction = (#outArray == 2 and ' ' or ', ') .. (args.c or 'and') .. ' ' local outStr = (args.c == '') and table.concat(outArray, ', ') or mw.text.listToText(outArray, ', ', conjuction) return mw.text.tag('span', {['class']='template-ping'}, (args.prefix or '@') .. outStr .. (args.p or ':')) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Reply to/sandbox/doc
(
edit
)