Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Janeccerek/Reign
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 = {} p.reign = function( frame ) local start = frame.args.start or "?" local ending = frame.args.ending or "" local sec_start = frame.args.sec_start local sec_ending = frame.args.sec_ending local label = frame.args.label local single = frame.args.single local show = frame.args.show local cap = frame.args.cap local pre_date = frame.args.pre_date local post_date = frame.args.post_date local mid_date = frame.args.mid_date local era = frame.args.era local abbr = "<abbr title='reign'>r.</abbr>" local ndash = "–" local nbsp = " " if start == "" and not single then start = "?" end if show == "none" then abbr = "r." end if show == "link" then abbr = "[[Reign|r.]]" end if show == "word" then abbr = "reigned" end if show == "colon" then abbr = "reign:" end if show == "lword" then abbr = "[[Reign|reigned]]" end if show == "lcolon" then abbr = "[[Reign|reign:]]" end if show == "blank" then abbr = "" end if cap ~= null then if show == "none" then abbr = "R." end if show == "link" then abbr = "[[Reign|R.]]" end if show == "word" then abbr = "Reigned" end if show == "colon" then abbr = "Reign:" end if show == "lword" then abbr = "[[Reign|Reigned]]" end if show == "lcolon" then abbr = "[[Reign|Reign:]]" end end if single then msg = single end if not single and not pre_date then msg = start.. ndash ..ending end if string.match(start, ' ') ~= nil or string.match(ending, ' ') ~= nil then msg = start.. nbsp.. ndash.. nbsp.. ending end if mid_date and sec_start and sec_ending and start and ending and string.match(sec_start, ' ') ~= nil and string.match(sec_ending, ' ') ~= nil then msg = msg.. ", " ..mid_date.. ", " ..sec_start.. ndash ..sec_ending end if sec_start and sec_ending and not mid_date and string.match(sec_start, ' ') == nil and string.match(sec_ending, ' ') == nil then msg = msg.. " and " ..sec_start.. ndash ..sec_ending end if sec_start and sec_ending and not mid_date and (string.match(sec_start, ' ') ~= nil or string.match(sec_ending, ' ') ~= nil) then msg = msg.. " and " ..sec_start.. nbsp.. ndash.. nbsp.. sec_ending end if sec_start and sec_ending and mid_date and (string.match(sec_start, ' ') ~= nil or string.match(sec_ending, ' ') ~= nil) then msg = msg.. ", " ..mid_date.. ", " ..sec_start.. nbsp.. ndash.. nbsp.. sec_ending end if pre_date and not post_date then msg = pre_date.. ", " ..msg end if post_dat and not pre_date then msg = msg.. ", " ..post_date end if post_date and pre_date and (start == "?" or start == "") and ending == "" then msg = pre_date.. ", " ..post_date end if era then msg = msg.. " " ..era end if not label then msg = abbr.. " " ..msg else msg = label.. ": " ..msg end return msg 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/Janeccerek/Reign/doc
(
edit
)