Module:Unsigned and Module:Unsigned/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>Anomie
Use Template:Unsigned/unregistered for temp accounts, as they don't normally have user pages.
 
imported>HouseBlaster
test
 
Line 90: Line 90:
if username == '' then
if username == '' then
return '<em class="error">Unable to detect username</em>'
return '<em class="error">Unable to detect username</em>'
end
-- Determine subtemplate to use
local subtemplate = 'unsigned/registered'
if require('Module:IPAddress')._isIp(username) -- IP, still relevant if someone's signing an old edit
    or string.match( username, '^~2%d%d%d%-[0-9-]+$' ) -- temp account
then
subtemplate = 'unsigned/unregistered'
end
end
return mw.getCurrentFrame():expandTemplate{  
return mw.getCurrentFrame():expandTemplate{  
title = subtemplate,
title = require('Module:IPAddress')._isIp(username) and 'unsigned/unregistered' or 'unsigned/registered',  
args = {
args = {
username,
username,