Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Infobox player: Difference between revisions

Template page
m Kaph moved page Template:PlayerBox to Template:Infobox player: Naming clarity
No edit summary
Line 21: Line 21:
{{!}} {{{dateJoined|{{{date_joined}}}}}}
{{!}} {{{dateJoined|{{{date_joined}}}}}}
}}
}}
{{#if:{{{generation|}}}|
{{#if:{{{dateJoined|{{{date_joined|}}}}}}|
{{!}}-
{{!}}-
! style="text-align:left;" {{!}} Generation
! style="text-align:left;" {{!}} Generation
{{!}} {{#switch:{{lc:{{{generation}}}}}
{{!}} {{#iferror:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}}|<span title="The join date could not be interpreted.">Unknown</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20111203|<span style="color:#FC5454;">First Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20121202|<span style="color:#FCA800;">Second Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20131207|<span style="color:#FC54FC;">Third Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20150919|<span style="color:#FC54FC;">Fourth Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20160807|<span style="color:#00A8A8;">Fifth Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20180328|<span style="color:#00A8A8;">Sixth Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20200530|<span style="color:#54FC54;">Seventh Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20211017|<span style="color:#54FC54;">Eighth Generation</span>|{{#ifexpr:{{#time:Ymd|{{{dateJoined|{{{date_joined}}}}}}}} < 20230929|<span style="color:#FCFCFC;">Ninth Generation</span>|<span style="color:#FCFCFC;">Tenth Generation</span>}}}}}}}}}}}}}}}}}}}}
|1|first=<span style="color:#FC5454;">First Generation</span>
|2|second=<span style="color:#FCA800;">Second Generation</span>
|3|third=<span style="color:#FC54FC;">Third Generation</span>
|4|fourth=<span style="color:#FC54FC;">Fourth Generation</span>
|5|fifth=<span style="color:#00A8A8;">Fifth Generation</span>
|6|sixth=<span style="color:#00A8A8;">Sixth Generation</span>
|7|seventh=<span style="color:#54FC54;">Seventh Generation</span>
|8|eighth=<span style="color:#54FC54;">Eighth Generation</span>
|9|ninth=<span style="color:#FCFCFC;">Ninth Generation</span>
|10|tenth=<span style="color:#FCFCFC;">Tenth Generation</span>
|#default={{{generation}}}
}}
}}
}}
{{#if:{{{formerNames|{{{former_names|}}}}}}|
{{#if:{{{formerNames|{{{former_names|}}}}}}|
Line 47: Line 35:
! colspan="2" style="text-align:center;" {{!}} Links
! colspan="2" style="text-align:center;" {{!}} Links
{{!}}-
{{!}}-
{{!}} colspan="2" style="text-align:center; padding:7px;" {{!}} {{#if:{{{forumsId|{{{forums_id|}}}}}}|<span style="display:inline-block; margin:2px; padding:4px 7px; border:1px solid #777;">[https://forums.lokamc.com/members/{{{forumsId|{{{forums_id}}}}}}/ Forums]</span>}}{{#if:{{{uuid|}}}|<span style="display:inline-block; margin:2px; padding:3px; border:1px solid #777;">[[File:NameMC logo.png|26px|link=https://namemc.com/profile/{{{uuid}}}|alt=NameMC]]</span><span style="display:inline-block; margin:2px; padding:3px; border:1px solid #777;">[[File:EldritchBot icon logo.png|26px|link=https://eldritchbot.com/player/{{{uuid}}}|alt=EldritchBot]]</span>}}{{#if:{{{discordId|{{{discord_id|}}}}}}|<span style="display:inline-block; margin:2px; padding:3px; border:1px solid #777;">[[File:Discord logo.svg|26px|link=https://discord.com/users/{{{discordId|{{{discord_id}}}}}}|alt=Discord]]</span>}}
{{!}} colspan="2" style="text-align:center; padding:7px;" {{!}} {{#if:{{{forumsId|{{{forums_id|}}}}}}|<span style="display:inline-block; margin:2px; padding:4px 7px; border:1px solid #777;">[https://forums.lokamc.com/members/{{{forumsId|{{{forums_id}}}}}}/ Forums]</span>}}{{#if:{{{uuid|}}}|<span style="display:inline-block; margin:2px; padding:3px; border:1px solid #777;">[[File:NameMC logo.svg|26px|link=https://namemc.com/profile/{{{uuid}}}|alt=NameMC]]</span><span style="display:inline-block; margin:2px; padding:3px; border:1px solid #777;">[[File:EldritchBot icon logo.png|26px|link=https://eldritchbot.com/player/{{{uuid}}}|alt=EldritchBot]]</span>}}{{#if:{{{discordId|{{{discord_id|}}}}}}|<span style="display:inline-block; margin:2px; padding:3px; border:1px solid #777;">[[File:Discord logo.svg|26px|link=https://discord.com/users/{{{discordId|{{{discord_id}}}}}}|alt=Discord]]</span>}}
}}
}}
|}</includeonly><noinclude>
|}</includeonly><noinclude>
Line 60: Line 48:
|town=Example Town
|town=Example Town
|dateJoined=March 26, 2026
|dateJoined=March 26, 2026
|generation=First
|formerNames=OldName, OlderName
|formerNames=OldName, OlderName
|forumsId=1741
|forumsId=1741
Line 99: Line 86:
| Date the player joined Loka, written in month–day–year format. The legacy parameter <code>date_joined</code> also works.
| Date the player joined Loka, written in month–day–year format. The legacy parameter <code>date_joined</code> also works.
| <code>March 26, 2026</code>
| <code>March 26, 2026</code>
|-
| <code>generation</code>
| Player generation from First through Tenth. The numbers 1–10 also work.
| <code>First</code>
|-
|-
| <code>formerNames</code>
| <code>formerNames</code>
Line 123: Line 106:
* Enter UUIDs without hyphens. This installation does not currently provide the <code>#replace</code> parser function needed to remove them automatically.
* Enter UUIDs without hyphens. This installation does not currently provide the <code>#replace</code> parser function needed to remove them automatically.
* Loka's API exposes rank and Discord ID by UUID, but this wiki currently has no extension capable of fetching and decoding external JSON. These values therefore remain manual parameters.
* Loka's API exposes rank and Discord ID by UUID, but this wiki currently has no extension capable of fetching and decoding external JSON. These values therefore remain manual parameters.
== Automatic generation calculation ==
The generation is calculated automatically from <code>dateJoined</code>; do not supply a separate generation parameter. The template converts the join date to <code>YYYYMMDD</code> with <code>#time</code> and compares it with the generation boundaries recorded on the [https://loka.fandom.com/wiki/Generations archived Generations article]:
{| class="wikitable"
! Generation
! Join-date range
|-
| <span style="color:#FC5454;">First Generation</span> || Before December 3, 2011
|-
| <span style="color:#FCA800;">Second Generation</span> || December 3, 2011 – December 1, 2012
|-
| <span style="color:#FC54FC;">Third Generation</span> || December 2, 2012 – December 6, 2013
|-
| <span style="color:#FC54FC;">Fourth Generation</span> || December 7, 2013 – September 18, 2015
|-
| <span style="color:#00A8A8;">Fifth Generation</span> || September 19, 2015 – August 6, 2016
|-
| <span style="color:#00A8A8;">Sixth Generation</span> || August 7, 2016 – March 27, 2018
|-
| <span style="color:#54FC54;">Seventh Generation</span> || March 28, 2018 – May 29, 2020
|-
| <span style="color:#54FC54;">Eighth Generation</span> || May 30, 2020 – October 16, 2021
|-
| <span style="color:#FCFCFC;">Ninth Generation</span> || October 17, 2021 – September 28, 2023
|-
| <span style="color:#FCFCFC;">Tenth Generation</span> || September 29, 2023 onward
|}


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 19:25, 17 August 2026

Usage

{{PlayerBox
|name=PlayerName
|image=PlayerName.png
|uuid=7c0ff210425f4860b158b56590c6f0b4
|rank=Elder
|town=Example Town
|dateJoined=March 26, 2026
|formerNames=OldName, OlderName
|forumsId=1741
|discordId=138419767567450112
}}

Only name is normally required. Rows for omitted optional parameters are hidden.

Parameters

Parameter Description Example
name Player's current Minecraft name. Defaults to the page name. PlayerName
image Filename of an image uploaded to the wiki. Do not include the File: prefix. PlayerName.png
uuid Player's hyphenless Minecraft UUID. Generates NameMC and EldritchBot links. 7c0ff210425f4860b158b56590c6f0b4
rank Current Loka rank. Automatically passed through Template:Rank. Elder
town Current town. Linked only when an article with the exact town name exists; otherwise displayed as plain text. Example Town
dateJoined Date the player joined Loka, written in month–day–year format. The legacy parameter date_joined also works. March 26, 2026
formerNames Notable former Minecraft names. former_names also works. OldName
forumsId Numerical ID from the player's Loka forums URL. Generates a forums profile link. forums_id also works. 1741
discordId Numerical ID of the player's linked Discord account. Generates a Discord profile link. discord_id also works. 138419767567450112

Requirements

  • Template:Rank supplies rank colouring, links and tooltips.
  • NameMC logo.svg, EldritchBot icon logo.png and Discord logo.svg must be uploaded locally.
  • Enter UUIDs without hyphens. This installation does not currently provide the #replace parser function needed to remove them automatically.
  • Loka's API exposes rank and Discord ID by UUID, but this wiki currently has no extension capable of fetching and decoding external JSON. These values therefore remain manual parameters.

Automatic generation calculation

The generation is calculated automatically from dateJoined; do not supply a separate generation parameter. The template converts the join date to YYYYMMDD with #time and compares it with the generation boundaries recorded on the archived Generations article:

Generation Join-date range
First Generation Before December 3, 2011
Second Generation December 3, 2011 – December 1, 2012
Third Generation December 2, 2012 – December 6, 2013
Fourth Generation December 7, 2013 – September 18, 2015
Fifth Generation September 19, 2015 – August 6, 2016
Sixth Generation August 7, 2016 – March 27, 2018
Seventh Generation March 28, 2018 – May 29, 2020
Eighth Generation May 30, 2020 – October 16, 2021
Ninth Generation October 17, 2021 – September 28, 2023
Tenth Generation September 29, 2023 onward