This Lua module is used on approximately 150,000 pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.
This module is rated as ready for general use. It has reached a mature form and is thought to have only few to no bugs and is ready for use wherever appropriate. It is ready to mention on help pages and other essential Wikipedia resources as an option for new users to learn. To reduce server load and bad output as well as confusion, it should be improved by sandbox testing rather than repeated trial-and-error editing.
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, and/or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
This module is used by {{Shim}} to trigger a notification to one or several registered user(s) you are replying to in a discussion.
localp={}localfunctionmakeError(msg)msg='Error in [[Template:Reply to]]: '..msgreturnmw.text.tag('strong',{['class']='error'},msg)endfunctionp.replyto(frame)localorigArgs=frame:getParent().argslocalargs={}localmaxArg=1localusernames=0fork,vinpairs(origArgs)doiftype(k)=='number'thenifmw.ustring.match(v,'%S')thenifk>maxArgthenmaxArg=kendusernames=usernames+1localtitle=mw.title.new(v)ifnottitlethenreturnmakeError('Input contains forbidden characters.')endargs[k]=title.rootTextendelseifv==''andk:sub(0,5)=='label'thenargs[k]='​'elseargs[k]=vendendifusernames>(tonumber(frame.args.max)or50)thenreturnmakeError(string.format('More than %s names specified.',tostring(frame.args.maxor50)))elseifusernames<1thenifframe.args.examplethenargs[1]=frame.args.exampleelsereturnmakeError('Username not given.')endendargs['label1']=args['label1']orargs['label']localisfirst=truelocaloutStr=args['prefix']or'@'fori=1,maxArgdoifargs[i]thenifisfirstthenisfirst=falseelseif((usernames>2)or((usernames==2)and(args['c']=='')))thenoutStr=outStr..', 'endifi==maxArgthenoutStr=outStr..' '..(args['c']or'and')..' 'endendoutStr=string.format('%s[[User:%s|%s]]',outStr,args[i],args['label'..tostring(i)]orargs[i])endendoutStr=outStr..(args['p']or':')returnmw.text.tag('span',{['class']='template-ping'},outStr)endendreturnp