VOOZH about

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

⇱ Module:Unsigned – Minecraft Wiki


Module:Unsigned

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

p.unsigned implements {{unsigned}} and {{undated}}.

Dependencies

[edit source]
[view] [edit] [history] [purge]The above documentation is transcluded from Module:Unsigned/doc.
localp={}
localfunctionbase(args)
localtype=args.typeor'Unsigned'
localuser=args.user
localdate=args.date
ifdatethen
date=mw.getContentLanguage():formatDate("H\\:i\\, j F Y \\(e\\)",date,true)
end
localnowiki=''
ifmw.isSubsting()then
nowiki='<nowiki/>'
end
localtext={
'<small class="'..string.lower(type)..'-template">– '..type..' comment added',
'. Please sign comments with ~~'..nowiki..'~~</small>'
}
ifdatethen
table.insert(text,2,' at '..date)
end
ifuserthen
localuserLinks
ifnotuser:find('[^:%x%.%d]')andrequire('Module:IPAddress').isIP(user)then
userLinks='[[Special:Contribs/'..user..'|'..user..']] ([[User talk:'..user..'|talk]])'
else
userLinks='[[User:'..user..'|'..user..']] ([[User talk:'..user..'|talk]] • [[Special:Contribs/'..user..'|contribs]])'
end
table.insert(text,2,' by '..userLinks)
end
returntable.concat(text)
end
p.unsigned=function(f)
localargs=require('Module:ProcessArgs').norm(f.argsorf)
localtype=args.typeor'Unsigned'
localuser=args.user
localdate=args.date
localcategory={'<!-- Template:'..type..' -->'}
ifmw.isSubsting()then
-- Don't allow substitution with missing required arg
iftype=='Unsigned'andnotuserthen
localdateArg=''
ifdatethen
dateArg='||'..date
end
return'{{Unsigned'..dateArg..'}}'
elseiftype=='Undated'andnotdatethen
return'{{Undated}}'
end
elseifmw.title:getCurrentTitle().namespace~=10then
iftype=='Unsigned'andnotuserthen
table.insert(category,'[[Category:Unsigned template used incorrectly]]')
elseiftype=='Undated'andnotdatethen
table.insert(category,'[[Category:Undated template used incorrectly]]')
end
table.insert(category,'[[Category:Pages with templates requiring substitution]]')
end
returnbase(args)..table.concat(category)
end
returnp
Retrieved from "https://minecraft.wiki/w/Module:Unsigned?oldid=3612243"

Navigation menu