More actions
Skycrafter (talk | contribs) No edit summary |
Obbybigfast (talk | contribs) make image not super big |
||
| (29 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<!-- Params: | |||
trackId = required (MX TrackId) | |||
site = tmnf | tmuf | original | tmo | sunrise | tms | nations | tmn | tm2 | tm2020 (default: tmnf) | |||
title, image, game = optional manual overrides (Game stays manual) | |||
--> | |||
{{#if:{{{trackId|}}} | {{#if:{{{trackId|}}} | ||
| {{#get_web_data: | | {{#get_web_data: | ||
| url = https://tmnf.exchange/api/ | | url = {{#switch:{{lc:{{{site|tmnf}}}}} | ||
| | | tmuf = https://tmuf.exchange | ||
| tmnf = https://tmnf.exchange | |||
| original = https://original.tm-exchange.com | |||
| tmo = https://original.tm-exchange.com | |||
| sunrise = https://sunrise.tm-exchange.com | |||
| tms = https://sunrise.tm-exchange.com | |||
| nations = https://nations.tm-exchange.com | |||
| tmn = https://nations.tm-exchange.com | |||
| tm2 = https://tm.mania.exchange | |||
| tm2020 = https://trackmania.exchange | |||
| #default = https://tmnf.exchange | |||
}}{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf | |||
| tmnf | |||
| original | |||
| tmo | |||
| sunrise | |||
| tms | |||
| nations | |||
| tmn = /api/tracks?id={{{trackId}}}&count=1&fields=TrackId%2CTrackName%2CUId%2CAuthorTime%2CAuthorScore%2CGoldTarget%2CSilverTarget%2CBronzeTarget%2CUploader.UserId%2CUploader.Name%2CAuthors%5B%5D%2CWRReplay.ReplayTime%2CWRReplay.ReplayScore%2CWRReplay.User.Name%2CUploadedAt%2CUpdatedAt%2CActivityAt%2CPrimaryType%2CTrackValue%2CStyle%2CRoutes%2CDifficulty%2CEnvironment%2CCar%2CMood%2CAwards%2CComments%2CReplayType | |||
| tm2 | |||
| tm2020 = /api/maps?id={{{trackId}}}&count=1&fields=MapId%2CName%2CMapUid%2CMedals.Author%2CMedals.Gold%2CMedals.Silver%2CMedals.Bronze%2CUploader.UserId%2CUploader.Name%2CAuthors%5B%5D%2COnlineWR%2CUploadedAt%2CUpdatedAt%2CActivityAt%2CType%2CTrackValue%2CStyle%2CRoutes%2CDifficulty%2CEnvironment%2CVehicle%2CMood%2CAwardCount%2CCommentCount%2CReplayType | |||
}} | |||
| format = json with jsonpath | | format = json with jsonpath | ||
| cache seconds = 300 | | cache seconds = 300 | ||
| data = | |||
id = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].TrackId | tm2 | tm2020 = $.Results[0].MapId}}, | |||
name = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].TrackName | tm2 | tm2020 = $.Results[0].Name}}, | |||
uid = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].UId | tm2 | tm2020 = $.Results[0].MapName}}, | |||
time_author = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].AuthorTime | tm2 | tm2020 = $.Results[0].Medals.Author}}, | |||
score_author = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].AuthorScore | tm2 | tm2020 = $.Results[0].Medals.Author}}, | |||
time_gold = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].GoldTarget | tm2 | tm2020 = $.Results[0].Medals.Gold}}, | |||
time_silver = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].SilverTarget | tm2 | tm2020 = $.Results[0].Medals.Silver}}, | |||
time_bronze = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn= $.Results[0].BronzeTarget | tm2 | tm2020 = $.Results[0].Medals.Bronze}}, | |||
uploader_id = $.Results[0].Uploader.UserId, | |||
uploader_name = $.Results[0].Uploader.Name, | |||
wr_time = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn= $.Results[0].WRReplay.ReplayTime | tm2 | tm2020 = $.Results[0].OnlineWR.RecordTime}}, | |||
wr_score = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].WRReplay.ReplayScore | tm2 | tm2020 = $.Results[0].OnlineWR.RecordTime}}, | |||
wr_player = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].WRReplay.User.Name | tm2 | tm2020 = $.Results[0].OnlineWR.DisplayName}}, | |||
uploaded_at = $.Results[0].UploadedAt, | |||
updated_at = $.Results[0].UpdatedAt, | |||
activity_at = $.Results[0].ActivityAt, | |||
primary_type = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].PrimaryType | tm2 | tm2020 = $.Results[0].Type}}, | |||
track_value = $.Results[0].TrackValue, | |||
style = $.Results[0].Style, | |||
routes = $.Results[0].Routes, | |||
difficulty = $.Results[0].Difficulty, | |||
environment = $.Results[0].Environment, | |||
car = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].Car | tm2 | tm2020 = $.Results[0].Vehicle}}, | |||
mood = $.Results[0].Mood, | |||
awards = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].Awards | tm2 | tm2020 = $.Results[0].AwardCount}}, | |||
comments = {{#switch:{{lc:{{{site|tmnf}}}}}| tmuf | tmnf | original | tmo | sunrise | tms | nations | tmn = $.Results[0].Comments | tm2 | tm2020 = $.Results[0].CommentCount}}, | |||
replay_type = $.Results[0].ReplayType, | |||
authors_json = $.Results[0].Authors[*].User.Name | |||
}} | |||
}} | |||
{{#ifeq:{{lc:{{{site|tmnf}}}}}|tm2 | |||
| {{#get_web_data: | |||
| url = https://tm.mania.exchange/api/replays?mapId={{#external_value:id}} | |||
| format = json with jsonpath | |||
| cache seconds = 300 | |||
| data = | |||
wr_time = $.Results[0].ReplayTime, | |||
wr_score = $.Results[0].ReplayPoints, | |||
wr_player = $.Results[0].User.Name | |||
}} | }} | ||
}} | }} | ||
{| class="wikitable infobox-track" style="width:300px; float:right; clear:right; margin-left:10px;" | {| class="wikitable infobox-track" style="width:300px; float:right; clear:right; margin-left:10px;" | ||
|- | |- | ||
! colspan="2" class="infobox-title" | {{{title|{{ | ! colspan="2" class="infobox-title" style="text-align:center;" | {{#if:{{{title|}}} | ||
| {{{title}}} | |||
| {{#if:{{#external_value:name|}} | |||
| {{#external_value:name}} | |||
| Unknown }} }} | |||
|- | |- | ||
| colspan="2" class="infobox-image" | | | colspan="2" class="infobox-image" style="text-align:center; padding:5px;" | <div style="width: 280px; height: 160px; margin: 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center;"> | ||
<div style="width: 100%;"> | |||
{{ShowImage|https://{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf = tmuf.exchange/trackshow/{{#external_value:id}}/image/1 | |||
| tmnf = tmnf.exchange/trackshow/{{#external_value:id}}/image/1 | |||
| original = original.tm-exchange.com/trackshow/{{#external_value:id}}/image/1 | |||
| tmo = original.tm-exchange.com/trackshow/{{#external_value:id}}/image/1 | |||
| sunrise = sunrise.tm-exchange.com/trackshow/{{#external_value:id}}/image/1 | |||
| tms = sunrise.tm-exchange.com/trackshow/{{#external_value:id}}/image/1 | |||
| nations = nations.tm-exchange.com/trackshow/{{#external_value:id}}/image/1 | |||
| tmn = nations.tm-exchange.com/trackshow/{{#external_value:id}}/image/1 | |||
| tm2 = tm.mania.exchange/mapimage/{{#external_value:id}}/1 | |||
| tm2020 = trackmania.exchange/mapimage/{{#external_value:id}}/1 | |||
| #default = tmnf.exchange/trackshow/{{#external_value:id}}/image/1 | |||
}}}}</div> | |||
</div> | |||
|- | |- | ||
! Game || {{{game| | ! Game || {{{game|{{#switch: {{lc:{{{site|}}}}} | ||
| tmuf = TrackMania United Forever | |||
| tmnf = TrackMania Nations Forever | |||
| original = TrackMania Original | |||
| tmo = TrackMania Original | |||
| sunrise = TrackMania Sunrise | |||
| tms = TrackMania Sunrise | |||
| nations = TrackMania Nations | |||
| tmn = TrackMania Nations | |||
| tm2 = TrackMania² | |||
| tm2020 = Trackmania 2020 | |||
| #default = TrackMania Nations Forever | |||
}}}}} | |||
|- | |- | ||
! Author(s) || {{{author|Unknown}}} | ! Author(s) || {{#if:{{{author|}}} | ||
| {{{author}}} | |||
| {{#if:{{#external_value:authors_json|}} | |||
| {{#external_value:authors_json}} | |||
| Unknown | |||
}} }} | |||
|- | |- | ||
! World record || {{# | |||
! World record || {{#if:{{{worldrecord|}}} | |||
| {{{worldrecord}}} | |||
| {{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf | |||
| tmnf | |||
| original | |||
| tmo | |||
| sunrise | |||
| tms | |||
| nations | |||
| tmn = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
| 2 = {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
| 3 = {{#external_value:wr_score|}} points by {{#external_value:wr_player|Unknown}} | |||
| {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
}} | |||
| tm2 | |||
| tm2020 = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
| 1 = {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
| 3 = {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
| 4 = {{#external_value:wr_score|}} points by {{#external_value:wr_player|Unknown}} | |||
| 7 = {{Time|{{#external_value:time_author}}}} | |||
| {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
}} | |||
}} | |||
| #default = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
| 2 = {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
| 3 = {{#external_value:wr_score|}} points by {{#external_value:wr_player|Unknown}} | |||
| {{Time|{{#external_value:wr_time|}}}} by {{#external_value:wr_player|Unknown}} | |||
}} | |||
}} | |||
|- | |- | ||
! Author medal || {{{authormedal| | ! Author medal || {{#if:{{{authormedal|}}} | ||
| {{{authormedal}}} | |||
| {{#if:{{#external_value:time_author|}} | |||
| {{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf | |||
| tmnf | |||
| original | |||
| tmo | |||
| sunrise | |||
| tms | |||
| nations | |||
| tmn = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_author}}}} | |||
| 2 = {{#external_value:time_author}} respawns | |||
| 3 = {{#external_value:score_author}} points | |||
| {{Time|{{#external_value:time_author}}}} | |||
}} | |||
| tm2 | |||
| tm2020 = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_author}}}} | |||
| 1 = {{Time|{{#external_value:time_author}}}} | |||
| 3 = {{#external_value:time_author}} respawns | |||
| 4 = {{#external_value:time_author}} points | |||
| 7 = {{Time|{{#external_value:time_author}}}} | |||
| {{Time|{{#external_value:time_author}}}} | |||
}} | |||
}} | |||
| #default = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_author}}}} | |||
| 2 = {{#external_value:time_author}} respawns | |||
| 3 = {{#external_value:time_author}} points | |||
| {{Time|{{#external_value:time_author}}}} | |||
}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! Gold medal || {{{goldmedal| | ! Gold medal || {{#if:{{{goldmedal|}}} | ||
| {{{goldmedal}}} | |||
| {{#if:{{#external_value:time_gold|}} | |||
| {{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf | |||
| tmnf | |||
| original | |||
| tmo | |||
| sunrise | |||
| tms | |||
| nations | |||
| tmn = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_gold}}}} | |||
| 2 = {{#external_value:time_gold}} respawns | |||
| 3 = {{#external_value:time_gold}} points | |||
| {{Time|{{#external_value:time_gold}}}} | |||
}} | |||
| tm2 | |||
| tm2020 = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_gold}}}} | |||
| 1 = {{Time|{{#external_value:time_gold}}}} | |||
| 3 = {{#external_value:time_gold}} respawns | |||
| 4 = {{#external_value:time_gold}} points | |||
| 7 = {{Time|{{#external_value:time_gold}}}} | |||
| {{Time|{{#external_value:time_gold}}}} | |||
}} | |||
}} | |||
| #default = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_gold}}}} | |||
| 2 = {{#external_value:time_gold}} respawns | |||
| 3 = {{#external_value:time_gold}} points | |||
| {{Time|{{#external_value:time_gold}}}} | |||
}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! Silver medal || {{{silvermedal| | ! Silver medal || {{#if:{{{silvermedal|}}} | ||
| {{{silvermedal}}} | |||
| {{#if:{{#external_value:time_silver|}} | |||
| {{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf | |||
| tmnf | |||
| original | |||
| tmo | |||
| sunrise | |||
| tms | |||
| nations | |||
| tmn = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_silver}}}} | |||
| 2 = {{#external_value:time_silver}} respawns | |||
| 3 = {{#external_value:time_silver}} points | |||
| {{Time|{{#external_value:time_silver}}}} | |||
}} | |||
| tm2 | |||
| tm2020 = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_silver}}}} | |||
| 1 = {{Time|{{#external_value:time_silver}}}} | |||
| 3 = {{#external_value:time_silver}} respawns | |||
| 4 = {{#external_value:time_silver}} points | |||
| 7 = {{Time|{{#external_value:time_silver}}}} | |||
| {{Time|{{#external_value:time_silver}}}} | |||
}} | |||
}} | |||
| #default = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_silver}}}} | |||
| 2 = {{#external_value:time_silver}} respawns | |||
| 3 = {{#external_value:time_silver}} points | |||
| {{Time|{{#external_value:time_silver}}}} | |||
}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! Bronze medal || {{{bronzemedal| | ! Bronze medal || {{#if:{{{bronzemedal|}}} | ||
| {{{bronzemedal}}} | |||
| {{#if:{{#external_value:time_bronze|}} | |||
| {{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf | |||
| tmnf | |||
| original | |||
| tmo | |||
| sunrise | |||
| tms | |||
| nations | |||
| tmn = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_bronze}}}} | |||
| 2 = {{#external_value:time_bronze}} respawns | |||
| 3 = {{#external_value:time_bronze}} points | |||
| {{Time|{{#external_value:time_bronze}}}} | |||
}} | |||
| tm2 | |||
| tm2020 = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_bronze}}}} | |||
| 1 = {{Time|{{#external_value:time_bronze}}}} | |||
| 3 = {{#external_value:time_bronze}} respawns | |||
| 4 = {{#external_value:time_bronze}} points | |||
| 7 = {{Time|{{#external_value:time_bronze}}}} | |||
| {{Time|{{#external_value:time_bronze}}}} | |||
}} | |||
}} | |||
| #default = {{#switch:{{#external_value:primary_type}} | |||
| 0 = {{Time|{{#external_value:time_bronze}}}} | |||
| 2 = {{#external_value:time_bronze}} respawns | |||
| 3 = {{#external_value:time_bronze}} points | |||
| {{Time|{{#external_value:time_bronze}}}} | |||
}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Uploaded || {{#if:{{{release_date|}}} | ||
| {{{release_date}}} | |||
| {{#if:{{#external_value:uploaded_at|}} | |||
| {{#time:Y-m-d G:i:s e|{{#external_value:uploaded_at}}}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! Link || {{{link|Unknown}}} | ! Last updated || {{#if:{{{lastupdated|}}} | ||
| {{{lastupdated}}} | |||
| {{#if:{{#external_value:updated_at|}} | |||
| {{#time:Y-m-d G:i:s e|{{#external_value:updated_at}}}} | |||
| N/A | |||
}} }} | |||
|- | |||
! Activity || {{#if:{{{activity|}}} | |||
| {{{activity}}} | |||
| {{#if:{{#external_value:activity_at|}} | |||
| {{#time:Y-m-d G:i:s e|{{#external_value:activity_at}}}} | |||
| N/A | |||
}} }} | |||
|- | |||
! Awards / Comments || {{#if:{{{awardscomments|}}} | |||
| {{{awardscomments}}} | |||
| {{#if:{{#external_value:awards|dummy}} | |||
| {{#external_value:awards|0}} / {{#external_value:comments|0}} | |||
| N/A | |||
}} }} | |||
|- | |||
! Link || {{#if:{{{link|}}} | |||
| {{{link}}} | |||
| {{#if:{{#external_value:id|{{{trackId|}}}}} | |||
| [{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf = https://tmuf.exchange | |||
| tmnf = https://tmnf.exchange | |||
| original = https://original.tm-exchange.com | |||
| tmo = https://original.tm-exchange.com | |||
| sunrise = https://sunrise.tm-exchange.com | |||
| tms = https://sunrise.tm-exchange.com | |||
| nations = https://nations.tm-exchange.com | |||
| tmn = https://nations.tm-exchange.com | |||
| tm2 = https://tm.mania.exchange | |||
| tm2020 = https://trackmania.exchange | |||
| #default = https://tmnf.exchange | |||
}}{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf | |||
| tmnf | |||
| original | |||
| tmo | |||
| sunrise | |||
| tms | |||
| nations | |||
| tmn = /trackshow/{{#external_value:id|{{{trackId|}}}}} TrackMania Exchange] | |||
| tm2 | |||
| tm2020 = /mapshow/{{#external_value:id|{{{trackId|}}}}} TrackMania Exchange] | |||
| #default = /trackshow/{{#external_value:id|{{{trackId|}}}}} TrackMania Exchange] | |||
}} | |||
| Unknown | |||
}} }} | |||
|- | |- | ||
|} | |} | ||
[[Category: | [[Category:Tracks|{{PAGENAME}}]] | ||
[[Category:{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf = TMUF | |||
| tmnf = TMNF | |||
| original = TMO | |||
| tmo = TMO | |||
| sunrise = TMS | |||
| tms = TMS | |||
| nations = TMN | |||
| tmn = TMN | |||
| tm2 = TM² | |||
| tm2020 = TM2020 | |||
| #default = TMNF | |||
}} Tracks|{{PAGENAME}}]] | |||
</includeonly><noinclude> | </includeonly><noinclude> | ||
== Usage == | == Usage == | ||
This is the infobox template for | This is the infobox template for tracks. To use it, copy and paste the following code into an article (trackId is required, site is tmnf by default): | ||
<pre> | <pre> | ||
{{Infobox | {{Infobox track | ||
| title = Track Title | | trackId = 123456 | ||
| image = Example.jpg | | site = tmuf, tmnf, original, tmo, sunrise, tms, nations, tmn, tm2, tm2020 (Default: tmnf) | ||
| game = TrackMania Game | | title = Track Title (Optional) | ||
| image = Example.jpg (Optional) | |||
| game = TrackMania Game (Optional) | |||
}} | }} | ||
</pre> | </pre> | ||
[[Category:Infobox templates]] | [[Category:Infobox templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 19:55, 28 January 2026
Usage[edit]
This is the infobox template for tracks. To use it, copy and paste the following code into an article (trackId is required, site is tmnf by default):
{{Infobox track
| trackId = 123456
| site = tmuf, tmnf, original, tmo, sunrise, tms, nations, tmn, tm2, tm2020 (Default: tmnf)
| title = Track Title (Optional)
| image = Example.jpg (Optional)
| game = TrackMania Game (Optional)
}}