Content deleted Content added
vesselid and register parsing |
m Pppery moved page Module:Cite DNV/sandbox to Module:Sandbox/Ahecht/Cite DNV without leaving a redirect: Module:Foo/sandbox is the naming convention for sandboxed additions to an existing the module, not the naming convention for non-fully-developed new modules |
||
(12 intermediate revisions by one other user not shown) | |||
Line 7:
local success=true
local register="DNV"
local outstr = ""
for k, v in pairs(origArgs) do
args[k] = v
end
if vesselid ==
end
if shipname == '' then success=false end
if success then
return '{{cite ship register |register='..register..' |id='..vesselid..' |shipname='..shipname..' |accessdate='..((args['accessdate'] or args['access-date']) or '')..' }}'
else
outstr = args['url'] and '{{cite web' or '{{cite DNV'
for k, v in pairs(origArgs) do
outstr = outstr..' | '..k..'='..v
end
outstr = outstr..'}}'..(args['url'] and '' or htmlerror{'Error in [[Template:Cite DNV]]: Invalid parameters.'})
return outstr
end
▲ return '{{cite ship register|register='..register..'|id='..vesselid..'|shipname='..(string.match(args['title'],'\'\'(.-)\'\'') or args['title'])..'|accessdate='..((args['accessdate'] or args['access-date']) or '')
end
|