Doctor Who Cuttings Archive

Difference between revisions of "Template:InvertName"

From The Doctor Who Cuttings Archive
Jump to navigationJump to search
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#arraydefine:n|{{{author}}}|   | }}
+
{{#vardefine:temp | {{{1}}} }}
{{#arrayindex:n|-1|{{{author}}} }},
+
{{#vardefine:pos | {{#rpos:{{#var:temp}} | }} }}
{{
+
{{#if: {{#expr: {{#var:pos}} > 0}}
  #loop: x
+
    | {{#vardefine:lastName  | {{#sub: {{#var:temp}} | {{#expr: {{#var:pos}} + 1 }} }} }}
  | 1
+
      {{#vardefine:firstName | {{#sub: {{#var:temp}} | 0 | {{#var:pos}} }} }}
  | {{#expr: {{#arraysize:n}} - 1 }}  
+
      {{#var:lastName}}, {{#var:firstName}}
  | {{#arrayindex:n|{{#var:x}}|}}
+
    | {{{author}}}
 
}}
 
}}

Latest revision as of 23:27, 2 July 2014


{{{1}}}, {{{1}}