Content deleted Content added
failsafe |
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 |
||
(9 intermediate revisions by one other user not shown) | |||
Line 13:
end
url, vesselid = string.match(string.lower(args['url'] or ''),'//exchange.dnv.com/exchange/main.aspx?(.*)vesselid=(g?%d%d%d%d%d%d?)')
vesselid = (vesselid or string.lower(((args['id'] or args['ID']) or args['vesselid']) or '') )
if
success=false
elseif not tonumber(vesselid) then
vesselid = string.upper(vesselid)
register = "GL"
elseif tonumber(vesselid) > 99999 then
vesselid = "G"..vesselid
register = "GL"
end
shipname = ((string.match((args['title'] or ''),'\'\'(.-)\'\'') or args['title']) or (args['shipname'] or args['name'])) or ''
if
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
return outstr..'}}'▼
▲ else
▲ return htmlerror{'Error in [[Template:Cite DNV]]: Invalid parameters.'}
end
|