https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ASports_table%2FBadminton_team Modul:Sports table/Badminton team - Versionsgeschichte 2025-04-24T12:05:05Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.44.0-wmf.25 https://de.wikipedia.org/w/index.php?title=Modul:Sports_table/Badminton_team&diff=248769270&oldid=prev Antonsusi am 20. September 2024 um 23:53 Uhr 2024-09-20T23:53:03Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 21. September 2024, 01:53 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 193:</td> <td colspan="2" class="diff-lineno">Zeile 193:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Sub-module usage</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Sub-module usage</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> local mm = require('Module:Math')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local mm = require('Module:<ins style="font-weight: bold; text-decoration: none;">Sports table/</ins>Math')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local yesno = require('Module:Yesno')</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local yesno = require('Module:Yesno')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> </tr> </table> Antonsusi https://de.wikipedia.org/w/index.php?title=Modul:Sports_table/Badminton_team&diff=218567402&oldid=prev Florentyna: AZ: Die Seite wurde neu angelegt: -- Style for football tables local pp = {} function pp.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt) -- Load relevant modules local yesno = require('Module:Yesno') -- Create table header -- Pre stuff local team_width = Args['teamwidth'] or '165' local sort_text = '' local sort_table_val = Args['sortable_table'] or 'no' if yesno(sort_table_val) then sort_… 2021-12-28T13:45:11Z <p><a href="/wiki/Hilfe:Zusammenfassung_und_Quellen#Auto-Zusammenfassung" title="Hilfe:Zusammenfassung und Quellen">AZ</a>: Die Seite wurde neu angelegt: -- Style for football tables local pp = {} function pp.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt) -- Load relevant modules local yesno = require(&#039;Module:Yesno&#039;) -- Create table header -- Pre stuff local team_width = Args[&#039;teamwidth&#039;] or &#039;165&#039; local sort_text = &#039;&#039; local sort_table_val = Args[&#039;sortable_table&#039;] or &#039;no&#039; if yesno(sort_table_val) then sort_…</p> <p><b>Neue Seite</b></p><div>-- Style for football tables<br /> local pp = {}<br /> <br /> function pp.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt)<br /> -- Load relevant modules<br /> local yesno = require(&#039;Module:Yesno&#039;)<br /> <br /> -- Create table header<br /> -- Pre stuff<br /> local team_width = Args[&#039;teamwidth&#039;] or &#039;165&#039;<br /> local sort_text = &#039;&#039;<br /> local sort_table_val = Args[&#039;sortable_table&#039;] or &#039;no&#039;<br /> if yesno(sort_table_val) then sort_text = &#039;sortable&#039; end<br /> table.insert(t,&#039;{|class=&quot;wikitable &#039;..sort_text..&#039;&quot; style=&quot;text-align:center;&quot;\n&#039;) -- Open table<br /> <br /> -- Custom header options<br /> local draw_head_text = Args[&#039;draw_header&#039;] or &#039;&lt;abbr title=&quot;Drawn&quot;&gt;D&lt;/abbr&gt;&#039;<br /> local group_head_text = Args[&#039;group_header&#039;] or &#039;&lt;abbr title=&quot;Group&quot;&gt;Grp&lt;/abbr&gt;&#039;<br /> local team_head_text = Args[&#039;team_header&#039;] or &#039;Team&#039;<br /> local loss_first = Args[&#039;loss_before_draw&#039;] or false<br /> -- What to rank the teams by<br /> local ranking_style = Args[&#039;ranking_style&#039;] or &#039;pts&#039;<br /> local show_points, show_perc = false<br /> ranking_style = string.lower(ranking_style)<br /> if ranking_style==&#039;w&#039; or ranking_style==&#039;win&#039; or ranking_style==&#039;wins&#039; then<br /> -- Based on wins<br /> elseif ranking_style==&#039;perc&#039; or ranking_style==&#039;percentage&#039; or ranking_style==&#039;%&#039; then<br /> -- Based on percentage<br /> show_perc = true<br /> else<br /> -- Based on points<br /> show_points = true<br /> end<br /> <br /> -- Use points instead of goals for/against<br /> local for_against_style = Args[&#039;for_against_style&#039;] or &#039;matches&#039;<br /> local fa_letter, fa_word_sing, fa_word_plur<br /> local hide_for_against = false<br /> -- First convert to lower case if it is a string<br /> for_against_style = string.lower(for_against_style)<br /> if for_against_style==&#039;m&#039; or for_against_style==&#039;match&#039; or for_against_style==&#039;matches&#039; then<br /> fa_letter = &#039;M&#039;<br /> fa_word_sing = &#039;Match&#039;<br /> fa_word_plur = &#039;Matches&#039;<br /> elseif for_against_style==&#039;none&#039; then<br /> hide_for_against = true<br /> else<br /> fa_letter = &#039;M&#039;<br /> fa_word_sing = &#039;Match&#039;<br /> fa_word_plur = &#039;Matches&#039;<br /> end<br /> <br /> -- Whether to use goal ratio (goal average) instead<br /> local use_ratio_val = Args[&#039;use_goal_ratio&#039;] or &#039;no&#039;<br /> local do_ratio = false<br /> -- True if exist, false otherwise<br /> if yesno(use_ratio_val) then do_ratio = true end<br /> <br /> -- Whether to use goal percentage instead<br /> local use_percentage_val = Args[&#039;use_goal_percentage&#039;] or &#039;no&#039;<br /> local do_percentage = false<br /> -- True if exist, false otherwise<br /> if yesno(use_percentage_val) then do_percentage = true end<br /> <br /> -- Use points instead of point for/against<br /> local game_for_against_style = Args[&#039;game_for_against_style&#039;] or &#039;games&#039;<br /> local gfa_letter, gfa_word_sing, gfa_word_plur<br /> local hide_game_for_against = false<br /> -- First convert to lower case if it is a string<br /> for_against_style = string.lower(for_against_style)<br /> if game_for_against_style==&#039;g&#039; or game_for_against_style==&#039;game&#039; or game_for_against_style==&#039;games&#039; then<br /> gfa_letter = &#039;G&#039;<br /> gfa_word_sing = &#039;Game&#039;<br /> gfa_word_plur = &#039;Games&#039;<br /> elseif game_for_against_style==&#039;none&#039; then<br /> hide_game_for_against = true<br /> else<br /> gfa_letter = &#039;G&#039;<br /> gfa_word_sing = &#039;Game&#039;<br /> gfa_word_plur = &#039;Games&#039;<br /> end<br /> <br /> -- Whether to use goal ratio (goal average) instead<br /> local use_ratio_val = Args[&#039;use_goal_ratio&#039;] or &#039;no&#039;<br /> local do_ratio = false<br /> -- True if exist, false otherwise<br /> if yesno(use_ratio_val) then do_ratio = true end<br /> <br /> -- Whether to use goal percentage instead<br /> local use_percentage_val = Args[&#039;use_goal_percentage&#039;] or &#039;no&#039;<br /> local do_percentage = false<br /> -- True if exist, false otherwise<br /> if yesno(use_percentage_val) then do_percentage = true end<br /> <br /> -- Use points instead of point for/against<br /> local point_for_against_style = Args[&#039;point_for_against_style&#039;] or &#039;points&#039;<br /> local pfa_letter, pfa_word_sing, pfa_word_plur<br /> local hide_point_for_against = false<br /> -- First convert to lower case if it is a string<br /> for_against_style = string.lower(for_against_style)<br /> if point_for_against_style==&#039;p&#039; or point_for_against_style==&#039;match&#039; or point_for_against_style==&#039;points&#039; then<br /> pfa_letter = &#039;P&#039;<br /> pfa_word_sing = &#039;Point&#039;<br /> pfa_word_plur = &#039;Points&#039;<br /> elseif point_for_against_style==&#039;none&#039; then<br /> hide_point_for_against = true<br /> else<br /> pfa_letter = &#039;P&#039;<br /> pfa_word_sing = &#039;Point&#039;<br /> pfa_word_plur = &#039;Points&#039;<br /> end<br /> -- Whether to use goal ratio (goal average) instead<br /> local use_ratio_val = Args[&#039;use_goal_ratio&#039;] or &#039;no&#039;<br /> local do_ratio = false<br /> -- True if exist, false otherwise<br /> if yesno(use_ratio_val) then do_ratio = true end<br /> <br /> -- Whether to use goal percentage instead<br /> local use_percentage_val = Args[&#039;use_goal_percentage&#039;] or &#039;no&#039;<br /> local do_percentage = false<br /> -- True if exist, false otherwise<br /> if yesno(use_percentage_val) then do_percentage = true end<br /> <br /> -- Initialize<br /> local tt = {}<br /> tt.count = 0 -- Up by one after every call<br /> tt.tab_text = t -- Actual text<br /> -- Actual headers<br /> tt = p_sub.colhead(tt,20,pos_label) -- Position col<br /> -- Add group header<br /> if full_table and group_col then<br /> tt = p_sub.colhead(tt,20,group_head_text) -- Group col<br /> end<br /> tt = p_sub.colhead(tt,team_width,team_head_text..VTE_text) -- Team col<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;Played&quot;&gt;Pld&lt;/abbr&gt;&#039;) -- Matches played col<br /> if full_table then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;Won&quot;&gt;W&lt;/abbr&gt;&#039;) -- Win col<br /> if loss_first then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;Lost&quot;&gt;L&lt;/abbr&gt;&#039;) -- Loss col<br /> else<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;Lost&quot;&gt;L&lt;/abbr&gt;&#039;) -- Loss col<br /> end<br /> if not hide_for_against then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..fa_word_plur..&#039; for&quot;&gt;&#039;..fa_letter..&#039;F&lt;/abbr&gt;&#039;) -- For col<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..fa_word_plur..&#039; against&quot;&gt;&#039;..fa_letter..&#039;A&lt;/abbr&gt;&#039;) -- Against col<br /> if do_ratio then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..fa_word_sing..&#039; ratio&quot;&gt;&#039;..fa_letter..&#039;R&lt;/abbr&gt;&#039;) -- Ratio col<br /> elseif do_percentage then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..fa_word_sing..&#039; percentage&quot;&gt;%&lt;/abbr&gt;&#039;) -- Percentage col<br /> else<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..fa_word_sing..&#039; difference&quot;&gt;&#039;..fa_letter..&#039;D&lt;/abbr&gt;&#039;) -- Difference col<br /> end<br /> if not hide_game_for_against then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..gfa_word_plur..&#039; for&quot;&gt;&#039;..gfa_letter..&#039;F&lt;/abbr&gt;&#039;) -- For col<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..gfa_word_plur..&#039; against&quot;&gt;&#039;..gfa_letter..&#039;A&lt;/abbr&gt;&#039;) -- Against col<br /> if do_ratio then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..gfa_word_sing..&#039; ratio&quot;&gt;&#039;..gfa_letter..&#039;R&lt;/abbr&gt;&#039;) -- Ratio col<br /> elseif do_percentage then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..gfa_word_sing..&#039; percentage&quot;&gt;%&lt;/abbr&gt;&#039;) -- Percentage col<br /> else<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..gfa_word_sing..&#039; difference&quot;&gt;&#039;..gfa_letter..&#039;D&lt;/abbr&gt;&#039;) -- Difference col<br /> end<br /> <br /> if not hide_point_for_against then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..pfa_word_plur..&#039; for&quot;&gt;&#039;..pfa_letter..&#039;F&lt;/abbr&gt;&#039;) -- For col<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..pfa_word_plur..&#039; against&quot;&gt;&#039;..pfa_letter..&#039;A&lt;/abbr&gt;&#039;) -- Against col<br /> if do_ratio then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..pfa_word_sing..&#039; ratio&quot;&gt;&#039;..pfa_letter..&#039;R&lt;/abbr&gt;&#039;) -- Ratio col<br /> elseif do_percentage then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..pfa_word_sing..&#039; percentage&quot;&gt;%&lt;/abbr&gt;&#039;) -- Percentage col<br /> else<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;&#039;..pfa_word_sing..&#039; difference&quot;&gt;&#039;..pfa_letter..&#039;D&lt;/abbr&gt;&#039;) -- Difference col<br /> end<br /> end<br /> end<br /> end<br /> end<br /> if show_points then<br /> tt = p_sub.colhead(tt,20,&#039;&lt;abbr title=&quot;Points&quot;&gt;Pts&lt;/abbr&gt;&#039;) -- Points col<br /> elseif show_perc then<br /> tt = p_sub.colhead(tt,36,&#039;&lt;abbr title=&quot;Win percentage&quot;&gt;PCT&lt;/abbr&gt;&#039;) -- Win percentage col<br /> end<br /> if full_table then<br /> tt.count = tt.count+1<br /> table.insert(tt.tab_text,results_header_txt)<br /> end<br /> <br /> return tt<br /> end<br /> <br /> function pp.row(frame,t,Args,p_sub,notes_exist,hth_id_list,full_table,rand_val,team_list,team_code_ii,ii_start,ii_end,ii_fw,bg_col,N_teams,ii,ii_show)<br /> -- Build the inner parts of individual rows<br /> <br /> -- Sub-module usage<br /> local mm = require(&#039;Module:Math&#039;)<br /> local yesno = require(&#039;Module:Yesno&#039;)<br /> <br /> -- Get custom/default options for in table<br /> local win_points = tonumber(Args[&#039;winpoints&#039;]) or 1<br /> local loss_points = tonumber(Args[&#039;losspoints&#039;]) or 0<br /> <br /> -- Order of draws and losses --<br /> local loss_first = Args[&#039;loss_before_draw&#039;] or false <br /> <br /> -- Get some input<br /> local wins = tonumber(Args[&#039;win_&#039;..team_code_ii]) or 0<br /> local losses = tonumber(Args[&#039;loss_&#039;..team_code_ii]) or 0<br /> local mfor = tonumber(Args[&#039;mf_&#039;..team_code_ii]) or tonumber(Args[&#039;mf_&#039;..team_code_ii]) or 0<br /> local maig = tonumber(Args[&#039;ma_&#039;..team_code_ii]) or tonumber(Args[&#039;ma_&#039;..team_code_ii]) or 0<br /> local gfor = tonumber(Args[&#039;gf_&#039;..team_code_ii]) or tonumber(Args[&#039;gf_&#039;..team_code_ii]) or 0<br /> local gaig = tonumber(Args[&#039;ga_&#039;..team_code_ii]) or tonumber(Args[&#039;ga_&#039;..team_code_ii]) or 0<br /> local pfor = tonumber(Args[&#039;pf_&#039;..team_code_ii]) or tonumber(Args[&#039;pf_&#039;..team_code_ii]) or 0<br /> local paig = tonumber(Args[&#039;pa_&#039;..team_code_ii]) or tonumber(Args[&#039;pa_&#039;..team_code_ii]) or 0<br /> local s_pts = tonumber(Args[&#039;adjust_points_&#039;..team_code_ii]) or tonumber(Args[&#039;startpoints_&#039;..team_code_ii]) or 0<br /> local hth_local = Args[&#039;hth_&#039;..team_code_ii] or nil<br /> -- Then calculate some values<br /> local matches = wins + losses<br /> local points = win_points*wins + loss_points*losses + s_pts<br /> <br /> local win_perc = &#039;&#039;<br /> if matches == 0 then <br /> -- Escape for zero matches<br /> win_perc = &#039;&amp;mdash;&#039; <br /> else<br /> --Some sports use draw as well<br /> win_perc = mm._precision_format((2*wins) / (2*matches), 3)<br /> if losses &gt; 0 then<br /> -- Drop the leading zero (from the string)<br /> win_perc = string.sub(win_perc,2,string.len(win_perc))<br /> end<br /> end<br /> <br /> -- Show for/against<br /> local for_against_style = Args[&#039;for_against_style&#039;] or &#039;goals&#039;<br /> local hide_for_against = false<br /> for_against_style = string.lower(for_against_style)<br /> if for_against_style==&#039;none&#039; then<br /> hide_for_against = true<br /> end<br /> <br /> -- Comparison of for against<br /> local mcomp<br /> -- Whether to use goal ratio (goal average) or goal percentage instead<br /> local use_ratio_val = Args[&#039;use_goal_ratio&#039;] or &#039;no&#039;<br /> local use_percentage_val = Args[&#039;use_goal_percentage&#039;] or &#039;no&#039;<br /> local skip_sign<br /> if yesno(use_ratio_val) then<br /> -- Now it is the goal ratio/goal average<br /> if maig == 0 then<br /> mcomp = &#039;&amp;mdash;&#039;<br /> else<br /> mcomp = mm._precision_format(gfor / gaig, 3)<br /> end<br /> elseif yesno(use_percentage_val) then<br /> -- Now it is the percentage<br /> if maig == 0 then<br /> mcomp = &#039;&amp;mdash;&#039;<br /> else<br /> mcomp = mm._precision_format(100 * gfor / gaig , 1)<br /> end<br /> else<br /> -- It&#039;s match difference<br /> mcomp = mfor - maig<br /> -- Formatting with signs<br /> if mcomp&gt;0 then<br /> mcomp=&#039;+&#039;..mcomp<br /> elseif mcomp &lt; 0 then<br /> mcomp=&#039;&amp;minus;&#039;..-mcomp<br /> end<br /> end<br /> <br /> local gcomp<br /> -- Whether to use goal ratio (goal average) or goal percentage instead<br /> local use_ratio_val = Args[&#039;use_goal_ratio&#039;] or &#039;no&#039;<br /> local use_percentage_val = Args[&#039;use_goal_percentage&#039;] or &#039;no&#039;<br /> local skip_sign<br /> if yesno(use_ratio_val) then<br /> -- Now it is the goal ratio/goal average<br /> if gaig == 0 then<br /> gcomp = &#039;&amp;mdash;&#039;<br /> else<br /> gcomp = mm._precision_format(gfor / gaig, 3)<br /> end<br /> elseif yesno(use_percentage_val) then<br /> -- Now it is the percentage<br /> if gaig == 0 then<br /> gcomp = &#039;&amp;mdash;&#039;<br /> else<br /> gcomp = mm._precision_format(100 * gfor / gaig , 1)<br /> end<br /> else<br /> -- It&#039;s match difference<br /> gcomp = gfor - gaig<br /> -- Formatting with signs<br /> if gcomp&gt;0 then<br /> gcomp=&#039;+&#039;..gcomp<br /> elseif gcomp &lt; 0 then<br /> gcomp=&#039;&amp;minus;&#039;..-gcomp<br /> end<br /> end<br /> <br /> local pcomp<br /> -- Whether to use goal ratio (goal average) or goal percentage instead<br /> local use_ratio_val = Args[&#039;use_goal_ratio&#039;] or &#039;no&#039;<br /> local use_percentage_val = Args[&#039;use_goal_percentage&#039;] or &#039;no&#039;<br /> local skip_sign<br /> if yesno(use_ratio_val) then<br /> -- Now it is the goal ratio/goal average<br /> if paig == 0 then<br /> pcomp = &#039;&amp;mdash;&#039;<br /> else<br /> pcomp = mm._precision_format(gfor / gaig, 3)<br /> end<br /> elseif yesno(use_percentage_val) then<br /> -- Now it is the percentage<br /> if paig == 0 then<br /> pcomp = &#039;&amp;mdash;&#039;<br /> else<br /> pcomp = mm._precision_format(100 * gfor / gaig , 1)<br /> end<br /> else<br /> -- It&#039;s match difference<br /> pcomp = pfor - paig<br /> -- Formatting with signs<br /> if pcomp&gt;0 then<br /> pcomp=&#039;+&#039;..pcomp<br /> elseif pcomp &lt; 0 then<br /> pcomp=&#039;&amp;minus;&#039;..-pcomp<br /> end<br /> end<br /> -- Some local vars <br /> local hth_string<br /> local tt_return = p_sub.hth(frame,Args,full_table,hth_id_list,hth_local,notes_exist,team_list,team_code_ii,ii_start,ii_end,rand_val)<br /> hth_string = tt_return.str<br /> hth_id_list = tt_return.list<br /> notes_exist = tt_return.notes_exist<br /> <br /> -- What to rank the teams by<br /> local ranking_style = Args[&#039;ranking_style&#039;] or &#039;pts&#039;<br /> local rank_points, rank_perc = false<br /> local win_fw, win_string<br /> ranking_style = string.lower(ranking_style)<br /> if ranking_style==&#039;w&#039; or ranking_style==&#039;win&#039; or ranking_style==&#039;wins&#039; then<br /> -- Based on wins<br /> win_fw = &#039;font-weight: bold;&#039;<br /> win_string = hth_string<br /> elseif ranking_style==&#039;perc&#039; or ranking_style==&#039;percentage&#039; or ranking_style==&#039;%&#039; then<br /> -- Based on percentage<br /> rank_perc = true<br /> win_fw=ii_fw<br /> win_string = &#039;&#039;<br /> else<br /> -- Based on points<br /> rank_points = true<br /> win_fw=ii_fw<br /> win_string = &#039;&#039;<br /> end<br /> <br /> -- Row building<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..matches..&#039;\n&#039;) -- Played<br /> if full_table then<br /> table.insert(t,&#039;| style=&quot;&#039;..win_fw..bg_col..&#039;&quot; |&#039;..wins..win_string..&#039;\n&#039;) -- Won<br /> <br /> if loss_first then<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..losses..&#039;\n&#039;) -- Lost<br /> else<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..losses..&#039;\n&#039;) -- Lost<br /> end<br /> <br /> if not hide_for_against then<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..mfor..&#039;\n&#039;) -- MF<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..maig..&#039;\n&#039;) -- MA<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..mcomp..&#039;\n&#039;) -- Match comparison<br /> if Args[&#039;game_for_against_style&#039;] ~= &#039;none&#039; then <br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..gfor..&#039;\n&#039;) -- GF<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..gaig..&#039;\n&#039;) -- GA<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..gcomp..&#039;\n&#039;) -- Game comparison<br /> <br /> if Args[&#039;point_for_against_style&#039;] ~= &#039;none&#039; then -- game param hides games and points in header<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..pfor..&#039;\n&#039;) -- PF<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..paig..&#039;\n&#039;) -- PA<br /> table.insert(t,&#039;| style=&quot;&#039;..ii_fw..bg_col..&#039;&quot; |&#039;..pcomp..&#039;\n&#039;) -- Point comparison<br /> end<br /> end<br /> end<br /> <br /> end<br /> if rank_points then<br /> -- Add &amp;minus; for negative point totals<br /> if points&lt;0 then<br /> table.insert(t,&#039;| style=&quot;font-weight: bold;&#039;..bg_col..&#039;&quot; | &amp;minus;&#039;..-points..hth_string..&#039;\n&#039;)<br /> else<br /> table.insert(t,&#039;| style=&quot;font-weight: bold;&#039;..bg_col..&#039;&quot; | &#039;..points..hth_string..&#039;\n&#039;)<br /> end<br /> elseif rank_perc then<br /> table.insert(t,&#039;| style=&quot;font-weight: bold;&#039;..bg_col..&#039;&quot; | &#039;..win_perc..hth_string..&#039;\n&#039;)<br /> end<br /> return {t=t, notes_exist=notes_exist, hth_id_list=hth_id_list}<br /> end<br /> <br /> function pp.status(Args)<br /> -- Declare status options<br /> -- ------------------------------------------------------------<br /> -- NOTE: If you add to status_code, also add to status_called and status_letters!!<br /> -- Or functionality will be compromised<br /> -- ------------------------------------------------------------<br /> local status_code, status_called = {}<br /> status_code = { A=&#039;Advance to a further round&#039;, C=&#039;Champion&#039;, D=&#039;Disqualified&#039;, <br /> E=&#039;Eliminated&#039;, G=&#039;Guest&#039;, H=&#039;Host&#039;, O=&#039;Play-off winner&#039;, P=&#039;Promoted&#039;, Q=&#039;Qualified to the phase indicated&#039;,<br /> R=&#039;Relegated&#039;, T=&#039;Qualified, but not yet to the particular phase indicated&#039;,<br /> X=&#039;?&#039;, Y=&#039;?&#039;, Z=&#039;?&#039;}<br /> status_called = { A=false, C=false, D=false, E=false, G=false, H=false, O=false, P=false,<br /> Q=false, R=false, T=false, X=false, Y=false, Z=false}<br /> local status_letters = &#039;ACDEGHOPQRTXYZ&#039;<br /> <br /> -- Status position (before or after read and default)<br /> local stat_pos_val = Args[&#039;status_pos&#039;] or &#039;&#039;<br /> local status_position = &#039;after&#039; -- Default location<br /> stat_pos_val = string.lower(stat_pos_val)<br /> if stat_pos_val==&#039;before&#039; then<br /> status_position = &#039;before&#039;<br /> elseif stat_pos_val==&#039;after&#039; then<br /> status_position = &#039;after&#039;<br /> end<br /> <br /> -- Read in custom status options<br /> if Args[&#039;status_text_X&#039;] then status_code.X = Args[&#039;status_text_X&#039;] end<br /> if Args[&#039;status_text_Y&#039;] then status_code.Y = Args[&#039;status_text_Y&#039;] end<br /> if Args[&#039;status_text_Z&#039;] then status_code.Z = Args[&#039;status_text_Z&#039;] end<br /> <br /> return {code=status_code, called=status_called, letters=status_letters, position=status_position}<br /> end<br /> <br /> return pp</div> Florentyna