Difference between revisions of "Template:FamilyRelation"
From NorCon MUSH
m (Protected "Template:FamilyRelation" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
|||
| (22 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | {{#get_db_data: | + | <includeonly>{{#get_db_data: |
db=norcon | db=norcon | ||
|from=chars_relations | |from=chars_relations | ||
| Line 9: | Line 9: | ||
|from=chars | |from=chars | ||
|where=id='{{{ID}}}' | |where=id='{{{ID}}}' | ||
| − | |data=id=id,familyname {{{Var}}}=Name, sex {{{Var}}}=sex | + | |data=id=id,familyname {{{Var}}}=Name, sex {{{Var}}}=sex,birthsecs {{{Var}}}=birthsecs, rankid {{{Var}}}=rankid |
| + | }} | ||
| + | {{#get_db_data: | ||
| + | db=norcon | ||
| + | |from=chars_ranks | ||
| + | |where=id='{{#external_value:rankid {{{Var}}}}}' | ||
| + | |data=rank {{{Var}}}=rank | ||
}} | }} | ||
| − | {{#ifeq:{{#external_value:relation {{{Var}}}}}|children|{{#ifeq:{{#external_value:sex {{{Var}}}}}}}|F|Daughter|Son}}|{{#external_value:relation {{{Var}}}}}}} {{!}}{{!}} | + | {{!}}- |
| + | {{!}}{{ucfirst:{{#ifeq:{{#external_value:relation {{{Var}}}}}|children|{{#ifeq:{{ucfirst:{{#external_value:sex {{{Var}}}}}}}|F|Daughter|Son}}|{{#ifeq:{{#external_value:relation {{{Var}}}}}|sibling|{{#ifeq:{{ucfirst:{{#external_value:sex {{{Var}}}}}}}|F|Sister|Brother}}|{{#external_value:relation {{{Var}}}}}}}}} }} | ||
| + | {{!}}{{#ifexist: {{#external_value:familyname {{{Var}}}}}|[[{{#external_value:familyname {{{Var}}}}}]]|{{#external_value:familyname {{{Var}}}}}}} | ||
| + | {{!}}{{#external_value:rank {{{Var}}}}} | ||
| + | {{!}}{{#ifeq:{{#external_value:birthsecs {{{Var}}}}}| | |~{{#expr:trunc {{#expr:{{#expr:{{#expr: {{#time: U | now }}-{{#external_value:birthsecs {{{Var}}}}}}}/31449600}}*3}}}} turns}}</includeonly> | ||