Template talk:Snooker player points
![]() | This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||
|
This template generates the wikicode for the table entries. It lists the details of each players and then the points from each of the previous two seasons (accounting for the cut-off points, then the points from each tournament for the current season, and then the total points at each cut-off point. This template should only need to be altered if more tournaments are added to the calender or if the number of cut-off points are changed. Tournament parameters should not be removed because this will affect older article that use the template. Also, do not change the default year for "currentseason" — this should be left set to 2010/2011 even for later (or earlier) seasons. This value only affects the 2010/2011 article where the parameter did not originally exist, so it needs to be set automatically in the template; all future articles will set the parameter for their respective year. If tournaments are added to calander it is imperative that a parameter is added for that tournament so it can be passed to the other templates that utilise it.
Further cut-off points
editThe template can accommodate further cut-off points.
In the case of cut-off point 5 the following code would need to be copied into the bottom of the template:
{{#if: {{#titleparts:{{{livepoints|}}}|1|5}}| {{!!}}}} {{#ifexpr: {{#expr:{{{cutoff|0}}}+0}} > 4 | {{#expr: {{#titleparts:{{{livepoints|0}}}|1|5}}+{{{lastseason|0}}}+{{#titleparts:{{Snooker season points |currentseason={{{currentseason|}}} |season={{{season|}}}|cutoff=5 |ao={{{ao|}}} |bc={{{bc|}}} |co={{{co|}}} |gm={{{gm|}}} |gp={{{gp|}}} |nit={{{nit|}}} |sm={{{sm|}}} |uk={{{uk|}}} |wc={{{wc|}}} |weo={{{weo|}}} |woo={{{woo|}}} |ptc1={{{ptc1|}}} |ptc2={{{ptc2|}}} |ptc3={{{ptc3|}}} |ptc4={{{ptc4|}}} |ptc5={{{ptc5|}}} |ptc6={{{ptc6|}}} |ptc7={{{ptc7|0}}} |ptc8={{{ptc8|0}}} |ptc9={{{ptc9|0}}} |ptc10={{{ptc10|0}}} |ptc11={{{ptc11|0}}} |ptc12={{{ptc12|0}}} |eptc1={{{eptc1|}}} |eptc2={{{eptc2|}}} |eptc3={{{eptc3|}}} |eptc4={{{eptc4|}}} |eptc5={{{eptc5|}}} |eptc6={{{eptc6|}}} |ptcgf={{{ptcgf|}}}}}|1|5}} }}}}
To add a cut-off point 6, the same code can be used with a few alterations:
- In the first 'if' line change 1|5 to 1|6
- In the second line change > 4 to > 5 (i.e. one less than the cut-off point)
- In the second line again change 1|5 to 1|6
- In the second line change cutoff=5 to cutoff=6
- At the end of the second line change again change 1|5 to 1|6
Also, the livepoints code below would need a further options added to the switch cases e.g. 5={{#titleparts:{{{livepoints|}}}|1|5}}:
|{{#switch: {{#expr:{{{cutoff|0}}}+0}} |1={{#titleparts:{{{livepoints|}}}|1|1}} |2={{#titleparts:{{{livepoints|}}}|1|2}} |3={{#titleparts:{{{livepoints|}}}|1|3}} |4={{#titleparts:{{{livepoints|}}}|1|4}} |5={{#titleparts:{{{livepoints|}}}|1|5}} |#default={{{livepoints|}}} }}
Flagathlete
editThese pages should really be using {{flagathlete}} rather than flagicon. I've had a short look at the code, and it's a little bit in depth, so I wanted to check if someone who is a bit more inclined for the coding wouldn't mind taking a look at these for me. Happy to take a better look if no one can help. Best Wishes, Lee Vilenski (talk • contribs) 13:52, 15 May 2021 (UTC)