Template:Snooker player points/doc

From Wikipedia, the free encyclopedia

Usage[edit]

This template produces the wikicode for a player entry on the Snooker ranking points articles e.g. provisional Snooker world rankings. The template is specifically designed for this article. The template produces wikicode that calculates ranking points for the player.

The parameters are:

position (the new position in the rankings - this will need to be input after the table is sorted)
first (first name of the player as written)
last (last name of the player as written)
note (note link for the player)
playerlink (the name of the player article if there is one; even if the name and article name are the same, it is still necessary to include this to link to the article)
country (the player's nationality code e.g. SCO for Scotland)
start (the player's official rank at the start of the season—necessary so that a player's climb and descent in the rankings can be tracked over the course of the season)

livepoints
The livepoints parameter takes the points from the season that is being dropped i.e. the 2011/12 season points are dropped throughout 2013/2014. This parameter takes the tournament points using Template:Snooker season points. By setting the current season, season & cutoff parameters in Template:Snooker season points the template will determine which points need to be dropped.

lastseason (last season takes the previous season's points using Template:Snooker season points).

The points for the current season are taken using individual parameters:
currentseason (the current season in xxxx/xxxx format)
season (the season of displayed tournament in xxxx/xxxx format)
cutoff (the next cut-off point i.e. 1,2,3,4,5,6,7)
ptc1, ptc2, ptc3, ptc4, ptc5, ptc6, ptc7, ptc8, ptc9, ptc10, ptc11, ptc12, aptc1, aptc2, aptc3, aptc4, eptc1, eptc2, eptc3, eptc4, eptc5, eptc6, eptc7, eptc8, ptcgf(the Player Tour Championship events)
ao (Australian Open)
bc (Bahrain Championship)
bo (British Open)
cc (China Championship)
co (China Open)
eno (English Open)
eum (European Masters)
euo (European Open)
gm (German Masters)
go (Gibraltar Open)
gp (Grand Prix)
ic (International Championship)
io (Indian Open)
nio (Northern Ireland Open)
nit (Northern Ireland Trophy)
pc (Players Championship)
phc (Paul Hunter Classic)
rm (Riga Masters)
sm (Shanghai Masters)
sco (Scottish Open)
sso (Snooker Shoot-out)
tc (Tour Championship)
tm (Turkish Masters)
uk (UK Championship)
wc (World Championship)
weo (Welsh Open)
wgp (World Grand Prix)
woo (World Open)
wps (WST Pro Series)
wuc (Wuxi Classic)

Background highlighting can be specified by adding "bg" to the end of the tournament code (ptcbg) in the case of the Players Tour Championship. E.g. wcbg is the parameter for highlighting the world championship cell in the table.


Example:

{{Snooker player points | position=3 | first =Judd | last = Trump |playerlink= |country=ENG |start=3
| livepoints={{Snooker season points | currentseason=2013/2014 | season=2011/2012 | cutoff=1 | ptc1=0 |ao=700 |ptc2=2000 |ptc3=560 |ptc4=560 |sm=980 |ptc5=560 |ptc6=1000 |ptc7=560 |ptc8=1600 |ptc9=2000 |ptc10=0 |uk=8000 |ptc11=1000 |ptc12=0 |gm=2500 |weo=2500 |woo=2660 |ptcgf=1140 |co=3500 |wc=3800 }}
| lastseason={{Snooker season points | currentseason=2013/2014 | season=2012/2013 |aptc1= |wuc=2660 |ao= |ptc1=1000 |ptc2=760 |eptc1=560 |ptc3=760 |sm=5600 |aptc2= |eptc2=360 |eptc3=360 |aptc3= |ic=8000 |ptc4=1600 |eptc4=2000 |uk=1120 |eptc5= |eptc6= |gm=1400 |weo=3200 |woo=3500 |ptcgf=840 |co=980 |wc=6400}}
| <!--current season--> currentseason=2013/2014 | season=2013/2014 |cutoff=1 |eptc1= |aptc1= |wuc=560 |ao= |eptc2= |eptc3= |eptc4= |sm= |aptc2= |eptc5= |aptc3= |ic= |eptc6= |eptc7= |uk= |gm= |eptc8= |weo= |aptc4= |woo= |ptcgf= |co= |wc=
| <!--background highlighting--> ptcbg=#ffffaa |wucbg=#ffffaa |aobg=#D3D3D3 |smbg=#ffffaa |icbg=#ffffaa |ukbg=#ffffaa |gmbg=#ffffaa |weobg=#ffffaa |woobg=#ffffaa |cobg=#ffffaa |wcbg=#ffffaa}}
}}

produces wikicode for a table entry:

|- | 3 || Steady || style="text-align:left;"| England Judd Trump |34920 | 41100

| style="background:#ffffaa" | 0 | style="background:#ffffaa" | 560 || style="background:#D3D3D3" | || style="background:#ffffaa" | || style="background:" | || style="background:#ffffaa" | || style="background:#ffffaa" | || style="background:#ffffaa" | || style="background:" | || style="background:#ffffaa" | || style="background:#ffffaa" | || style="background:#ffffaa" | || style="background:#ffffaa" |

| 560

| 76580||||||||||||

Updating the template[edit]

New tournaments and seasons[edit]

If you have any problems updating the template post a request on the talk page, and consider following the link at the top of the talk page to the snooker project to notify them of the issue.

This template works in conjunction with {{Snooker season points}} in automating the totals at each cut-off point for each season. This template only needs to be updated each time a new tournament is added to the calendar, while {{Snooker season points}} needs to be updated for every season and for each new tournament. The instructions for updating {{Snooker season points}} are outlined at that template. For this template, each new tournament needs to be allocated a new tournament code (for both the points and the background shading), and need to be added to this template in each section that has tournament codes. It is best to keep it systematic e.g. all the main tournament codes ordered alphabetically and then all the ptc codes, and then the background codes. However, do not remove codes for defunct tournaments, since this template is used by the older season articles. You can't go wrong if you just stick them in where the other codes are. Once you have completed the update on this template then follow the instructions at {{Snooker season points}}.

Further cut-off points[edit]

The template currently accommodates up to twelve cut-off points (including the total). It is possible that extra cut-off points will be added to the calendar at some point. It is relatively straightforward to added new cut-off points, requiring both this template and {{Snooker season points}} to be updated.

In the case of cut-off point 13 the following code would need to be copied into the bottom of the template:

{{#if: {{#titleparts:{{{livepoints|}}}|1|13}}|
{{!!}} {{#ifexpr: {{#expr:{{{cutoff|0}}}+0}} >= 13 | {{#expr: {{#titleparts:{{{livepoints|0}}}|1|13}}+{{{lastseason|0}}}+{{#titleparts:{{Snooker season points |currentseason={{{currentseason|}}} |season={{{season|}}}|cutoff=13 |ao={{{ao|}}}|bc={{{bc|}}}|co={{{co|}}}|eno={{{eno|}}}|euo={{{euo|}}}|gm={{{gm|}}}|go={{{go|}}}|gp={{{gp|}}}|ic={{{ic|}}}|io={{{io|}}}|iro={{{iro|}}}|nit={{{nit|}}}|pc={{{pc|}}}|phc={{{phc|}}}|rm={{{rm|}}}|sm={{{sm|}}}|sco={{{sco|}}}|sso={{{sso|}}}|uk={{{uk|}}}|wc={{{wc|}}}|weo={{{weo|}}}|wgp={{{wgp|}}}|woo={{{woo|}}}|wuc={{{wuc|}}}|ptc1={{{ptc1|}}}|ptc2={{{ptc2|}}}|ptc3={{{ptc3|}}}|ptc4={{{ptc4|}}}|ptc5={{{ptc5|}}}|ptc6={{{ptc6|}}}|ptc7={{{ptc7|}}}|ptc8={{{ptc8|}}}|ptc9={{{ptc9|}}}|ptc10={{{ptc10|}}}|ptc11={{{ptc11|}}}|ptc12={{{ptc12|}}}|aptc1={{{aptc1|}}}|aptc2={{{aptc2|}}}|aptc3={{{aptc3|}}}|aptc4={{{aptc4|}}}|eptc1={{{eptc1|}}}|eptc2={{{eptc2|}}}|eptc3={{{eptc3|}}}|eptc4={{{eptc4|}}}|eptc5={{{eptc5|}}}|eptc6={{{eptc6|}}}|eptc7={{{eptc7|}}}|eptc8={{{eptc8|}}}|ptcgf={{{ptcgf|}}}}}|1|13}}
}}}}}}

To add a cut-off point 14, the same code can be used with a few alterations:

  1. In the first 'if' line change 1|13 to 1|14
  2. In the second line change >= 13 to >= 14
  3. In the second line again change 1|13 to 1|14
  4. In the second line change cutoff=13 to cutoff=14
  5. At the end of the second line change again change 1|13 to 1|14

Once you have completed the update on this template then follow the instructions at {{Snooker season points}}.

See also[edit]

Templates

{{Snooker season points}}

Lists

Snooker world ranking points 2010/2011
Snooker world ranking points 2011/2012
Snooker world ranking points 2012/2013
Snooker world ranking points 2013/2014
Snooker world ranking points 2014/2015
Snooker world ranking points 2015/2016
Snooker world ranking points 2016/2017
Snooker world ranking points 2017/2018
Snooker world ranking points 2018/2019
Snooker world ranking points 2019/2020
Snooker world ranking points 2020/2021
Snooker world ranking points 2021/2022