VOOZH about

URL: https://minecraft.wiki/w/Module:No_ping

⇱ Module:No ping – Minecraft Wiki


Module:No ping

From Minecraft Wiki
Jump to navigation Jump to search
Documentation[view] [edit] [history] [purge]Jump to code ↴

This module is used by Template:No ping. It links to user (pages) without notifying them.

This is directly copied from Wikipedia's Module:No ping.

[view] [edit] [history] [purge]The above documentation is transcluded from Module:No ping/doc.
-- Copy pasted from Wikipedia's [[w:Module:No ping]] under revision [[w:Special:Diff/1326975262]]
localp={}
functionp.main(frame)
localargs=frame:getParent().args
returnp._main(args)
end
functionp._main(args)
localret={}
localfullUrl=mw.uri.fullUrl
localformat=string.format
fori,usernameinipairs(args)do
locallabel=args['label'..tostring(i)]
localurl=""
localtargetUser=username
if(username:sub(1,(mw.site.namespaces.User.name..':'):len())==(mw.site.namespaces.User.name..':'))then
targetUser=username:sub((mw.site.namespaces.User.name..':'):len()+1)
end
iftargetUser:sub(1,2)=='~2'then
-- Temporary user target; use internal contributions link
url=mw.site.namespaces.Special.name..':Contributions/'..targetUser
url=format('[[%s|%s]]',url,labelorusername)
else
-- Named user target; use external link
url=fullUrl(mw.site.namespaces.User.name..':'..targetUser)
url=tostring(url)
url=format('[%s %s]',url,labelorusername)
end
ret[#ret+1]=url
end
ret=mw.text.listToText(ret)
ret='<span class="plainlinks">'..ret..'</span>'
returnret
end
returnp
Retrieved from "https://minecraft.wiki/w/Module:No_ping?oldid=3431837"

Navigation menu