Jump to content
Main menu
Main menu
move to sidebar
hide
Panyanja
Tsamba lalikulu
Tsamba la anthu wonse
Current events
Kusintha kumene kwachitika posachedwa
mwachisawawa Tsamba
Chithandizo
Helpful Pages
Mafunso
Thandizo
Nkhani Zofuna Kukonza
Kalembedwe ka nkhani
Fufuzani
Fufuzani
Appearance
Perekani
Pangani akaunti
Lowani muakaunti
Zida zawekha
Perekani
Contribute
Pangani akaunti
Lowani muakaunti
Pages for logged out editors
learn more
Kulankhula
Editing
Module:User
Add languages
Module
Kukambirana
English
Read
Edit source
Onani mbiri
zida
Tools
move to sidebar
hide
Actions
Read
Edit source
Onani mbiri
General
Chimene chikugwirizanitsa apa
Related changes
Upload file
Zambiri za tsamba
Get shortened URL
Download QR code
Appearance
move to sidebar
hide
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!
--[=[ -- This module implements {{user}}. {{user}} is a high-use template, sometimes -- with thousands of transclusions on a page. This module optimises the -- template's performance by reducing the number of parameters called from -- wikitext, while still allowing all the features provided by -- [[Module:UserLinks]]. It is about twice as fast as the version of {{user}} -- that called the {{user-multi}} template from wikitext. --]=] local mUserLinks = require('Module:UserLinks') local mShared = require('Module:UserLinks/shared') local yesno = require('Module:Yesno') local p = {} local function validateArg(arg) -- Validates one argument. Whitespace is stripped, and blank arguments -- are treated as nil. if not arg then return nil end arg = arg:match('^%s*(.-)%s*$') if arg ~= '' then return arg else return nil end end function p.main(frame) -- Grab the user, project and lang args from wikitext. local argKeys = { user = { 1, 'User', 'user' }, project = { 2, 'Project', 'project' }, lang = { 3, 'Lang', 'lang' } } local origArgs = frame:getParent().args local args = {} for argKey, t in pairs(argKeys) do for i, origArgKey in ipairs(t) do local value = origArgs[origArgKey] value = validateArg(value) if value then args[argKey] = value -- If we have found a value, break the loop. For the average -- invocation this saves two argument lookups. break end end end -- Generate options. Some of these need wikitext args also. local options = { span = false, separator = validateArg(origArgs.separator) or 'dot', isDemo = yesno(validateArg(origArgs.demo)) } -- Input the codes directly. This saves two argument lookups for each -- invocation. local codes = {'t', 'c'} -- Plug the data into [[Module:UserLinks]]. local snippets = mUserLinks.getSnippets(args) local links = mUserLinks.getLinks(snippets) local success, result = pcall(mUserLinks.export, codes, links, options) if success then return result else return mShared.makeWikitextError(result, options.isDemo) end end return p
Summary:
By saving changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Preview page with this template
Wikidata entities used in this page
Module:User
: Sitelink, Description: en
Template used on this page:
Module:User/doc
(
edit
)
Fufuzani
Fufuzani
Editing
Module:User
Add languages
Add topic