Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Ahecht/Cite DNV
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!
local p = {} local htmlerror = require('Module:Error').error function p.citednv(frame) local origArgs = frame:getParent().args local args = {} local success=true local register="DNV" local outstr = "" for k, v in pairs(origArgs) do args[k] = v 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 vesselid == '' then 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 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 end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/Ahecht/Cite DNV/doc
(
edit
)