SportsPress – Sports Club & League Manager - Version 2.2.11

Version Description

  • Fix - Timeout issue when tiebreaker checks for head-to-head standings.
  • Fix - Check for REST API controllers to prevent errors when using Jetpack.
Download this release

Release Info

Developer brianmiyaji
Plugin Icon 128x128 SportsPress – Sports Club & League Manager
Version 2.2.11
Comparing to
See all releases

Code changes from version 2.1.7 to 2.2.11

Files changed (96) hide show
  1. assets/css/admin.css +19 -0
  2. assets/css/icons.css +3 -0
  3. assets/css/menu.css +23 -18
  4. assets/css/sportspress-rtl.css +0 -1
  5. assets/css/sportspress-style-ltr.css +29 -0
  6. assets/css/sportspress-style-rtl.css +29 -0
  7. assets/css/sportspress-style.css +673 -0
  8. assets/css/sportspress.css +50 -11
  9. assets/fonts/sportspress.eot +0 -0
  10. assets/fonts/sportspress.svg +5 -3
  11. assets/fonts/sportspress.ttf +0 -0
  12. assets/fonts/sportspress.woff +0 -0
  13. assets/fonts/sportspress.woff2 +0 -0
  14. assets/images/flags/gib.png +0 -0
  15. assets/images/modules/rookie.png +0 -0
  16. assets/images/welcome/rookie.png +0 -0
  17. assets/js/admin/colorpicker.js +26 -0
  18. assets/js/admin/quickeditor.js +79 -0
  19. assets/js/admin/sportspress-admin.js +39 -13
  20. assets/js/sportspress.js +16 -16
  21. changelog.txt +148 -0
  22. dummy-data/events-sample.csv +1 -1
  23. includes/admin/class-sp-admin-assets.php +15 -1
  24. includes/admin/class-sp-admin-settings.php +4 -2
  25. includes/admin/class-sp-admin-sports.php +3 -1
  26. includes/admin/class-sp-admin-welcome.php +84 -35
  27. includes/admin/class-sp-admin.php +3 -3
  28. includes/admin/post-types/class-sp-admin-cpt-player.php +178 -3
  29. includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php +82 -0
  30. includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php +124 -88
  31. includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php +2 -2
  32. includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php +2 -2
  33. includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +30 -13
  34. includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php +8 -1
  35. includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php +12 -1
  36. includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php +42 -6
  37. includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php +54 -18
  38. includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php +13 -1
  39. includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php +2 -1
  40. includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php +4 -4
  41. includes/admin/settings/class-sp-settings-events.php +4 -4
  42. includes/admin/settings/class-sp-settings-general.php +8 -7
  43. includes/admin/settings/class-sp-settings-modules.php +8 -25
  44. includes/admin/settings/class-sp-settings-players.php +29 -9
  45. includes/admin/views/html-admin-config.php +13 -21
  46. includes/api/class-sp-rest-api.php +4 -13
  47. includes/api/class-sp-rest-posts-controller.php +6 -60
  48. includes/api/class-sp-rest-terms-controller.php +10 -0
  49. includes/class-sp-calendar.php +2 -2
  50. includes/class-sp-countries.php +3 -1
  51. includes/class-sp-event.php +198 -25
  52. includes/class-sp-frontend-scripts.php +2 -2
  53. includes/class-sp-install.php +14 -1
  54. includes/class-sp-league-table.php +237 -66
  55. includes/class-sp-modules.php +29 -15
  56. includes/class-sp-player-list.php +152 -39
  57. includes/class-sp-player.php +124 -47
  58. includes/class-sp-post-types.php +6 -6
  59. includes/class-sp-team.php +7 -1
  60. includes/class-sp-templates.php +2 -2
  61. includes/libraries/class-eqeos.php +8 -14
  62. includes/sp-api-functions.php +14 -1
  63. includes/sp-core-functions.php +20 -12
  64. includes/sp-template-functions.php +15 -1
  65. includes/sp-template-hooks.php +15 -7
  66. includes/widgets/class-sp-widget-event-list.php +25 -7
  67. license.txt +1 -1
  68. modules/sportspress-admin-bar.php +4 -4
  69. modules/sportspress-birthdays.php +0 -1
  70. modules/sportspress-bulk-actions.php +107 -0
  71. modules/sportspress-calendars.php +52 -3
  72. modules/sportspress-icons.php +7 -7
  73. modules/sportspress-league-tables.php +27 -23
  74. modules/sportspress-style.php +162 -0
  75. presets/team-sports/soccer.json +7 -6
  76. readme.txt +122 -17
  77. sportspress.php +17 -7
  78. templates/countdown.php +4 -4
  79. templates/event-blocks.php +3 -3
  80. templates/event-calendar.php +6 -6
  81. templates/event-fixtures-results.php +25 -5
  82. templates/event-list.php +72 -44
  83. templates/event-logos-block.php +4 -3
  84. templates/event-logos-inline.php +2 -2
  85. templates/event-logos.php +3 -3
  86. templates/event-performance-table-combined.php +5 -4
  87. templates/event-performance-table.php +56 -52
  88. templates/event-performance.php +16 -8
  89. templates/event-results.php +2 -2
  90. templates/player-events.php +21 -0
  91. templates/player-gallery-thumbnail.php +3 -3
  92. templates/player-gallery.php +22 -6
  93. templates/player-list.php +46 -35
  94. templates/player-statistics.php +10 -7
  95. templates/team-events.php +3 -1
  96. wpml-config.xml +1 -0
assets/css/admin.css CHANGED
@@ -244,6 +244,22 @@
244
  clear: both;
245
  }
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  table.widefat.sp-data-table img {
248
  vertical-align: top;
249
  }
@@ -964,6 +980,9 @@ table.sp-status-table td mark.yes {
964
  .about-sportspress-wrap .sp-welcome-logo {
965
  display: inline;
966
  }
 
 
 
967
  .about-sportspress-wrap .sp-about-text {
968
  min-height: 0;
969
  margin-right: 165px;
244
  clear: both;
245
  }
246
 
247
+ .sp-data-table-container {
248
+ overflow-x: scroll;
249
+ }
250
+
251
+ .sp-data-table-container::-webkit-scrollbar {
252
+ height:12px;
253
+ }
254
+ .sp-data-table-container::-webkit-scrollbar-track {
255
+ box-shadow:0 0 2px rgba(0,0,0,0.15) inset;
256
+ background:#f0f0f0;
257
+ }
258
+ .sp-data-table-container::-webkit-scrollbar-thumb {
259
+ border-radius:6px;
260
+ background:#ccc;
261
+ }
262
+
263
  table.widefat.sp-data-table img {
264
  vertical-align: top;
265
  }
980
  .about-sportspress-wrap .sp-welcome-logo {
981
  display: inline;
982
  }
983
+ .about-sportspress-wrap .sp-welcome-logo img {
984
+ border: none;
985
+ }
986
  .about-sportspress-wrap .sp-about-text {
987
  min-height: 0;
988
  margin-right: 165px;
assets/css/icons.css CHANGED
@@ -47,4 +47,7 @@
47
  }
48
  .sp-icon-card:before {
49
  content: "\e801";
 
 
 
50
  }
47
  }
48
  .sp-icon-card:before {
49
  content: "\e801";
50
+ }
51
+ .sp-icon-sub:before {
52
+ content: "\f503";
53
  }
assets/css/menu.css CHANGED
@@ -1,12 +1,12 @@
1
  /* SportsPress menu styles */
2
  @font-face {
3
  font-family: 'sportspress';
4
- src:url('../fonts/sportspress.eot?med5x8');
5
- src:url('../fonts/sportspress.eot?#iefixmed5x8') format('embedded-opentype'),
6
- url('../fonts/sportspress.woff2?med5x8') format('woff2'),
7
- url('../fonts/sportspress.ttf?med5x8') format('truetype'),
8
- url('../fonts/sportspress.woff?med5x8') format('woff'),
9
- url('../fonts/sportspress.svg?med5x8#sportspress') format('svg');
10
  font-weight: normal;
11
  font-style: normal;
12
  }
@@ -30,9 +30,6 @@
30
  -moz-osx-font-smoothing: grayscale;
31
  }
32
 
33
- .sp-icon-api:before {
34
- content: "\f237";
35
- }
36
  .sp-icon-archive:before {
37
  content: "\f322";
38
  }
@@ -106,6 +103,9 @@
106
  .sp-icon-menu:before {
107
  content: "\f116";
108
  }
 
 
 
109
  .sp-icon-popup:before {
110
  content: "\f504";
111
  }
@@ -127,6 +127,9 @@
127
  .sp-icon-time:before {
128
  content: "\f469";
129
  }
 
 
 
130
  .sp-icon-ticket:before {
131
  content: "\f524";
132
  }
@@ -149,8 +152,10 @@
149
  .sp-icon-key:before {
150
  content: "\f112";
151
  }
152
- .sp-icon-moon:before {
153
- content: "\f503";
 
 
154
  }
155
  .sp-icon-baseball:before {
156
  content: "\e701";
@@ -158,20 +163,20 @@
158
  .sp-icon-basketball:before {
159
  content: "\e602";
160
  }
161
- .sp-icon-golfball:before {
162
- content: "\e603";
163
- }
164
  .sp-icon-cricketball:before {
165
  content: "\e604";
166
  }
167
- .sp-icon-soccerball:before {
168
- content: "\e700";
169
  }
170
  .sp-icon-shoe:before {
171
  content: "\e800";
172
  }
173
- .sp-icon-card:before {
174
- content: "\e801";
 
 
 
175
  }
176
 
177
  #adminmenu #toplevel_page_sportspress .toplevel_page_sportspress div.wp-menu-image:before,
1
  /* SportsPress menu styles */
2
  @font-face {
3
  font-family: 'sportspress';
4
+ src:url('../fonts/sportspress.eot?jvf2la');
5
+ src:url('../fonts/sportspress.eot?#iefixjvf2la') format('embedded-opentype'),
6
+ url('../fonts/sportspress.woff2?jvf2la') format('woff2'),
7
+ url('../fonts/sportspress.ttf?jvf2la') format('truetype'),
8
+ url('../fonts/sportspress.woff?jvf2la') format('woff'),
9
+ url('../fonts/sportspress.svg?jvf2la#sportspress') format('svg');
10
  font-weight: normal;
11
  font-style: normal;
12
  }
30
  -moz-osx-font-smoothing: grayscale;
31
  }
32
 
 
 
 
33
  .sp-icon-archive:before {
34
  content: "\f322";
35
  }
103
  .sp-icon-menu:before {
104
  content: "\f116";
105
  }
106
+ .sp-icon-minimal:before {
107
+ content: "\f237";
108
+ }
109
  .sp-icon-popup:before {
110
  content: "\f504";
111
  }
127
  .sp-icon-time:before {
128
  content: "\f469";
129
  }
130
+ .sp-icon-timeline:before {
131
+ content: "\f203";
132
+ }
133
  .sp-icon-ticket:before {
134
  content: "\f524";
135
  }
152
  .sp-icon-key:before {
153
  content: "\f112";
154
  }
155
+
156
+ /* Performance Icons */
157
+ .sp-icon-card:before {
158
+ content: "\e801";
159
  }
160
  .sp-icon-baseball:before {
161
  content: "\e701";
163
  .sp-icon-basketball:before {
164
  content: "\e602";
165
  }
 
 
 
166
  .sp-icon-cricketball:before {
167
  content: "\e604";
168
  }
169
+ .sp-icon-golfball:before {
170
+ content: "\e603";
171
  }
172
  .sp-icon-shoe:before {
173
  content: "\e800";
174
  }
175
+ .sp-icon-soccerball:before {
176
+ content: "\e700";
177
+ }
178
+ .sp-icon-sub:before {
179
+ content: "\f503";
180
  }
181
 
182
  #adminmenu #toplevel_page_sportspress .toplevel_page_sportspress div.wp-menu-image:before,
assets/css/sportspress-rtl.css CHANGED
@@ -36,7 +36,6 @@
36
  .sp-player-list .data-name .player-flag {
37
  margin-right: 0;
38
  margin-left: 0.5em;
39
- float: right;
40
  }
41
 
42
  /* Event Calendar */
36
  .sp-player-list .data-name .player-flag {
37
  margin-right: 0;
38
  margin-left: 0.5em;
 
39
  }
40
 
41
  /* Event Calendar */
assets/css/sportspress-style-ltr.css ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* SportsPress Templates LTR */
2
+
3
+ /*
4
+ * Note: !important everything to enforce overrides.
5
+ * This stylesheet can be disabled via SportsPress General Settings.
6
+ */
7
+
8
+ .sp-tournament-bracket .sp-team .sp-team-name:before {
9
+ border-left-color: #e5e5e5 !important;
10
+ border-right-color: #e5e5e5 !important;
11
+ left: -10px !important;
12
+ }
13
+
14
+ .sp-tournament-bracket .sp-team-flip .sp-team-name:before {
15
+ left: auto !important;
16
+ right: -10px !important;
17
+ }
18
+
19
+ .sp-tournament-bracket .sp-team.sp-first-round .sp-team-name {
20
+ margin-left: -1px !important;
21
+ }
22
+
23
+ .sp-tournament-bracket .sp-team.sp-last-round .sp-team-name {
24
+ margin-right: -1px !important;
25
+ }
26
+
27
+ .sp-template-event-performance-icons .sp-performance-icons {
28
+ text-align: right !important;
29
+ }
assets/css/sportspress-style-rtl.css ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* SportsPress Templates RTL */
2
+
3
+ /*
4
+ * Note: !important everything to enforce overrides.
5
+ * This stylesheet can be disabled via SportsPress General Settings.
6
+ */
7
+
8
+ .sp-tournament-bracket .sp-team .sp-team-name:before {
9
+ border-right-color: #e5e5e5 !important;
10
+ border-left-color: #e5e5e5 !important;
11
+ right: -10px !important;
12
+ }
13
+
14
+ .sp-tournament-bracket .sp-team-flip .sp-team-name:before {
15
+ right: auto !important;
16
+ left: -10px !important;
17
+ }
18
+
19
+ .sp-tournament-bracket .sp-team.sp-first-round .sp-team-name {
20
+ margin-right: -1px !important;
21
+ }
22
+
23
+ .sp-tournament-bracket .sp-team.sp-last-round .sp-team-name {
24
+ margin-left: -1px !important;
25
+ }
26
+
27
+ .sp-template-event-performance-icons .sp-performance-icons {
28
+ text-align: left !important;
29
+ }
assets/css/sportspress-style.css ADDED
@@ -0,0 +1,673 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* SportsPress Templates */
2
+
3
+ .sp-template,
4
+ .sp-data-table,
5
+ .sp-table-caption {
6
+ font-family: "Roboto", "Helvetica", sans-serif;
7
+ }
8
+
9
+ .sp-template {
10
+ clear: both;
11
+ overflow: hidden;
12
+ }
13
+
14
+ /*
15
+ * Note: !important everything below to enforce overrides.
16
+ * This stylesheet can be disabled via SportsPress General Settings.
17
+ */
18
+
19
+ .sp-template h1,
20
+ .sp-template h2,
21
+ .sp-template h3,
22
+ .sp-template h4,
23
+ .sp-template h5,
24
+ .sp-template h6,
25
+ .sp-data-table h1,
26
+ .sp-data-table h2,
27
+ .sp-data-table h3,
28
+ .sp-data-table h4,
29
+ .sp-data-table h5,
30
+ .sp-data-table h6,
31
+ .sp-table-caption h1,
32
+ .sp-table-caption h2,
33
+ .sp-table-caption h3,
34
+ .sp-table-caption h4,
35
+ .sp-table-caption h5,
36
+ .sp-table-caption h6 {
37
+ font-family: "Roboto", "Helvetica", sans-serif !important;
38
+ }
39
+
40
+ .sp-template {
41
+ margin-bottom: 20px !important;
42
+ }
43
+
44
+ .sp-template *,
45
+ .sp-data-table *,
46
+ .sp-table-caption {
47
+ box-sizing: border-box !important;
48
+ font-weight: 400 !important;
49
+ text-transform: none !important;
50
+ letter-spacing: normal !important;
51
+ color: #333 !important;
52
+ }
53
+
54
+ .sp-table-caption {
55
+ margin: 0 !important;
56
+ padding: 15px !important;
57
+ background: #fff !important;
58
+ border: 1px solid #e5e5e5 !important;
59
+ border-bottom: none !important;
60
+ font-size: 20px !important;
61
+ font-weight: 400 !important;
62
+ line-height: 1.5 !important;
63
+ display: table !important;
64
+ width: 100% !important;
65
+ }
66
+
67
+ /* Links */
68
+
69
+ .sp-template a,
70
+ .sp-data-table a {
71
+ box-shadow: none !important;
72
+ border: none !important;
73
+ text-decoration: none !important;
74
+ font-weight: inherit !important;
75
+ color: #00a69c !important;
76
+ }
77
+
78
+ .sp-template a:hover,
79
+ .sp-data-table a:hover {
80
+ text-decoration: underline !important;
81
+ }
82
+
83
+ .sp-template a:hover .dashicons,
84
+ .sp-template a:hover [class^="sp-icon-"], [class*=" sp-icon-"],
85
+ .sp-data-table a:hover .dashicons,
86
+ .sp-data-table a:hover [class^="sp-icon-"], [class*=" sp-icon-"] {
87
+ text-decoration: none !important;
88
+ }
89
+
90
+ .sp-view-all-link {
91
+ padding: 10px 15px !important;
92
+ margin: 0 !important;
93
+ background: #fff !important;
94
+ border: 1px solid #e5e5e5 !important;
95
+ border-top: none !important;
96
+ overflow: hidden !important;
97
+ display: table !important;
98
+ width: 100% !important;
99
+ text-align: right !important;
100
+ }
101
+
102
+ .sp-view-all-link a {
103
+ font-size: 12px !important;
104
+ font-weight: 400 !important;
105
+ line-height: 1.5 !important;
106
+ text-decoration: none !important;
107
+ color: rgba(51,51,51,0.5) !important;
108
+ }
109
+
110
+ .sp-view-all-link a:hover {
111
+ color: #333 !important;
112
+ text-decoration: none !important;
113
+ }
114
+
115
+ .sp-form-events a:hover {
116
+ color: #fff !important;
117
+ text-decoration: none !important;
118
+ }
119
+
120
+ /* Images */
121
+
122
+ .sp-template img {
123
+ display: inline-block !important;
124
+ box-shadow: none !important;
125
+ }
126
+
127
+ /* Tables */
128
+
129
+ .sp-data-table {
130
+ margin: 0 !important;
131
+ background: #fff !important;
132
+ border-collapse: collapse !important;
133
+ border: 1px solid #e5e5e5 !important;
134
+ width: 100% !important;
135
+ }
136
+
137
+ .sp-data-table tr {
138
+ border: none !important;
139
+ }
140
+
141
+ .sp-data-table th,
142
+ .sp-data-table td {
143
+ font-size: 13px !important;
144
+ font-weight: 400 !important;
145
+ line-height: 1.5 !important;
146
+ border: 1px solid #e5e5e5 !important;
147
+ padding: 5px 10px !important;
148
+ text-align: center !important;
149
+ }
150
+
151
+ .sp-data-table th {
152
+ font-size: 12px !important;
153
+ font-weight: 500 !important;
154
+ background: #fff !important;
155
+ color: #999 !important;
156
+ border: none !important;
157
+ }
158
+
159
+ .sp-data-table th a {
160
+ color: inherit !important;
161
+ }
162
+
163
+ .sp-data-table .data-name {
164
+ text-align: left !important;
165
+ }
166
+
167
+ .sp-data-table .sp-highlight,
168
+ .sp-data-table .highlighted td {
169
+ font-weight: 500 !important;
170
+ background: #f9f9f9 !important;
171
+ }
172
+
173
+ /* Galleries */
174
+
175
+ .sp-template-gallery .sp-gallery-wrapper {
176
+ border: 1px solid #e5e5e5 !important;
177
+ background: #fff !important;
178
+ display: table !important;
179
+ width: 100% !important;
180
+ }
181
+
182
+ .sp-template-gallery .gallery-item {
183
+ padding: 0 !important;
184
+ margin: 0 !important;
185
+ position: relative !important;
186
+ }
187
+
188
+ .sp-template-gallery .gallery-item a {
189
+ display: block !important;
190
+ color: #999 !important;
191
+ }
192
+
193
+ .sp-template-gallery .gallery-item img {
194
+ display: block !important;
195
+ border: none !important;
196
+ padding: 0 !important;
197
+ margin: 0 !important;
198
+ border-radius: 0 !important;
199
+ }
200
+
201
+ .sp-template-gallery .gallery-caption {
202
+ padding: 0 !important;
203
+ margin: 0 !important;
204
+ font-size: 12px !important;
205
+ font-style: normal !important;
206
+ font-weight: 500 !important;
207
+ text-align: center !important;
208
+ color: #999 !important;
209
+ line-height: 1.5 !important;
210
+ padding: 5px 10px !important;
211
+ }
212
+
213
+ .sp-template-gallery .gallery-caption strong {
214
+ color: #fff !important;
215
+ background: #00a69c !important;
216
+ display: block !important;
217
+ font-weight: 400 !important;
218
+ font-size: 13px !important;
219
+ line-height: 1.5 !important;
220
+ position: absolute !important;
221
+ left: 0 !important;
222
+ top: 0 !important;
223
+ padding: 5px 10px !important;
224
+ }
225
+
226
+ .sp-template-staff-gallery .gallery-caption strong {
227
+ display: none !important;
228
+ }
229
+
230
+ .sp-template-gallery .sp-gallery-group-name {
231
+ margin: 0 !important;
232
+ padding: 15px !important;
233
+ background: #fff !important;
234
+ border-bottom: 1px solid #e5e5e5 !important;
235
+ font-size: 20px !important;
236
+ font-weight: 400 !important;
237
+ line-height: 1.5 !important;
238
+ display: block !important;
239
+ }
240
+
241
+ /* Countdowns */
242
+
243
+ .sp-template-countdown .sp-event-name,
244
+ .sp-template-countdown .sp-event-venue,
245
+ .sp-template-countdown .sp-event-league {
246
+ margin: 0 !important;
247
+ padding: 5px 10px !important;
248
+ text-align: center !important;
249
+ line-height: 1.5 !important;
250
+ display: table !important;
251
+ width: 100% !important;
252
+ background: #fff !important;
253
+ border: 1px solid #e5e5e5 !important;
254
+ border-bottom: none !important;
255
+ }
256
+
257
+ .sp-template-countdown .sp-event-name {
258
+ font-size: 13px !important;
259
+ font-weight: 400 !important;
260
+ color: #333 !important;
261
+ }
262
+
263
+ .sp-template-countdown .sp-event-venue,
264
+ .sp-template-countdown .sp-event-league {
265
+ font-size: 12px !important;
266
+ font-weight: 500 !important;
267
+ background: #fff !important;
268
+ color: #999 !important;
269
+ }
270
+
271
+ .sp-template-countdown .sp-event-venue a,
272
+ .sp-template-countdown .sp-event-league a {
273
+ color: inherit !important;
274
+ }
275
+
276
+ .sp-countdown time {
277
+ display: table !important;
278
+ background: #fff !important;
279
+ border: 1px solid #e5e5e5 !important;
280
+ border-collapse: collapse !important;
281
+ width: 100% !important;
282
+ }
283
+
284
+ .sp-countdown span {
285
+ font-size: 20px !important;
286
+ font-weight: 400 !important;
287
+ line-height: 1.5 !important;
288
+ display: table-cell !important;
289
+ border: 1px solid #e5e5e5 !important;
290
+ padding: 10px 5px !important;
291
+ text-align: center !important;
292
+ }
293
+
294
+ .sp-countdown span small {
295
+ font-size: 12px !important;
296
+ font-weight: 400 !important;
297
+ line-height: 1.5 !important;
298
+ font-weight: 500 !important;
299
+ color: rgba(51,51,51,0.5) !important;
300
+ display: block !important;
301
+ }
302
+
303
+ /* Event Calendars */
304
+
305
+ .sp-template-event-calendar .sp-table-caption {
306
+ display: table-caption !important;
307
+ }
308
+
309
+ .sp-template-event-calendar td {
310
+ padding: 10px 5px !important;
311
+ }
312
+
313
+ .sp-template-event-calendar tfoot td {
314
+ padding: 10px 15px !important;
315
+ border: none !important;
316
+ }
317
+
318
+ .sp-template-event-calendar .sp-previous-month {
319
+ text-align: left !important;
320
+ }
321
+
322
+ .sp-template-event-calendar .sp-next-month {
323
+ text-align: right !important;
324
+ }
325
+
326
+ .sp-template-event-calendar tfoot a {
327
+ font-size: 12px !important;
328
+ font-weight: 400 !important;
329
+ line-height: 1.5 !important;
330
+ text-decoration: none !important;
331
+ color: rgba(51,51,51,0.5) !important;
332
+ }
333
+
334
+ .sp-template-event-calendar tfoot a:hover {
335
+ color: #333 !important;
336
+ text-decoration: none !important;
337
+ }
338
+
339
+ /* Event Lists */
340
+
341
+ .sp-template-event-list .data-home {
342
+ text-align: right !important;
343
+ }
344
+
345
+ .sp-template-event-list .data-away {
346
+ text-align: left !important;
347
+ }
348
+
349
+ /* Event Blocks */
350
+
351
+ .sp-template-event-blocks td {
352
+ padding: 0 !important;
353
+ }
354
+
355
+ .sp-template-event-blocks .sp-event-date {
356
+ color: rgba(51,51,51,0.5) !important;
357
+ font-weight: 500 !important;
358
+ font-size: 12px !important;
359
+ margin: 10px !important;
360
+ }
361
+
362
+ .sp-template-event-blocks .sp-event-date a,
363
+ .sp-template-event-blocks .sp-event-date a:hover {
364
+ color: inherit !important;
365
+ }
366
+
367
+ .sp-template-event-blocks .sp-event-results {
368
+ font-size: 20px !important;
369
+ font-weight: 400 !important;
370
+ padding: 0 !important;
371
+ margin: 0 !important;
372
+ color: #333 !important;
373
+ }
374
+
375
+ .sp-template-event-blocks .sp-event-results a {
376
+ color: inherit !important;
377
+ }
378
+
379
+ .sp-template-event-blocks .sp-event-results a:hover {
380
+ color: inherit !important;
381
+ text-decoration: none !important;
382
+ }
383
+
384
+ .sp-template-event-blocks .sp-event-title,
385
+ .sp-template-event-blocks .sp-event-status {
386
+ display: block !important;
387
+ padding: 0 !important;
388
+ margin: 10px !important;
389
+ font-size: 13px !important;
390
+ font-weight: 400 !important;
391
+ }
392
+
393
+ /* Event Logos */
394
+
395
+ .sp-template-event-logos .sp-team-name,
396
+ .sp-template-event-logos .sp-team-result {
397
+ font-size: 20px !important;
398
+ font-weight: 400 !important;
399
+ padding: 0 !important;
400
+ margin: 0 !important;
401
+ color: #333 !important;
402
+ }
403
+
404
+ .sp-template-event-logos a,
405
+ .sp-template-event-logos a:hover {
406
+ border: none !important;
407
+ text-decoration: none !important;
408
+ }
409
+
410
+ /* Event Performance */
411
+
412
+ .sp-template-event-performance-icons td {
413
+ border: none !important;
414
+ }
415
+
416
+ .sp-template-event-performance-icons tr:first-child td {
417
+ border-top: 1px solid #e5e5e5 !important;
418
+ }
419
+
420
+ /* Videos */
421
+ .sp-template-event-video iframe {
422
+ width: 100% !important;
423
+ }
424
+
425
+ /* Match Stats */
426
+
427
+ .sp-template-event-statistics .sp-statistic-label {
428
+ font-size: 12px !important;
429
+ font-weight: 500 !important;
430
+ color: inherit !important;
431
+ opacity: 0.5 !important;
432
+ }
433
+
434
+ .sp-event-statistics {
435
+ background: transparent !important;
436
+ margin: 0 0 10px !important;
437
+ }
438
+
439
+ .sp-event-statistics,
440
+ .sp-event-statistics tr,
441
+ .sp-event-statistics td {
442
+ border: none !important;
443
+ }
444
+
445
+ .sp-event-statistics .sp-statistic-ratio {
446
+ padding: 0 !important;
447
+ }
448
+
449
+ .sp-event-statistics .sp-statistic-bar {
450
+ border: 1px solid #e5e5e5 !important;
451
+ background: #f9f9f9 !important;
452
+ }
453
+
454
+ /* Venues */
455
+
456
+ .sp-event-venue-map-row td {
457
+ padding: 0 !important;
458
+ }
459
+
460
+ .sp-event-venue-map-row .sp-google-map {
461
+ display: block !important;
462
+ margin: 0 !important;
463
+ }
464
+
465
+ /* Teams */
466
+
467
+ .sp-template-logo {
468
+ float: right !important;
469
+ margin: 0 0 20px 20px !important;
470
+ clear: none !important;
471
+ }
472
+
473
+ /* Profiles */
474
+
475
+ .sp-template-details dl {
476
+ margin: 0 0 20px !important;
477
+ padding: 15px !important;
478
+ border: 1px solid #e5e5e5 !important;
479
+ background: #fff !important;
480
+ }
481
+
482
+ .sp-template-details dt,
483
+ .sp-template-details dd {
484
+ margin: 0 !important;
485
+ padding: 0 !important;
486
+ }
487
+
488
+ .sp-template-details dt {
489
+ font-size: 12px !important;
490
+ font-weight: 500 !important;
491
+ color: rgba(51,51,51,0.5) !important;
492
+ }
493
+
494
+ .sp-template-details dd {
495
+ font-size: 16px !important;
496
+ font-weight: 400 !important;
497
+ color: #333 !important;
498
+ margin-bottom: 10px !important;
499
+ }
500
+
501
+ .sp-template-details dd:last-child {
502
+ margin-bottom: 0 !important;
503
+ }
504
+
505
+ /* Twitter */
506
+
507
+ .sp-tweets {
508
+ border: 1px solid #e5e5e5 !important;
509
+ border-top: none !important;
510
+ }
511
+
512
+ /* Scoreboards */
513
+
514
+ .sp-header-scoreboard .sp-template-scoreboard {
515
+ margin-bottom: 0 !important;
516
+ }
517
+
518
+ .sp-template-scoreboard td {
519
+ padding: 0 !important;
520
+ }
521
+
522
+ .sp-template-scoreboard td:hover {
523
+ background: #f9f9f9 !important;
524
+ }
525
+
526
+ .sp-template-scoreboard a,
527
+ .sp-template-scoreboard a:hover {
528
+ text-decoration: none !important;
529
+ color: #333 !important;
530
+ }
531
+
532
+ .sp-template-scoreboard .sp-scoreboard-date {
533
+ font-size: 12px !important;
534
+ font-weight: 500 !important;
535
+ color: rgba(51,51,51,0.5) !important;
536
+ }
537
+
538
+ .sp-template-scoreboard .sp-scoreboard-nav {
539
+ color: #fff !important;
540
+ background: #00a69c !important;
541
+ }
542
+
543
+ /* Timelines */
544
+
545
+ .sp-template-timeline .sp-timeline * {
546
+ color: initial !important;
547
+ }
548
+
549
+ /* Tournaments */
550
+
551
+ .sp-tournament-bracket {
552
+ color: #333 !important;
553
+ background: transparent !important;
554
+ width: 100% !important;
555
+ border-collapse: separate !important;
556
+ }
557
+
558
+ .sp-tournament-bracket a,
559
+ .sp-tournament-bracket a:hover {
560
+ text-decoration: none !important;
561
+ color: inherit !important;
562
+ border: none! important;
563
+ }
564
+
565
+ .sp-tournament-bracket tr,
566
+ .sp-tournament-bracket th,
567
+ .sp-tournament-bracket td {
568
+ border: none !important;
569
+ }
570
+
571
+ .sp-tournament-bracket thead th {
572
+ font-size: 12px !important;
573
+ font-weight: 500 !important;
574
+ color: rgba(51,51,51,0.5) !important;
575
+ text-align: center !important;
576
+ border-bottom: 1px solid #e5e5e5 !important;
577
+ }
578
+
579
+ .sp-tournament-bracket .sp-team-name {
580
+ font-size: 13px !important;
581
+ font-weight: 400 !important;
582
+ text-align: center !important;
583
+ background: #fff !important;
584
+ border: 1px solid #e5e5e5 !important;
585
+ }
586
+
587
+ .sp-tournament-bracket .sp-heading,
588
+ .sp-tournament-bracket .sp-heading:hover {
589
+ color: #fff !important;
590
+ background: #00a69c !important;
591
+ border-color: #00a69c !important;
592
+ }
593
+
594
+ .sp-tournament-bracket .sp-event {
595
+ border-color: #e5e5e5 !important;
596
+ border-width: 1px !important;
597
+ }
598
+
599
+ .sp-tournament-bracket .sp-event .sp-event-title {
600
+ font-size: 12px !important;
601
+ font-weight: 400 !important;
602
+ color: rgba(51,51,51,0.5) !important;
603
+ text-align: center !important;
604
+ }
605
+
606
+ .sp-tournament-bracket .sp-event .sp-event-title:hover {
607
+ color: #333 !important;
608
+ }
609
+
610
+ /* Tabs */
611
+
612
+ .sp-tab-menu {
613
+ display: block !important;
614
+ clear: both !important;
615
+ margin: 0 0 20px !important;
616
+ padding: 0 !important;
617
+ list-style: none !important;
618
+ }
619
+
620
+ .sp-tab-menu-item {
621
+ display: inline-block !important;
622
+ margin: 0 !important;
623
+ padding: 0 !important;
624
+ }
625
+
626
+ .sp-tab-menu-item a {
627
+ margin: 0 !important;
628
+ padding: 5px 10px;
629
+ border-bottom: 2px solid transparent !important;
630
+ box-shadow: none !important;
631
+ }
632
+
633
+ .sp-tab-menu-item a:hover {
634
+ text-decoration: none !important;
635
+ }
636
+
637
+ .sp-tab-menu-item-active a,
638
+ .sp-tab-menu-item-active a:hover {
639
+ color: #00a69c !important;
640
+ border-bottom-color: #00a69c !important;
641
+ }
642
+
643
+ /* Post Content */
644
+
645
+ .single-sp_team .has-post-thumbnail .sp-post-content {
646
+ clear: none;
647
+ }
648
+
649
+ /* Media Queries */
650
+
651
+ @media screen and (min-width: 601px) {
652
+ .sp-template-event-calendar tbody td {
653
+ padding: 15px 5px !important;
654
+ }
655
+
656
+ .widget .sp-template-event-calendar tbody td {
657
+ padding: 10px 5px !important;
658
+ }
659
+ }
660
+
661
+ @media screen and (min-width: 801px) {
662
+ .sp-template-event-calendar tbody td {
663
+ padding: 20px 5px !important;
664
+ }
665
+
666
+ .widget .sp-template-event-calendar tbody td {
667
+ padding: 10px 5px !important;
668
+ }
669
+
670
+ .sp-template-event-performance-icons.sp-template-event-performance-section:nth-child(2n) {
671
+ padding-top: 61px !important;
672
+ }
673
+ }
assets/css/sportspress.css CHANGED
@@ -180,8 +180,8 @@
180
  width: 2em;
181
  height: 2em;
182
  margin-right: 0.5em;
183
- display: block;
184
- float: left;
185
  text-align: center;
186
  }
187
  .sp-league-table .data-name .team-logo img {
@@ -200,8 +200,8 @@
200
  width: 2em;
201
  height: 2em;
202
  margin-right: 0.5em;
203
- display: block;
204
- float: left;
205
  text-align: center;
206
  }
207
  .sp-player-list .data-name .player-photo img,
@@ -253,6 +253,9 @@
253
  }
254
 
255
  /* Event Performance */
 
 
 
256
  .sp-event-performance .sub {
257
  background: rgba(0,0,0,0.05);
258
  }
@@ -279,15 +282,21 @@
279
  box-sizing: border-box;
280
  width: 50%;
281
  float: left;
 
282
  padding-right: 10px;
283
  }
284
 
285
  .sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) {
286
  float: right;
 
287
  padding-right: 0;
288
  padding-left: 10px;
289
  }
290
 
 
 
 
 
291
  /* Event Calendar */
292
  .sp-event-calendar {
293
  border-spacing: 0;
@@ -326,17 +335,32 @@
326
  .sp-event-list .data-away {
327
  text-align: left;
328
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  .sp-event-list .data-home img,
330
  .sp-event-list .data-away img {
331
  display: inline-block;
332
  vertical-align: middle;
333
  }
334
  .sp-event-list .data-home img {
335
- float: right;
336
  margin-left: 8px;
337
  }
338
  .sp-event-list .data-away img {
339
- float: left;
340
  margin-right: 8px;
341
  }
342
  .sp-event-list-format-homeaway .data-time {
@@ -417,6 +441,26 @@
417
  font-size: 36px;
418
  }
419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  /* Countdowns */
421
  .sp-template-countdown .event-name {
422
  clear: both;
@@ -463,11 +507,6 @@
463
  margin-top: 0.5em;
464
  }
465
 
466
- /* Alternate */
467
- .sp-data-table tbody tr.odd {
468
- background: rgba(0, 0, 0, 0.02);
469
- }
470
-
471
  /* Highlight & Heading */
472
  .sp-highlight,
473
  .sp-heading {
180
  width: 2em;
181
  height: 2em;
182
  margin-right: 0.5em;
183
+ display: inline-block;
184
+ vertical-align: middle;
185
  text-align: center;
186
  }
187
  .sp-league-table .data-name .team-logo img {
200
  width: 2em;
201
  height: 2em;
202
  margin-right: 0.5em;
203
+ display: inline-block;
204
+ vertical-align: middle;
205
  text-align: center;
206
  }
207
  .sp-player-list .data-name .player-photo img,
253
  }
254
 
255
  /* Event Performance */
256
+ .sp-template-event-performance-icons thead {
257
+ display: none;
258
+ }
259
  .sp-event-performance .sub {
260
  background: rgba(0,0,0,0.05);
261
  }
282
  box-sizing: border-box;
283
  width: 50%;
284
  float: left;
285
+ clear: left;
286
  padding-right: 10px;
287
  }
288
 
289
  .sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) {
290
  float: right;
291
+ clear: right;
292
  padding-right: 0;
293
  padding-left: 10px;
294
  }
295
 
296
+ .sp-template-event-performance-icons .sp-player-position {
297
+ display: block;
298
+ }
299
+
300
  /* Event Calendar */
301
  .sp-event-calendar {
302
  border-spacing: 0;
335
  .sp-event-list .data-away {
336
  text-align: left;
337
  }
338
+ .sp-event-list td.has-logo {
339
+ line-height: 2em;
340
+ }
341
+ .sp-event-list .team-logo {
342
+ width: 2em;
343
+ height: 2em;
344
+ margin-right: 0.5em;
345
+ display: inline-block;
346
+ vertical-align: middle;
347
+ text-align: center;
348
+ }
349
+ .sp-event-list .team-logo img {
350
+ width: auto;
351
+ height: auto;
352
+ max-width: 2em;
353
+ max-height: 2em;
354
+ }
355
  .sp-event-list .data-home img,
356
  .sp-event-list .data-away img {
357
  display: inline-block;
358
  vertical-align: middle;
359
  }
360
  .sp-event-list .data-home img {
 
361
  margin-left: 8px;
362
  }
363
  .sp-event-list .data-away img {
 
364
  margin-right: 8px;
365
  }
366
  .sp-event-list-format-homeaway .data-time {
441
  font-size: 36px;
442
  }
443
 
444
+ /* Event Form */
445
+ .sp-form-events {
446
+ text-align: center;
447
+ }
448
+
449
+ .sp-form-events .sp-form-event-link {
450
+ display: inline-block;
451
+ text-align: center;
452
+ vertical-align: text-top;
453
+ line-height: 1.5em;
454
+ width: 1.5em;
455
+ margin: 0 0 0.25em;
456
+ color: #fff !important;
457
+ font-weight: normal;
458
+ }
459
+
460
+ .sp-form-events .sp-form-event-link:hover {
461
+ color: #fff !important;
462
+ }
463
+
464
  /* Countdowns */
465
  .sp-template-countdown .event-name {
466
  clear: both;
507
  margin-top: 0.5em;
508
  }
509
 
 
 
 
 
 
510
  /* Highlight & Heading */
511
  .sp-highlight,
512
  .sp-heading {
assets/fonts/sportspress.eot CHANGED
Binary file
assets/fonts/sportspress.svg CHANGED
@@ -7,6 +7,7 @@
7
  <font-face units-per-em="512" ascent="480" descent="-32" />
8
  <missing-glyph horiz-adv-x="512" />
9
  <glyph unicode="&#x20;" horiz-adv-x="256" d="" />
 
10
  <glyph unicode="&#xe600;" glyph-name="soccer" d="M256 6.4c-127.28 0-230.4 103.12-230.4 230.4s103.12 230.4 230.4 230.4 230.4-103.12 230.4-230.4-103.12-230.4-230.4-230.4zM401.040 381.84c-18.32 18.24-40.080 32.88-65.44 43.6s-51.84 16.16-79.6 16.16-54.24-5.36-79.6-16.16-47.2-25.28-65.44-43.6-32.88-40.080-43.6-65.44-16.16-51.84-16.16-79.6 5.36-54.24 16.16-79.6 25.28-47.2 43.6-65.44c18.32-18.24 40.080-32.88 65.44-43.6s51.84-16.16 79.6-16.16 54.24 5.36 79.6 16.16 47.2 25.36 65.44 43.6c18.24 18.32 32.88 40.080 43.6 65.44s16.16 51.84 16.16 79.6-5.36 54.24-16.16 79.6-25.36 47.2-43.6 65.44zM332.8 134.4l-25.6-64v-5.2c-16.8-5.040-33.84-7.6-51.2-7.6s-34.4 2.56-51.2 7.6v5.2l-25.6 64h-70c-18.96 27.2-29.44 57.2-31.6 90l50.4 38v76.8l-14 6.8c18.64 24 42.16 42.24 70.4 54.8l71.6-36 71.6 36c28.24-12.56 51.6-30.8 70-54.8l-13.6-6.8v-76.8l50.4-38c-2.16-32.8-12.64-62.8-31.6-90h-70zM256 300.8l-64-44 24.4-70.8h79.2l24.4 70.8-64 44z" />
11
  <glyph unicode="&#xe601;" glyph-name="baseball" d="M371.52 96.32c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0-0.080 0.080-0.080 0.080s0 0 0 0 0 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080-0.080 0.080-0.16 0.16v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080v0c-0.080 0.080-0.16 0.16-0.24 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32v0c-0.88 0.96-1.76 2-2.56 2.96l5.36 4.48c-4.96 6-9.6 12.32-13.76 18.88l-6.48-4.32c-1.36 2-2.64 4.080-3.92 6.16v0c0 0 0 0.080-0.080 0.080 0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.32 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s0 0.080 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.4 0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.080s0 0 0 0c-0.080 0.16-0.16 0.24-0.24 0.4 0 0 0 0 0 0-2.96 4.96-5.68 10.080-8.16 15.36l7.52 3.6c-2.8 6.24-5.36 12.64-7.52 19.2l-7.92-2.72c-1.68 4.96-3.2 10-4.56 15.040 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0-0.56 2.56-1.12 5.2-1.6 7.84l8.56 1.6c-1.12 6.48-1.92 13.040-2.4 19.68l-6.88-0.48v28.48l6.88-0.48c0.48 6.64 1.28 13.2 2.4 19.68l-8.56 1.6c0.48 2.64 1.040 5.28 1.6 7.84 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16v0c0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 1.28 5.12 2.8 10.16 4.56 15.040l7.92-2.72c2.16 6.56 4.64 12.96 7.52 19.2l-7.52 3.6c2.48 5.28 5.2 10.4 8.16 15.36 0 0 0 0 0 0 0.080 0.16 0.16 0.24 0.24 0.4 0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.080s0 0 0 0c0.080 0.080 0.16 0.24 0.24 0.4 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.16v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0.080 0.080 0.080c0 0 0 0.080 0.080 0.080 0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0 0 0c0 0.080 0.080 0.080 0.080 0.16 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.24 0.32 0 0 0 0 0 0s0 0.080 0.080 0.080v0c1.28 2.080 2.56 4.080 3.92 6.16l6.48-4.32c4.24 6.56 8.8 12.88 13.76 18.88l-5.36 4.48c0.88 1.040 1.68 2 2.56 2.96v0c0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.24 0.24v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080v0c0.080 0.080 0.080 0.080 0.16 0.16 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 3.44 3.68 7.040 7.2 10.72 10.64-33.76 30.56-77.92 48.4-126.24 48.4s-92.48-17.84-126.24-47.28c3.68-3.36 7.28-6.96 10.72-10.64 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080v0c0.080-0.080 0.080-0.080 0.16-0.16v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080v0c0.080-0.080 0.16-0.16 0.24-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32v0c0.88-0.96 1.76-2 2.56-2.96l-5.36-4.48c4.96-6 9.6-12.32 13.76-18.88l6.48 4.32c1.36-2 2.64-4.080 3.92-6.16v0c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.32 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.4 0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.080s0 0 0 0c0.080-0.16 0.16-0.24 0.24-0.4 0 0 0 0 0 0 2.96-4.96 5.68-10.080 8.16-15.36l-7.52-3.6c2.8-6.24 5.36-12.64 7.52-19.2l7.92 2.72c1.68-4.96 3.2-10 4.56-15.040 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32v0c0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0.56-2.56 1.12-5.2 1.6-7.84l-8.56-1.6c1.12-6.48 1.92-13.040 2.4-19.68l6.88 0.48v-28.48l-6.88 0.48c-0.48-6.64-1.28-13.2-2.4-19.68l8.56-1.6c-0.48-2.64-1.040-5.28-1.6-7.84 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0-1.28-5.12-2.8-10.16-4.56-15.040l-7.92 2.72c-2.16-6.56-4.64-12.96-7.52-19.2l7.52-3.6c-2.48-5.28-5.2-10.4-8.16-15.36 0 0 0 0 0 0-0.080-0.16-0.16-0.24-0.24-0.4 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.080s0 0 0 0c-0.080-0.080-0.16-0.24-0.24-0.4 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0-0.080-0.080-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.24-0.32 0 0 0 0 0 0s0-0.080-0.080-0.080v0c-1.28-2.080-2.56-4.080-3.92-6.16l-6.48 4.32c-4.24-6.56-8.8-12.88-13.76-18.88l5.36-4.48c-0.88-1.040-1.68-2-2.56-2.96v0c-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.24-0.24v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080v0c-0.080-0.080-0.080-0.080-0.16-0.16v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s0 0-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0-0.080-0.080 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-3.44-3.68-7.040-7.2-10.72-10.64 33.76-30.56 77.92-48.4 126.24-48.4s92.48 17.84 126.24 47.28c-3.76 3.44-7.28 6.96-10.72 10.64v0zM144.72 134l-6.8 4.56c4.56 6.72 8.64 13.92 12.080 21.28l6.96-3.28c0.64 1.36 1.2 2.72 1.76 4.080 1.92 4.56 3.68 9.2 5.2 13.84l-7.2 2.48c2.64 7.68 4.72 15.6 6.24 23.6l7.2-1.36c1.040 6.080 1.76 12.16 2.24 18.32l-7.2 0.56c0.32 4.080 0.4 8.16 0.4 12.24s-0.16 8.16-0.4 12.24l7.2 0.56c-0.4 6.16-1.2 12.32-2.24 18.32l-7.2-1.36c-1.44 8-3.6 15.92-6.24 23.6l7.2 2.48c-1.52 4.64-3.28 9.28-5.2 13.84-0.56 1.36-1.2 2.72-1.76 4.080l-6.96-3.28c-3.44 7.36-7.52 14.48-12.080 21.28l6.8 4.56c-3.92 6.16-8.24 12.080-12.96 17.76l-6.88-5.84c-4.72 5.6-9.84 10.96-15.28 15.84-28.48-33.28-45.6-76.64-45.6-124s17.12-90.72 45.52-124.16c5.44 4.96 10.56 10.24 15.28 15.84l6.88-5.84c4.8 5.68 9.12 11.6 13.040 17.76v0zM402.48 354.56c-5.44-4.96-10.56-10.24-15.28-15.84l-6.88 5.84c-4.72-5.68-9.040-11.6-12.96-17.76l6.8-4.56c-4.56-6.72-8.64-13.92-12.080-21.28l-6.96 3.28c-0.64-1.36-1.2-2.72-1.76-4.080-1.92-4.56-3.68-9.2-5.2-13.84l7.2-2.48c-2.64-7.68-4.72-15.6-6.24-23.6l-7.2 1.36c-1.040-6.080-1.76-12.16-2.24-18.32l7.2-0.56c-0.32-4.080-0.4-8.16-0.4-12.24s0.16-8.16 0.4-12.24l-7.2-0.56c0.4-6.16 1.2-12.32 2.24-18.32l7.2 1.36c1.44-8 3.6-15.92 6.24-23.6l-7.2-2.48c1.52-4.64 3.28-9.28 5.2-13.84 0.56-1.36 1.2-2.72 1.76-4.080l6.96 3.28c3.44-7.36 7.52-14.48 12.080-21.28l-6.8-4.56c3.92-6.16 8.24-12.080 12.96-17.76l6.88 5.84c4.72-5.6 9.84-10.96 15.28-15.84 28.4 33.44 45.52 76.8 45.52 124.16s-17.12 90.56-45.52 124z" />
12
  <glyph unicode="&#xe602;" glyph-name="basketball" d="M460.4 256c-2.8 42.080-19.12 80.4-44.64 110.72-3.040-2.56-5.92-5.28-8.72-8.16-27.76-27.76-44.32-63.84-47.28-102.56h100.64zM395.6 387.36c-30.8 27.12-70.4 44.56-114 47.44v-178.8h49.2c3.44 52.24 27.84 98.8 64.8 131.36zM130.64 358.56c-2.8 2.8-5.76 5.52-8.72 8.16-25.6-30.32-41.92-68.64-44.72-110.72h100.64c-2.96 38.8-19.44 74.8-47.2 102.56zM206.8 256h49.2v178.8c-43.6-2.88-83.2-20.24-114-47.44 36.96-32.56 61.36-79.12 64.8-131.36zM407.040 127.76c2.8-2.8 5.76-5.52 8.72-8.16 25.52 30.32 41.84 68.72 44.64 110.72h-100.72c3.040-38.72 19.52-74.72 47.36-102.56zM330.8 230.4h-49.2v-178.8c43.6 2.88 83.2 20.24 114 47.44-36.96 32.56-61.36 79.12-64.8 131.36zM77.2 230.4c2.8-42.080 19.040-80.4 44.64-110.72 3.040 2.56 5.92 5.28 8.72 8.16 27.76 27.76 44.32 63.84 47.28 102.64 0.080-0.080-100.64-0.080-100.64-0.080zM142 99.040c30.8-27.12 70.4-44.56 114-47.44v178.8h-49.2c-3.44-52.24-27.84-98.8-64.8-131.36z" />
@@ -31,8 +32,9 @@
31
  <glyph unicode="&#xf181;" glyph-name="bracket-center" d="M435.2 205.2h51.2c14.16 0 25.6-11.44 25.6-25.6v-102.4c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v76.8h-25.6v-25.6c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v25.6h-25.6v-76.8c0-14.16-11.44-25.6-25.6-25.6h-51.2v-25.6c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-25.6h25.6v153.6h-25.6v-25.6c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-76.8h25.6v25.6c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-25.6h25.6v76.8c0 14.16 11.44 25.6 25.6 25.6h51.2v25.6c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-102.4c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v25.6h-25.6v-153.6h25.6v25.6c0 14.16 11.44 25.6 25.6 25.6z" />
32
  <glyph unicode="&#xf182;" glyph-name="trash" d="M288 256h64v-160h-64zM480 384h-128v64c0 17.688-14.312 32-32 32h-128c-17.688 0-32-14.312-32-32v-64h-128c-17.688 0-32-14.312-32-32v-32h32v-320c0-17.688 14.312-32 32-32h384c17.688 0 32 14.312 32 32v320h32v32c0 17.688-14.312 32-32 32zM224 416h64v-32h-64v32zM416 32h-320v288h320v-288zM160 256h64v-160h-64z" />
33
  <glyph unicode="&#xf185;" glyph-name="chart" d="M76.8 102.4h102.4v204.8h-102.4v-204.8zM204.8 102.4h102.4v307.2h-102.4v-307.2zM332.8 307.2v-204.8h102.4v204.8h-102.4z" />
 
34
  <glyph unicode="&#xf227;" glyph-name="whistle" d="M301.84 256c3.44-12.24 5.36-25.12 5.36-38.4 0-77.76-63.040-140.8-140.8-140.8s-140.8 63.040-140.8 140.8 63.040 140.8 140.8 140.8h89.6v-25.6c0-14.16 11.44-25.6 25.6-25.6s25.6 11.44 25.6 25.6v25.6h179.2v-102.4h-184.56z" />
35
- <glyph unicode="&#xf237;" glyph-name="api" d="M448 357.44c-7.36 0-14.16 2.080-20 5.6l-111.68-111.68c10.32-13.040 16.48-29.6 16.48-47.52 0-14.72-4.16-28.48-11.28-40.16l64.96-51.040c20.4 18.96 52.16 20.72 74.72 2.96 25.040-19.68 29.36-55.84 9.68-80.88s-55.84-29.36-80.88-9.68c-22.56 17.76-28.32 49.040-14.72 73.36l-64.96 51.040c-13.92-13.84-33.040-22.48-54.24-22.48-42.4 0-76.8 34.4-76.8 76.8 0 5.28 0.56 10.48 1.6 15.52l-90.56 30.16c-5.76-8.24-15.36-13.6-26.16-13.6-17.68 0-32 14.32-32 32s14.32 32 32 32 32-14.32 32-32c0-0.48 0-0.96 0-1.44l90.4-30.080c12.24 26.16 38.8 44.32 69.6 44.32 17.92 0 34.4-6.16 47.52-16.48l111.52 111.76c-3.52 5.84-5.6 12.64-5.6 20 0 21.2 17.2 38.4 38.4 38.4s38.4-17.2 38.4-38.4-17.2-38.48-38.4-38.48z" />
36
  <glyph unicode="&#xf307;" glyph-name="tshirt" d="M459.6 307.2h-76.8v-179.2h-256v179.2h-76.8v102.4h132.4c10.56-29.84 38.96-51.2 72.4-51.2s61.84 21.36 72.4 51.2h132.4v-102.4zM382.8 102.4v-51.2h-256v51.2h256z" />
37
  <glyph unicode="&#xf309;" glyph-name="color" d="M435.2 204.8c0-98.96-80.24-179.2-179.2-179.2s-179.2 80.24-179.2 179.2c0 49.52 20.080 94.32 52.48 126.72v0l126.72 126.72 126.72-126.72c32.4-32.4 52.48-77.2 52.48-126.72zM343.28 298l-87.44 87.44-89.040-89.040c-23.84-23.28-38.8-55.6-38.8-91.6 0-70.72 57.28-128 128-128s128 57.28 128 128c0 36.88-15.76 69.84-40.72 93.2zM256 102.4l0.080 246.8 70.4-70.4c19.6-18.64 31.92-44.8 31.92-74 0-56.56-45.84-102.4-102.4-102.4z" />
38
  <glyph unicode="&#xf313;" glyph-name="tournament" d="M384 286v149.2h25.6c14.16 0 25.6-11.44 25.6-25.6v-51.2c0-33.44-21.36-61.84-51.2-72.4zM153.6 51.52h204.8v-51.52h-204.8v51.52zM179.2 76.8l25.6 25.6h25.6v25.6l25.6 25.6 25.6-25.6v-25.6h25.6l25.6-25.6h-153.6zM256 179.2c-56.56 0-102.4 45.84-102.4 102.4v179.2h204.8v-179.2c0-56.56-45.84-102.4-102.4-102.4zM76.8 358.4v51.2c0 14.16 11.44 25.6 25.6 25.6h25.6v-149.2c-29.84 10.56-51.2 38.96-51.2 72.4z" />
@@ -49,11 +51,11 @@
49
  <glyph unicode="&#xf338;" glyph-name="staff" d="M409.6 25.6h-307.2c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6h307.2c14.16 0 25.6-11.44 25.6-25.6v-358.4c0-14.16-11.44-25.6-25.6-25.6zM332.8 384h-153.6l51.2-51.2-51.2-204.8 76.8-76.8 76.8 76.8-51.2 204.8 51.2 51.2z" />
50
  <glyph unicode="&#xf453;" glyph-name="cake" d="M434.8 51.12h-358.4c-14.16 0-25.6 11.44-25.6 25.6s11.44 25.6 25.6 25.6v78.24c16.24-16.64 38.88-27.040 64-27.040 22.080 0 42 8.24 57.6 21.52 15.6-13.2 35.52-21.52 57.6-21.52s42 8.24 57.6 21.52c15.6-13.2 35.52-21.52 57.6-21.52 25.12 0 47.76 10.4 64 27.040v-78.24c14.16 0 25.6-11.44 25.6-25.6 0-14.080-11.44-25.6-25.6-25.6zM370.8 179.12c-25.52 0-47.28 15.040-57.6 36.56-10.32-21.6-32.080-36.56-57.6-36.56s-47.28 15.040-57.6 36.56c-10.32-21.6-32.080-36.56-57.6-36.56-32.4 0-58.96 24.16-63.12 55.44 2.080 12 12.080 21.36 24.72 21.36h307.2c12.64 0 22.64-9.28 24.72-21.36-4.16-31.2-30.72-55.44-63.12-55.44v0zM255.76 294.24c-15.2 0-26.48 3.2-33.84 9.6s-11.040 18-11.040 34.72c0 6.64 1.6 14.64 4.88 23.84s6.8 17.68 10.8 25.28c3.92 7.6 8.48 15.52 13.6 23.84s8.72 13.92 10.8 16.8 3.68 5.2 4.88 6.96l4.64-6.64c3.040-4.24 6.8-10.080 11.28-17.28s8.88-14.96 13.2-23.2 8.080-16.8 11.12-25.92 4.64-16.96 4.64-23.6c0-16.72-3.68-28.32-11.040-34.72-7.44-6.48-18.72-9.68-33.92-9.68v0z" />
51
  <glyph unicode="&#xf464;" glyph-name="edit" d="M435.2 25.6h-358.4c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6h256l-51.2-51.2h-179.2v-307.2h307.2v179.2l51.2 51.2v-256c0-14.16-11.44-25.6-25.6-25.6zM153.6 128v76.8l230.4 230.4h25.6l51.2-51.2v-25.6l-230.4-230.4h-76.8zM268.8 217.6l140.8 140.8-25.6 25.6-140.8-140.8 25.6-25.6zM204.8 204.8l-25.6-25.6v-25.6h25.6l25.6 25.6-25.6 25.6z" />
52
- <glyph unicode="&#xf469;" glyph-name="stopwatch" d="M188.8 313.76c-11.44-7.040 30.64-108.56 40.88-125.12 8.96-14.56 28-18.96 42.48-10.080 14.56 9.040 19.040 28 10.080 42.48-10.16 16.56-82 99.76-93.44 92.72v0zM180.24 424.88c23.76 8.24 49.2 12.88 75.76 12.88s52-4.56 75.76-12.88c8.4-2.88 19.6 2.96 14.64 15.68-3.6 9.2-7.12 18.24-8.48 21.92-3.36 8.64-15.36 15.84-20.56 17.040-19.76 4.48-40.24 6.96-61.28 6.96s-41.52-2.48-61.36-6.96c-5.2-1.2-17.2-8.32-20.56-17.040-1.44-3.68-4.88-12.64-8.48-21.92-5.040-12.72 6.080-18.56 14.56-15.68v0zM488.88 404.8c-4.88 5.92-10.16 11.68-15.68 17.2s-11.28 10.72-17.12 15.68c-3.92 3.28-15.44 6-22.72-1.28s-42.16-42.16-42.16-42.16c10.32-7.36 20.32-15.52 29.6-24.72s17.36-19.28 24.72-29.6c0 0 34.88 34.88 42.16 42.16 7.2 7.36 4.48 18.88 1.2 22.72v0zM256 412.16c-114.56 0-207.36-92.8-207.36-207.36-0.080-114.56 92.72-207.36 207.36-207.36 114.48 0 207.36 92.8 207.36 207.36 0 114.48-92.88 207.36-207.36 207.36v0zM256 48.64c-86.24 0-156.16 69.92-156.16 156.16s69.84 156.16 156.16 156.16c86.24 0 156.16-69.92 156.16-156.16s-69.92-156.16-156.16-156.16z" />
53
  <glyph unicode="&#xf481;" glyph-name="clipboard" d="M376.16 25.6h-238.080c-20.48 0-35.84 15.36-35.84 35.84v312.32c0 10.24 5.12 20.48 12.8 28.16l28.16-66.56h225.28l28.16 69.12c7.68-5.12 12.8-15.36 12.8-28.16v-312.32c2.56-23.040-15.36-38.4-33.28-38.4zM358.24 307.2h-204.8v-230.4h204.8v230.4zM332.64 230.4h-153.6v25.6h153.6v-25.6zM332.64 179.2h-153.6v25.6h153.6v-25.6zM332.64 128h-153.6v25.6h153.6v-25.6zM163.68 358.4l-23.040 51.2h56.32l7.68 20.48 10.24 30.72h81.92l10.24-30.72 10.24-20.48h56.32l-23.040-51.2h-186.88z" />
54
  <glyph unicode="&#xf488;" glyph-name="sponsor" d="M405.2 82.080l-91.2 71.6h-134.8v-76.8c0-7.2-2.56-13.28-7.6-18.24s-11.040-7.36-18-7.36h-25.6c-7.2 0-13.28 2.48-18.24 7.36s-7.36 11.040-7.36 18.24v76.8c-7.2 0-13.28 2.48-18.24 7.36s-7.36 11.040-7.36 18.24v102.4c0 7.2 2.48 13.28 7.36 18.24s11.040 7.36 18.24 7.36h211.6l91.2 71.6c2.96 3.2 6.88 4.88 11.84 4.96s9.2-0.88 12.8-3.040c3.6-2.16 5.44-4.8 5.44-8v-285.2c0-3.2-1.76-5.84-5.44-8s-7.84-3.040-12.8-2.8c-5.040 0.4-8.88 2.080-11.84 5.28v0zM268.8 307.28h-51.2c3.44 0 6.48-1.28 8.96-3.84s3.84-5.52 3.84-8.96v-128c0-3.44-1.28-6.48-3.84-8.96s-5.52-3.84-8.96-3.84h51.2c-3.76 0-6.8 1.28-9.2 3.84s-3.6 5.52-3.6 8.96v128c0 3.44 1.2 6.48 3.6 8.96s5.36 3.84 9.2 3.84v0 0 0z" />
55
  <glyph unicode="&#xf489;" glyph-name="statistics" d="M153.6 333.2h128v-51.2h-128v51.2zM153.6 256.4h51.2v-51.2h-51.2v51.2zM153.6 179.6h102.4v-51.2h-102.4v51.2zM281.6 179.6h76.8v-51.2h-76.8v51.2zM435.2 435.6h-358.4c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 77.2h-307.2v307.2h307.2v-307.2zM230.4 256.4h128v-51.2h-128v51.2zM307.2 333.2h51.2v-51.2h-51.2v51.2z" />
56
- <glyph unicode="&#xf503;" glyph-name="moon" d="M351.207 440.32c17.562-9.856 34.099-22.195 49.050-37.094 87.552-87.603 87.552-229.53 0-317.082s-229.504-87.552-317.082 0c-14.925 14.95-27.264 31.514-37.094 49.050 85.376-47.795 195.405-35.507 268.007 37.094 72.627 72.627 84.941 182.631 37.12 268.032z" />
57
  <glyph unicode="&#xf504;" glyph-name="popup" d="M435.2 435.2h-204.8c-14.16 0-25.6-11.44-25.6-25.6v-204.8c0-14.16 11.44-25.6 25.6-25.6h204.8c14.16 0 25.6 11.44 25.6 25.6v204.8c0 14.16-11.44 25.6-25.6 25.6zM409.6 230.4h-153.6v153.6h153.6v-153.6zM256 76.8h-153.6v153.6h51.2v51.2h-76.8c-14.16 0-25.6-11.44-25.6-25.6v-204.8c0-14.16 11.44-25.6 25.6-25.6h204.8c14.16 0 25.6 11.44 25.6 25.6v76.8h-51.2v-51.2z" />
58
  <glyph unicode="&#xf508;" glyph-name="availability" d="M384 435.2h-51.2v-51.2h51.2v51.2zM435.2 435.2h-25.6v-76.8h-102.4v76.8h-102.4v-76.8h-102.4v76.8h-25.6c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v230.4h307.2v-230.4zM179.2 435.2h-51.2v-51.2h51.2v51.2zM230.4 115.2l-76.4 76.4 29.12 29.12 47.28-47.28 98.8 98.8 29.2-29.040-128-128z" />
59
  <glyph unicode="&#xf509;" glyph-name="scoreboard" d="M435.2 25.6h-358.4c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6h358.4c14.16 0 25.6-11.44 25.6-25.6v-358.4c0-14.16-11.44-25.6-25.6-25.6zM409.6 384h-307.2v-307.2h307.2v307.2zM217.6 307.2l12.8-12.8v-51.2l-12.8-12.8 12.8-12.8v-51.2l-12.8-12.8h-64l-12.8 12.8v51.2l12.8 12.8-12.8 12.8v51.2l12.8 12.8h64zM166.4 179.2h38.4v38.4h-38.4v-38.4zM166.4 243.2h38.4v38.4h-38.4v-38.4zM256 268.8c7.040 0 12.8-5.76 12.8-12.8s-5.76-12.8-12.8-12.8-12.8 5.76-12.8 12.8 5.76 12.8 12.8 12.8zM256 217.6c7.040 0 12.8-5.76 12.8-12.8s-5.76-12.8-12.8-12.8-12.8 5.76-12.8 12.8 5.76 12.8 12.8 12.8zM358.4 307.2l12.8-12.8v-51.2l-12.8-12.8 12.8-12.8v-51.2l-12.8-12.8h-64l-12.8 12.8v51.2l12.8 12.8-12.8 12.8v51.2l12.8 12.8h64zM307.2 179.2h38.4v38.4h-38.4v-38.4zM307.2 243.2h38.4v38.4h-38.4v-38.4z" />
7
  <font-face units-per-em="512" ascent="480" descent="-32" />
8
  <missing-glyph horiz-adv-x="512" />
9
  <glyph unicode="&#x20;" horiz-adv-x="256" d="" />
10
+ <glyph unicode="&#xe0d3;" glyph-name="stay_current_landscape" d="M405 320.333h-298v-214h298v214zM22 320.333q0 17 12.5 29.5t29.5 12.5h384q17 0 30-12.5t13-29.5v-214q0-17-13-29.5t-30-12.5h-384q-17 0-30 12.5t-13 29.5z" />
11
  <glyph unicode="&#xe600;" glyph-name="soccer" d="M256 6.4c-127.28 0-230.4 103.12-230.4 230.4s103.12 230.4 230.4 230.4 230.4-103.12 230.4-230.4-103.12-230.4-230.4-230.4zM401.040 381.84c-18.32 18.24-40.080 32.88-65.44 43.6s-51.84 16.16-79.6 16.16-54.24-5.36-79.6-16.16-47.2-25.28-65.44-43.6-32.88-40.080-43.6-65.44-16.16-51.84-16.16-79.6 5.36-54.24 16.16-79.6 25.28-47.2 43.6-65.44c18.32-18.24 40.080-32.88 65.44-43.6s51.84-16.16 79.6-16.16 54.24 5.36 79.6 16.16 47.2 25.36 65.44 43.6c18.24 18.32 32.88 40.080 43.6 65.44s16.16 51.84 16.16 79.6-5.36 54.24-16.16 79.6-25.36 47.2-43.6 65.44zM332.8 134.4l-25.6-64v-5.2c-16.8-5.040-33.84-7.6-51.2-7.6s-34.4 2.56-51.2 7.6v5.2l-25.6 64h-70c-18.96 27.2-29.44 57.2-31.6 90l50.4 38v76.8l-14 6.8c18.64 24 42.16 42.24 70.4 54.8l71.6-36 71.6 36c28.24-12.56 51.6-30.8 70-54.8l-13.6-6.8v-76.8l50.4-38c-2.16-32.8-12.64-62.8-31.6-90h-70zM256 300.8l-64-44 24.4-70.8h79.2l24.4 70.8-64 44z" />
12
  <glyph unicode="&#xe601;" glyph-name="baseball" d="M371.52 96.32c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0 0 0-0.080 0.080 0 0-0.080 0.080-0.080 0.080s0 0 0 0 0 0.080-0.080 0.080c0 0 0 0 0 0s0 0-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.16-0.16 0.24 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080-0.080 0.080-0.16 0.16v0c0 0-0.080 0.080-0.080 0.080s0 0 0 0-0.080 0.080-0.080 0.080v0c-0.080 0.080-0.16 0.16-0.24 0.24 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.32 0.32v0c-0.88 0.96-1.76 2-2.56 2.96l5.36 4.48c-4.96 6-9.6 12.32-13.76 18.88l-6.48-4.32c-1.36 2-2.64 4.080-3.92 6.16v0c0 0 0 0.080-0.080 0.080 0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.32 0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s0 0.080 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080-0.080 0.080 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0s0 0.080-0.080 0.080c0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0.080-0.080 0.080-0.080 0.16 0 0 0 0 0 0s-0.080 0.080-0.080 0.080c0 0 0 0 0 0-0.080 0.080-0.16 0.24-0.24 0.4 0 0 0 0 0 0 0 0.080-0.080 0.080-0.080 0.080s0 0 0 0c-0.080 0.16-0.16 0.24-0.24 0.4 0 0 0 0 0 0-2.96 4.96-5.68 10.080-8.16 15.36l7.52 3.6c-2.8 6.24-5.36 12.64-7.52 19.2l-7.92-2.72c-1.68 4.96-3.2 10-4.56 15.040 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080-0.080 0.16-0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16-0.080 0.24-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0 0 0.16-0.080 0.32-0.080 0.4 0 0 0 0 0 0-0.56 2.56-1.12 5.2-1.6 7.84l8.56 1.6c-1.12 6.48-1.92 13.040-2.4 19.68l-6.88-0.48v28.48l6.88-0.48c0.48 6.64 1.28 13.2 2.4 19.68l-8.56 1.6c0.48 2.64 1.040 5.28 1.6 7.84 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16v0c0 0.080 0.080 0.16 0.080 0.32 0 0 0 0 0 0 0 0.080 0 0.080 0 0.16 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.24 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 0 0.16 0.080 0.32 0.080 0.4 0 0 0 0 0 0 1.28 5.12 2.8 10.16 4.56 15.040l7.92-2.72c2.16 6.56 4.64 12.96 7.52 19.2l-7.52 3.6c2.48 5.28 5.2 10.4 8.16 15.36 0 0 0 0 0 0 0.080 0.16 0.16 0.24 0.24 0.4 0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.080s0 0 0 0c0.080 0.080 0.16 0.24 0.24 0.4 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0 0.080 0.080 0.080 0.080 0.16v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0.080 0.080 0.080c0 0 0 0.080 0.080 0.080 0 0 0 0 0 0.080 0 0 0 0 0 0.080 0 0 0 0.080 0 0.080s0 0 0 0.080c0 0 0 0.080 0 0.080s0 0 0 0c0 0.080 0.080 0.080 0.080 0.16 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.24 0.32 0 0 0 0 0 0s0 0.080 0.080 0.080v0c1.28 2.080 2.56 4.080 3.92 6.16l6.48-4.32c4.24 6.56 8.8 12.88 13.76 18.88l-5.36 4.48c0.88 1.040 1.68 2 2.56 2.96v0c0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.24 0.24v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080v0c0.080 0.080 0.080 0.080 0.16 0.16 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0 0 0.080 0.080 0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0.080 0 0 0 0.080 0.080 0.080 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080v0c0 0 0.080 0.080 0.080 0.080s0 0 0 0 0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.16 0.16 0.24 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 0.080 0.080 0.16 0.24 0.32 0.32 0 0 0 0 0 0s0.080 0.080 0.080 0.080c0 0 0 0 0 0 3.44 3.68 7.040 7.2 10.72 10.64-33.76 30.56-77.92 48.4-126.24 48.4s-92.48-17.84-126.24-47.28c3.68-3.36 7.28-6.96 10.72-10.64 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080c0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0 0 0.080-0.080 0 0 0.080-0.080 0.080-0.080s0 0 0 0 0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.16 0.16-0.24 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080v0c0.080-0.080 0.080-0.080 0.16-0.16v0c0 0 0.080-0.080 0.080-0.080s0 0 0 0 0.080-0.080 0.080-0.080v0c0.080-0.080 0.16-0.16 0.24-0.24 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.32-0.32v0c0.88-0.96 1.76-2 2.56-2.96l-5.36-4.48c4.96-6 9.6-12.32 13.76-18.88l6.48 4.32c1.36-2 2.64-4.080 3.92-6.16v0c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.32 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0 0 0-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0.080-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080 0.080-0.080 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0s0-0.080 0.080-0.080c0 0 0 0 0 0s0.080-0.080 0.080-0.080v0c0-0.080 0.080-0.080 0.080-0.16 0 0 0 0 0 0s0.080-0.080 0.080-0.080c0 0 0 0 0 0 0.080-0.080 0.16-0.24 0.24-0.4 0 0 0 0 0 0 0-0.080 0.080-0.080 0.080-0.080s0 0 0 0c0.080-0.16 0.16-0.24 0.24-0.4 0 0 0 0 0 0 2.96-4.96 5.68-10.080 8.16-15.36l-7.52-3.6c2.8-6.24 5.36-12.64 7.52-19.2l7.92 2.72c1.68-4.96 3.2-10 4.56-15.040 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32v0c0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080 0.080-0.16 0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16 0.080-0.24 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0-0.16 0.080-0.32 0.080-0.4 0 0 0 0 0 0 0.56-2.56 1.12-5.2 1.6-7.84l-8.56-1.6c1.12-6.48 1.92-13.040 2.4-19.68l6.88 0.48v-28.48l-6.88 0.48c-0.48-6.64-1.28-13.2-2.4-19.68l8.56-1.6c-0.48-2.64-1.040-5.28-1.6-7.84 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.080-0.080-0.16-0.080-0.32 0 0 0 0 0 0 0-0.080 0-0.080 0-0.16 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0 0-0.16-0.080-0.32-0.080-0.4 0 0 0 0 0 0-1.28-5.12-2.8-10.16-4.56-15.040l-7.92 2.72c-2.16-6.56-4.64-12.96-7.52-19.2l7.52-3.6c-2.48-5.28-5.2-10.4-8.16-15.36 0 0 0 0 0 0-0.080-0.16-0.16-0.24-0.24-0.4 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.080s0 0 0 0c-0.080-0.080-0.16-0.24-0.24-0.4 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0-0.080-0.080-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0-0.080 0 0 0 0 0-0.080 0 0 0-0.080 0-0.080s0 0 0-0.080c0 0 0-0.080-0.080-0.080 0 0 0 0 0 0 0-0.080-0.080-0.080-0.080-0.16 0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.24-0.32 0 0 0 0 0 0s0-0.080-0.080-0.080v0c-1.28-2.080-2.56-4.080-3.92-6.16l-6.48 4.32c-4.24-6.56-8.8-12.88-13.76-18.88l5.36-4.48c-0.88-1.040-1.68-2-2.56-2.96v0c-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.24-0.24v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080v0c-0.080-0.080-0.080-0.080-0.16-0.16v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0 0-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s0 0-0.080-0.080c0 0 0 0 0 0s0-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0 0 0-0.080-0.080 0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0-0.080 0 0 0 0-0.080-0.080 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080v0c0 0-0.080-0.080-0.080-0.080s0 0 0 0-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.16-0.16-0.24 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-0.080-0.080-0.16-0.24-0.32-0.32 0 0 0 0 0 0s-0.080-0.080-0.080-0.080c0 0 0 0 0 0-3.44-3.68-7.040-7.2-10.72-10.64 33.76-30.56 77.92-48.4 126.24-48.4s92.48 17.84 126.24 47.28c-3.76 3.44-7.28 6.96-10.72 10.64v0zM144.72 134l-6.8 4.56c4.56 6.72 8.64 13.92 12.080 21.28l6.96-3.28c0.64 1.36 1.2 2.72 1.76 4.080 1.92 4.56 3.68 9.2 5.2 13.84l-7.2 2.48c2.64 7.68 4.72 15.6 6.24 23.6l7.2-1.36c1.040 6.080 1.76 12.16 2.24 18.32l-7.2 0.56c0.32 4.080 0.4 8.16 0.4 12.24s-0.16 8.16-0.4 12.24l7.2 0.56c-0.4 6.16-1.2 12.32-2.24 18.32l-7.2-1.36c-1.44 8-3.6 15.92-6.24 23.6l7.2 2.48c-1.52 4.64-3.28 9.28-5.2 13.84-0.56 1.36-1.2 2.72-1.76 4.080l-6.96-3.28c-3.44 7.36-7.52 14.48-12.080 21.28l6.8 4.56c-3.92 6.16-8.24 12.080-12.96 17.76l-6.88-5.84c-4.72 5.6-9.84 10.96-15.28 15.84-28.48-33.28-45.6-76.64-45.6-124s17.12-90.72 45.52-124.16c5.44 4.96 10.56 10.24 15.28 15.84l6.88-5.84c4.8 5.68 9.12 11.6 13.040 17.76v0zM402.48 354.56c-5.44-4.96-10.56-10.24-15.28-15.84l-6.88 5.84c-4.72-5.68-9.040-11.6-12.96-17.76l6.8-4.56c-4.56-6.72-8.64-13.92-12.080-21.28l-6.96 3.28c-0.64-1.36-1.2-2.72-1.76-4.080-1.92-4.56-3.68-9.2-5.2-13.84l7.2-2.48c-2.64-7.68-4.72-15.6-6.24-23.6l-7.2 1.36c-1.040-6.080-1.76-12.16-2.24-18.32l7.2-0.56c-0.32-4.080-0.4-8.16-0.4-12.24s0.16-8.16 0.4-12.24l-7.2-0.56c0.4-6.16 1.2-12.32 2.24-18.32l7.2 1.36c1.44-8 3.6-15.92 6.24-23.6l-7.2-2.48c1.52-4.64 3.28-9.28 5.2-13.84 0.56-1.36 1.2-2.72 1.76-4.080l6.96 3.28c3.44-7.36 7.52-14.48 12.080-21.28l-6.8-4.56c3.92-6.16 8.24-12.080 12.96-17.76l6.88 5.84c4.72-5.6 9.84-10.96 15.28-15.84 28.4 33.44 45.52 76.8 45.52 124.16s-17.12 90.56-45.52 124z" />
13
  <glyph unicode="&#xe602;" glyph-name="basketball" d="M460.4 256c-2.8 42.080-19.12 80.4-44.64 110.72-3.040-2.56-5.92-5.28-8.72-8.16-27.76-27.76-44.32-63.84-47.28-102.56h100.64zM395.6 387.36c-30.8 27.12-70.4 44.56-114 47.44v-178.8h49.2c3.44 52.24 27.84 98.8 64.8 131.36zM130.64 358.56c-2.8 2.8-5.76 5.52-8.72 8.16-25.6-30.32-41.92-68.64-44.72-110.72h100.64c-2.96 38.8-19.44 74.8-47.2 102.56zM206.8 256h49.2v178.8c-43.6-2.88-83.2-20.24-114-47.44 36.96-32.56 61.36-79.12 64.8-131.36zM407.040 127.76c2.8-2.8 5.76-5.52 8.72-8.16 25.52 30.32 41.84 68.72 44.64 110.72h-100.72c3.040-38.72 19.52-74.72 47.36-102.56zM330.8 230.4h-49.2v-178.8c43.6 2.88 83.2 20.24 114 47.44-36.96 32.56-61.36 79.12-64.8 131.36zM77.2 230.4c2.8-42.080 19.040-80.4 44.64-110.72 3.040 2.56 5.92 5.28 8.72 8.16 27.76 27.76 44.32 63.84 47.28 102.64 0.080-0.080-100.64-0.080-100.64-0.080zM142 99.040c30.8-27.12 70.4-44.56 114-47.44v178.8h-49.2c-3.44-52.24-27.84-98.8-64.8-131.36z" />
32
  <glyph unicode="&#xf181;" glyph-name="bracket-center" d="M435.2 205.2h51.2c14.16 0 25.6-11.44 25.6-25.6v-102.4c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v76.8h-25.6v-25.6c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v25.6h-25.6v-76.8c0-14.16-11.44-25.6-25.6-25.6h-51.2v-25.6c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-25.6h25.6v153.6h-25.6v-25.6c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v102.4c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-76.8h25.6v25.6c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-25.6h25.6v76.8c0 14.16 11.44 25.6 25.6 25.6h51.2v25.6c0 14.16 11.44 25.6 25.6 25.6h51.2c14.16 0 25.6-11.44 25.6-25.6v-102.4c0-14.16-11.44-25.6-25.6-25.6h-51.2c-14.16 0-25.6 11.44-25.6 25.6v25.6h-25.6v-153.6h25.6v25.6c0 14.16 11.44 25.6 25.6 25.6z" />
33
  <glyph unicode="&#xf182;" glyph-name="trash" d="M288 256h64v-160h-64zM480 384h-128v64c0 17.688-14.312 32-32 32h-128c-17.688 0-32-14.312-32-32v-64h-128c-17.688 0-32-14.312-32-32v-32h32v-320c0-17.688 14.312-32 32-32h384c17.688 0 32 14.312 32 32v320h32v32c0 17.688-14.312 32-32 32zM224 416h64v-32h-64v32zM416 32h-320v288h320v-288zM160 256h64v-160h-64z" />
34
  <glyph unicode="&#xf185;" glyph-name="chart" d="M76.8 102.4h102.4v204.8h-102.4v-204.8zM204.8 102.4h102.4v307.2h-102.4v-307.2zM332.8 307.2v-204.8h102.4v204.8h-102.4z" />
35
+ <glyph unicode="&#xf203;" glyph-name="timeline" d="M457.2 70l-54.8-41.6c-2.4-1.84-5.44-2.8-8.96-2.8s-6.56 0.96-8.96 2.8v22.8h-186.88c-4.56-7.76-10.64-13.92-18.4-18.56s-16.24-7.040-25.6-7.040c-14.16 0-26.24 4.96-36.16 15.040s-15.040 22-15.040 36.16c0 14.16 4.96 26.24 15.040 36.16s22 15.040 36.16 15.040c9.36 0 17.84-2.32 25.6-7.040s13.84-10.88 18.4-18.56h186.8v23.2c2.4 1.84 5.44 2.8 8.96 2.8s6.56-0.96 8.96-2.8l54.8-41.6c2.4-1.84 3.6-4.16 3.6-7.040s-1.12-5.12-3.52-6.96zM351.2 336c-2.4-2.16-5.44-3.2-8.96-3.2s-6.56 1.040-8.96 3.2v22.4h-186.88c-4.56-7.76-10.64-13.92-18.4-18.56s-16.24-7.040-25.6-7.040c-14.16 0-26.24 4.96-36.16 15.040s-15.040 22-15.040 36.16 4.96 26.24 15.040 36.16 22 15.040 36.16 15.040c9.36 0 17.84-2.32 25.6-7.040s13.84-10.88 18.4-18.56h186.8v23.2c2.4 1.84 5.44 2.8 8.96 2.8s6.64-0.96 9.040-2.8l54.8-41.6c2.4-1.84 3.6-4.16 3.6-6.8s-1.2-5.040-3.6-7.2l-54.8-41.2zM128 281.6c9.36 0 17.84-2.32 25.6-7.040 7.76-4.64 13.84-10.88 18.4-18.56h91.2c4.56 7.76 10.64 13.92 18.4 18.56s16.24 7.040 25.6 7.040c14.16 0 26.24-4.96 36.16-15.040s15.040-22 15.040-36.16c0-14.16-4.96-26.24-15.040-36.16s-22-15.040-36.16-15.040c-9.36 0-17.84 2.32-25.6 7.040s-13.84 10.88-18.4 18.56h-91.2c-4.56-7.76-10.64-13.92-18.4-18.56s-16.24-7.040-25.6-7.040c-14.16 0-26.24 4.96-36.16 15.040s-15.040 22-15.040 36.16c0 14.16 4.96 26.24 15.040 36.16s22 15.040 36.16 15.040zM307.36 204.8c7.040 0 13.040 2.56 18 7.6s7.36 11.12 7.36 18.24c0 7.040-2.48 13.040-7.36 18s-10.96 7.36-18 7.36-13.12-2.48-18.24-7.36-7.6-10.96-7.6-18c0-7.040 2.56-13.12 7.6-18.24s11.2-7.6 18.24-7.6z" />
36
  <glyph unicode="&#xf227;" glyph-name="whistle" d="M301.84 256c3.44-12.24 5.36-25.12 5.36-38.4 0-77.76-63.040-140.8-140.8-140.8s-140.8 63.040-140.8 140.8 63.040 140.8 140.8 140.8h89.6v-25.6c0-14.16 11.44-25.6 25.6-25.6s25.6 11.44 25.6 25.6v25.6h179.2v-102.4h-184.56z" />
37
+ <glyph unicode="&#xf237;" glyph-name="minimal" d="M358 204.8v-76.8c0-14.16-11.44-25.6-25.6-25.6h-128v-25.6c0-14.16-11.44-25.6-25.6-25.6h-128v51.2h102.4v51.2h-102.4v51.2h128c14.16 0 25.6-11.44 25.6-25.6v-25.6h102.4v153.6h-102.4v-25.6c0-14.16-11.44-25.6-25.6-25.6h-128v51.2h102.4v51.2h-102.4v51.2h128c14.16 0 25.6-11.44 25.6-25.6v-25.6h128c14.16 0 25.6-11.44 25.6-25.6v-76.8h102.4v-51.2h-102.4z" />
38
  <glyph unicode="&#xf307;" glyph-name="tshirt" d="M459.6 307.2h-76.8v-179.2h-256v179.2h-76.8v102.4h132.4c10.56-29.84 38.96-51.2 72.4-51.2s61.84 21.36 72.4 51.2h132.4v-102.4zM382.8 102.4v-51.2h-256v51.2h256z" />
39
  <glyph unicode="&#xf309;" glyph-name="color" d="M435.2 204.8c0-98.96-80.24-179.2-179.2-179.2s-179.2 80.24-179.2 179.2c0 49.52 20.080 94.32 52.48 126.72v0l126.72 126.72 126.72-126.72c32.4-32.4 52.48-77.2 52.48-126.72zM343.28 298l-87.44 87.44-89.040-89.040c-23.84-23.28-38.8-55.6-38.8-91.6 0-70.72 57.28-128 128-128s128 57.28 128 128c0 36.88-15.76 69.84-40.72 93.2zM256 102.4l0.080 246.8 70.4-70.4c19.6-18.64 31.92-44.8 31.92-74 0-56.56-45.84-102.4-102.4-102.4z" />
40
  <glyph unicode="&#xf313;" glyph-name="tournament" d="M384 286v149.2h25.6c14.16 0 25.6-11.44 25.6-25.6v-51.2c0-33.44-21.36-61.84-51.2-72.4zM153.6 51.52h204.8v-51.52h-204.8v51.52zM179.2 76.8l25.6 25.6h25.6v25.6l25.6 25.6 25.6-25.6v-25.6h25.6l25.6-25.6h-153.6zM256 179.2c-56.56 0-102.4 45.84-102.4 102.4v179.2h204.8v-179.2c0-56.56-45.84-102.4-102.4-102.4zM76.8 358.4v51.2c0 14.16 11.44 25.6 25.6 25.6h25.6v-149.2c-29.84 10.56-51.2 38.96-51.2 72.4z" />
51
  <glyph unicode="&#xf338;" glyph-name="staff" d="M409.6 25.6h-307.2c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6h307.2c14.16 0 25.6-11.44 25.6-25.6v-358.4c0-14.16-11.44-25.6-25.6-25.6zM332.8 384h-153.6l51.2-51.2-51.2-204.8 76.8-76.8 76.8 76.8-51.2 204.8 51.2 51.2z" />
52
  <glyph unicode="&#xf453;" glyph-name="cake" d="M434.8 51.12h-358.4c-14.16 0-25.6 11.44-25.6 25.6s11.44 25.6 25.6 25.6v78.24c16.24-16.64 38.88-27.040 64-27.040 22.080 0 42 8.24 57.6 21.52 15.6-13.2 35.52-21.52 57.6-21.52s42 8.24 57.6 21.52c15.6-13.2 35.52-21.52 57.6-21.52 25.12 0 47.76 10.4 64 27.040v-78.24c14.16 0 25.6-11.44 25.6-25.6 0-14.080-11.44-25.6-25.6-25.6zM370.8 179.12c-25.52 0-47.28 15.040-57.6 36.56-10.32-21.6-32.080-36.56-57.6-36.56s-47.28 15.040-57.6 36.56c-10.32-21.6-32.080-36.56-57.6-36.56-32.4 0-58.96 24.16-63.12 55.44 2.080 12 12.080 21.36 24.72 21.36h307.2c12.64 0 22.64-9.28 24.72-21.36-4.16-31.2-30.72-55.44-63.12-55.44v0zM255.76 294.24c-15.2 0-26.48 3.2-33.84 9.6s-11.040 18-11.040 34.72c0 6.64 1.6 14.64 4.88 23.84s6.8 17.68 10.8 25.28c3.92 7.6 8.48 15.52 13.6 23.84s8.72 13.92 10.8 16.8 3.68 5.2 4.88 6.96l4.64-6.64c3.040-4.24 6.8-10.080 11.28-17.28s8.88-14.96 13.2-23.2 8.080-16.8 11.12-25.92 4.64-16.96 4.64-23.6c0-16.72-3.68-28.32-11.040-34.72-7.44-6.48-18.72-9.68-33.92-9.68v0z" />
53
  <glyph unicode="&#xf464;" glyph-name="edit" d="M435.2 25.6h-358.4c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6h256l-51.2-51.2h-179.2v-307.2h307.2v179.2l51.2 51.2v-256c0-14.16-11.44-25.6-25.6-25.6zM153.6 128v76.8l230.4 230.4h25.6l51.2-51.2v-25.6l-230.4-230.4h-76.8zM268.8 217.6l140.8 140.8-25.6 25.6-140.8-140.8 25.6-25.6zM204.8 204.8l-25.6-25.6v-25.6h25.6l25.6 25.6-25.6 25.6z" />
54
+ <glyph unicode="&#xf469;" glyph-name="time" d="M188.8 313.76c-11.44-7.040 30.64-108.56 40.88-125.12 8.96-14.56 28-18.96 42.48-10.080 14.56 9.040 19.040 28 10.080 42.48-10.16 16.56-82 99.76-93.44 92.72v0zM180.24 424.88c23.76 8.24 49.2 12.88 75.76 12.88s52-4.56 75.76-12.88c8.4-2.88 19.6 2.96 14.64 15.68-3.6 9.2-7.12 18.24-8.48 21.92-3.36 8.64-15.36 15.84-20.56 17.040-19.76 4.48-40.24 6.96-61.28 6.96s-41.52-2.48-61.36-6.96c-5.2-1.2-17.2-8.32-20.56-17.040-1.44-3.68-4.88-12.64-8.48-21.92-5.040-12.72 6.080-18.56 14.56-15.68v0zM488.88 404.8c-4.88 5.92-10.16 11.68-15.68 17.2s-11.28 10.72-17.12 15.68c-3.92 3.28-15.44 6-22.72-1.28s-42.16-42.16-42.16-42.16c10.32-7.36 20.32-15.52 29.6-24.72s17.36-19.28 24.72-29.6c0 0 34.88 34.88 42.16 42.16 7.2 7.36 4.48 18.88 1.2 22.72v0zM256 412.16c-114.56 0-207.36-92.8-207.36-207.36-0.080-114.56 92.72-207.36 207.36-207.36 114.48 0 207.36 92.8 207.36 207.36 0 114.48-92.88 207.36-207.36 207.36v0zM256 48.64c-86.24 0-156.16 69.92-156.16 156.16s69.84 156.16 156.16 156.16c86.24 0 156.16-69.92 156.16-156.16s-69.92-156.16-156.16-156.16z" />
55
  <glyph unicode="&#xf481;" glyph-name="clipboard" d="M376.16 25.6h-238.080c-20.48 0-35.84 15.36-35.84 35.84v312.32c0 10.24 5.12 20.48 12.8 28.16l28.16-66.56h225.28l28.16 69.12c7.68-5.12 12.8-15.36 12.8-28.16v-312.32c2.56-23.040-15.36-38.4-33.28-38.4zM358.24 307.2h-204.8v-230.4h204.8v230.4zM332.64 230.4h-153.6v25.6h153.6v-25.6zM332.64 179.2h-153.6v25.6h153.6v-25.6zM332.64 128h-153.6v25.6h153.6v-25.6zM163.68 358.4l-23.040 51.2h56.32l7.68 20.48 10.24 30.72h81.92l10.24-30.72 10.24-20.48h56.32l-23.040-51.2h-186.88z" />
56
  <glyph unicode="&#xf488;" glyph-name="sponsor" d="M405.2 82.080l-91.2 71.6h-134.8v-76.8c0-7.2-2.56-13.28-7.6-18.24s-11.040-7.36-18-7.36h-25.6c-7.2 0-13.28 2.48-18.24 7.36s-7.36 11.040-7.36 18.24v76.8c-7.2 0-13.28 2.48-18.24 7.36s-7.36 11.040-7.36 18.24v102.4c0 7.2 2.48 13.28 7.36 18.24s11.040 7.36 18.24 7.36h211.6l91.2 71.6c2.96 3.2 6.88 4.88 11.84 4.96s9.2-0.88 12.8-3.040c3.6-2.16 5.44-4.8 5.44-8v-285.2c0-3.2-1.76-5.84-5.44-8s-7.84-3.040-12.8-2.8c-5.040 0.4-8.88 2.080-11.84 5.28v0zM268.8 307.28h-51.2c3.44 0 6.48-1.28 8.96-3.84s3.84-5.52 3.84-8.96v-128c0-3.44-1.28-6.48-3.84-8.96s-5.52-3.84-8.96-3.84h51.2c-3.76 0-6.8 1.28-9.2 3.84s-3.6 5.52-3.6 8.96v128c0 3.44 1.2 6.48 3.6 8.96s5.36 3.84 9.2 3.84v0 0 0z" />
57
  <glyph unicode="&#xf489;" glyph-name="statistics" d="M153.6 333.2h128v-51.2h-128v51.2zM153.6 256.4h51.2v-51.2h-51.2v51.2zM153.6 179.6h102.4v-51.2h-102.4v51.2zM281.6 179.6h76.8v-51.2h-76.8v51.2zM435.2 435.6h-358.4c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 77.2h-307.2v307.2h307.2v-307.2zM230.4 256.4h128v-51.2h-128v51.2zM307.2 333.2h51.2v-51.2h-51.2v51.2z" />
58
+ <glyph unicode="&#xf503;" glyph-name="sub" d="M409.6 353.28h-256v51.2l-102.4-87.040 102.4-81.92v46.080h256v71.68zM460.8 138.24l-102.4 87.040v-51.2h-256v-71.68h256v-46.080l102.4 81.92z" />
59
  <glyph unicode="&#xf504;" glyph-name="popup" d="M435.2 435.2h-204.8c-14.16 0-25.6-11.44-25.6-25.6v-204.8c0-14.16 11.44-25.6 25.6-25.6h204.8c14.16 0 25.6 11.44 25.6 25.6v204.8c0 14.16-11.44 25.6-25.6 25.6zM409.6 230.4h-153.6v153.6h153.6v-153.6zM256 76.8h-153.6v153.6h51.2v51.2h-76.8c-14.16 0-25.6-11.44-25.6-25.6v-204.8c0-14.16 11.44-25.6 25.6-25.6h204.8c14.16 0 25.6 11.44 25.6 25.6v76.8h-51.2v-51.2z" />
60
  <glyph unicode="&#xf508;" glyph-name="availability" d="M384 435.2h-51.2v-51.2h51.2v51.2zM435.2 435.2h-25.6v-76.8h-102.4v76.8h-102.4v-76.8h-102.4v76.8h-25.6c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v230.4h307.2v-230.4zM179.2 435.2h-51.2v-51.2h51.2v51.2zM230.4 115.2l-76.4 76.4 29.12 29.12 47.28-47.28 98.8 98.8 29.2-29.040-128-128z" />
61
  <glyph unicode="&#xf509;" glyph-name="scoreboard" d="M435.2 25.6h-358.4c-14.16 0-25.6 11.44-25.6 25.6v358.4c0 14.16 11.44 25.6 25.6 25.6h358.4c14.16 0 25.6-11.44 25.6-25.6v-358.4c0-14.16-11.44-25.6-25.6-25.6zM409.6 384h-307.2v-307.2h307.2v307.2zM217.6 307.2l12.8-12.8v-51.2l-12.8-12.8 12.8-12.8v-51.2l-12.8-12.8h-64l-12.8 12.8v51.2l12.8 12.8-12.8 12.8v51.2l12.8 12.8h64zM166.4 179.2h38.4v38.4h-38.4v-38.4zM166.4 243.2h38.4v38.4h-38.4v-38.4zM256 268.8c7.040 0 12.8-5.76 12.8-12.8s-5.76-12.8-12.8-12.8-12.8 5.76-12.8 12.8 5.76 12.8 12.8 12.8zM256 217.6c7.040 0 12.8-5.76 12.8-12.8s-5.76-12.8-12.8-12.8-12.8 5.76-12.8 12.8 5.76 12.8 12.8 12.8zM358.4 307.2l12.8-12.8v-51.2l-12.8-12.8 12.8-12.8v-51.2l-12.8-12.8h-64l-12.8 12.8v51.2l12.8 12.8-12.8 12.8v51.2l12.8 12.8h64zM307.2 179.2h38.4v38.4h-38.4v-38.4zM307.2 243.2h38.4v38.4h-38.4v-38.4z" />
assets/fonts/sportspress.ttf CHANGED
Binary file
assets/fonts/sportspress.woff CHANGED
Binary file
assets/fonts/sportspress.woff2 CHANGED
Binary file
assets/images/flags/gib.png ADDED
Binary file
assets/images/modules/rookie.png DELETED
Binary file
assets/images/welcome/rookie.png ADDED
Binary file
assets/js/admin/colorpicker.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+
3
+ // Color picker
4
+ $('.colorpick').iris( {
5
+ change: function(event, ui){
6
+ $(this).css( { backgroundColor: ui.color.toString() } );
7
+ },
8
+ hide: true,
9
+ border: true
10
+ } ).each( function() {
11
+ $(this).css( { backgroundColor: $(this).val() } );
12
+ })
13
+ .click(function(){
14
+ $('.iris-picker').hide();
15
+ $(this).closest('.sp-color-box, td').find('.iris-picker').show();
16
+ });
17
+
18
+ $('body').click(function() {
19
+ $('.iris-picker').hide();
20
+ });
21
+
22
+ $('.sp-color-box, .colorpick').click(function(event){
23
+ event.stopPropagation();
24
+ });
25
+
26
+ });
assets/js/admin/quickeditor.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+
3
+ // we create a copy of the WP inline edit post function
4
+ var $wp_inline_edit = inlineEditPost.edit;
5
+
6
+ // and then we overwrite the function with our own code
7
+ inlineEditPost.edit = function( id ) {
8
+
9
+ // "call" the original WP edit function
10
+ // we don't want to leave WordPress hanging
11
+ $wp_inline_edit.apply( this, arguments );
12
+
13
+ // now we take care of our business
14
+
15
+ // get the post ID
16
+ var $post_id = 0;
17
+ if ( typeof( id ) == 'object' ) {
18
+ $post_id = parseInt( this.getId( id ) );
19
+ }
20
+
21
+ if ( $post_id > 0 ) {
22
+ // define the edit row
23
+ var $edit_row = $( '#edit-' + $post_id );
24
+ var $post_row = $( '#post-' + $post_id );
25
+
26
+ // get the data
27
+ var $number = $( '.column-sp_number', $post_row ).text();
28
+ var $current_teams = String( $( '.column-sp_team', $post_row ).find( '.sp-player-teams' ).data( 'current-teams' ) ).split(',');
29
+ var $past_teams = String( $( '.column-sp_team', $post_row ).find( '.sp-player-teams' ).data( 'past-teams' ) ).split(',');
30
+
31
+ // populate the data
32
+ $( ':input[name="sp_number"]', $edit_row ).val( $number );
33
+ $( ':input[name="sp_current_team[]"]', $edit_row ).each(function() {
34
+ $(this).prop("checked", ($.inArray($(this).val(), $current_teams ) != -1));
35
+ });
36
+ $( ':input[name="sp_past_team[]"]', $edit_row ).each(function() {
37
+ $(this).prop("checked", ($.inArray($(this).val(), $past_teams ) != -1));
38
+ });
39
+ }
40
+ };
41
+
42
+ $( document ).on( 'click', '#bulk_edit', function() {
43
+ // define the bulk edit row
44
+ var $bulk_row = $( '#bulk-edit' );
45
+
46
+ // get the selected post ids that are being edited
47
+ var $post_ids = new Array();
48
+ $bulk_row.find( '#bulk-titles' ).children().each( function() {
49
+ $post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) );
50
+ });
51
+
52
+ // get the data
53
+ var $current_teams = [];
54
+ $bulk_row.find( 'input[name="sp_current_team[]"]:checked' ).each(function() {
55
+ $current_teams.push( $(this).val() );
56
+ });
57
+
58
+ var $past_teams = [];
59
+ $bulk_row.find( 'input[name="sp_past_team[]"]:checked' ).each(function() {
60
+ $past_teams.push( $(this).val() );
61
+ });
62
+
63
+ // save the data
64
+ $.ajax({
65
+ url: ajaxurl, // this is a variable that WordPress has already defined for us
66
+ type: 'POST',
67
+ async: false,
68
+ cache: false,
69
+ data: {
70
+ action: 'save_bulk_edit_sp_player',
71
+ post_ids: $post_ids,
72
+ current_teams: $current_teams,
73
+ past_teams: $past_teams,
74
+ nonce: $("#sp_player_edit_nonce").val()
75
+ }
76
+ });
77
+ });
78
+
79
+ })(jQuery);
assets/js/admin/sportspress-admin.js CHANGED
@@ -24,9 +24,11 @@ jQuery(document).ready(function($){
24
 
25
  // Auto key placeholder
26
  $("#poststuff #title").on("keyup", function() {
27
- val = $(this).val().replace(/[^a-z]/gi,"").toLowerCase();
28
- $("#sp_key").attr("placeholder", val);
29
- $("#sp_default_key").val(val);
 
 
30
  });
31
 
32
  // Activate auto key placeholder
@@ -196,7 +198,7 @@ jQuery(document).ready(function($){
196
  placeholder += adjustment - current_adjustment;
197
  }
198
  $el.attr("placeholder", placeholder);
199
- });
200
 
201
  // Data table keyboard navigation
202
  $(".sp-data-table tbody tr td input:text").keydown(function(event) {
@@ -364,21 +366,27 @@ jQuery(document).ready(function($){
364
  // Format selector
365
  $(".sp-format-selector select:first").change(function() {
366
 
367
- $precisionselector = $(".sp-precision-selector input:first");
 
 
368
  $equationdiv = $("#sp_equationdiv");
369
 
370
- // Precision settings
371
- if($(this).val() == "decimal" || $(this).val() == "time") {
372
- $precisionselector.prop( "disabled", false );
373
- } else {
374
- $precisionselector.prop( "disabled", true )
375
- }
376
-
377
  // Equation settings
378
- if($(this).val() == "equation") {
379
  $equationdiv.show();
 
 
 
 
 
 
 
 
380
  } else {
381
  $equationdiv.hide();
 
 
 
382
  }
383
 
384
  });
@@ -821,4 +829,22 @@ jQuery(document).ready(function($){
821
  $select.find('input[value='+val+']').attr('checked', true);
822
  $select.slideUp('fast').siblings('.sp-edit-event-status').show();
823
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
  });
24
 
25
  // Auto key placeholder
26
  $("#poststuff #title").on("keyup", function() {
27
+ val = $(this).val()
28
+ lc = val.replace(/[^a-z]/gi,"").toLowerCase();
29
+ $("#sp_key").attr("placeholder", lc);
30
+ $("#sp_default_key").val(lc);
31
+ $("#sp_singular").attr("placeholder", val);
32
  });
33
 
34
  // Activate auto key placeholder
198
  placeholder += adjustment - current_adjustment;
199
  }
200
  $el.attr("placeholder", placeholder);
201
+ }).change();
202
 
203
  // Data table keyboard navigation
204
  $(".sp-data-table tbody tr td input:text").keydown(function(event) {
366
  // Format selector
367
  $(".sp-format-selector select:first").change(function() {
368
 
369
+ $precisiondiv = $("#sp_precisiondiv");
370
+ $precisioninput = $("#sp_precision");
371
+ $timeddiv = $("#sp_timeddiv");
372
  $equationdiv = $("#sp_equationdiv");
373
 
 
 
 
 
 
 
 
374
  // Equation settings
375
+ if ($(this).val() == "equation") {
376
  $equationdiv.show();
377
+ $precisiondiv.show();
378
+ $timeddiv.hide();
379
+ $precisioninput.prop( "disabled", false );
380
+ } else if ($(this).val() == "number") {
381
+ $equationdiv.hide();
382
+ $precisiondiv.hide();
383
+ $timeddiv.show();
384
+ $precisioninput.prop( "disabled", true );
385
  } else {
386
  $equationdiv.hide();
387
+ $precisiondiv.hide();
388
+ $timeddiv.hide();
389
+ $precisioninput.prop( "disabled", true );
390
  }
391
 
392
  });
829
  $select.find('input[value='+val+']').attr('checked', true);
830
  $select.slideUp('fast').siblings('.sp-edit-event-status').show();
831
  });
832
+
833
+ // Box score time converter
834
+ $('.sp-convert-time-input').change(function() {
835
+ var s = 0;
836
+ var val = $(this).val();
837
+ if (val === '') {
838
+ $(this).siblings('.sp-convert-time-output').val('');
839
+ return;
840
+ }
841
+ var a = val.split(':').reverse();
842
+ $.each(a, function( index, value ) {
843
+ s += parseInt(value) * Math.pow(60, index);
844
+ });
845
+ $(this).siblings('.sp-convert-time-output').val(s);
846
+ });
847
+
848
+ // Trigger box score time converter
849
+ $('.sp-convert-time-input').change();
850
  });
assets/js/sportspress.js CHANGED
@@ -25,6 +25,22 @@ function sp_viewport() {
25
  });
26
  });
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /* API method to get paging information */
29
  $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
30
  {
@@ -76,20 +92,4 @@ function sp_viewport() {
76
  }
77
  });
78
 
79
- /* Scrollable Tables */
80
- $(".sp-scrollable-table").wrap("<div class=\"sp-scrollable-table-wrapper\"></div>");
81
-
82
- /* Selector Redirect */
83
- $(".sp-selector-redirect").change(function() {
84
- window.location = $(this).val();
85
- });
86
-
87
- /* Template Tabs */
88
- $(".sp-tab-menu-item a").click(function() {
89
- $template = $(this).data("sp-tab");
90
- $(this).closest(".sp-tab-menu-item").addClass("sp-tab-menu-item-active").siblings(".sp-tab-menu-item").removeClass("sp-tab-menu-item-active");
91
- $(this).closest(".sp-tab-group").find(".sp-tab-content-"+$template).show().siblings(".sp-tab-content").hide();
92
- return false;
93
- });
94
-
95
  })(jQuery);
25
  });
26
  });
27
 
28
+ /* Scrollable Tables */
29
+ $(".sp-scrollable-table").wrap("<div class=\"sp-scrollable-table-wrapper\"></div>");
30
+
31
+ /* Selector Redirect */
32
+ $(".sp-selector-redirect").change(function() {
33
+ window.location = $(this).val();
34
+ });
35
+
36
+ /* Template Tabs */
37
+ $(".sp-tab-menu-item a").click(function() {
38
+ $template = $(this).data("sp-tab");
39
+ $(this).closest(".sp-tab-menu-item").addClass("sp-tab-menu-item-active").siblings(".sp-tab-menu-item").removeClass("sp-tab-menu-item-active");
40
+ $(this).closest(".sp-tab-group").find(".sp-tab-content-"+$template).show().siblings(".sp-tab-content").hide();
41
+ return false;
42
+ });
43
+
44
  /* API method to get paging information */
45
  $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
46
  {
92
  }
93
  });
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  })(jQuery);
changelog.txt CHANGED
@@ -1,5 +1,153 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 2.1.1 =
4
  * Feature - Add substitution times in box score.
5
  * Feature - Add text options to change template tab names.
1
  == SportsPress Changelog ==
2
 
3
+ = 2.2.10 =
4
+ * Tweak - Update modules page.
5
+ * Fix - League table discrepancy due to change in number of teams setting.
6
+ * Fix - JavaScript error caused by box score displaying icons without players.
7
+
8
+ = 2.2.9 =
9
+ * Fix - Warning message above player list template.
10
+
11
+ = 2.2.8 =
12
+ * Fix - Hidden box score header in values mode.
13
+ * Fix - Welcome page displaying after upgrade if preset was saved from settings.
14
+ * Fix - Decimal places being dropped from player list statistics.
15
+
16
+ = 2.2.7 =
17
+ * Tweak - Adjust frontend styles to allow some overrides.
18
+ * Tweak - Update modules page with new module options.
19
+ * Fix - Javascript error in icon mode box scores.
20
+ * Fix - Player list default sorting issue.
21
+ * Fix - Empty team checkboxes in player quick edit.
22
+
23
+ = 2.2.6 =
24
+ * Tweak - Hide box score table header row in icon mode.
25
+ * Tweak - Adjust frontend stylesheet.
26
+ * Fix - Empty league tables when no columns are selected.
27
+ * Fix - Empty player lists when no columns are selected.
28
+ * Fix - Link events setting not applied to box score time.
29
+ * Fix - Player list sorting error with non-numeric values.
30
+ * Fix - Home and away records being combined when opponent not in league table.
31
+
32
+ = 2.2.5 =
33
+ * Feature - Enable positions to be displayed in icons mode box score.
34
+ * Tweak - Reflect mixed column order in player list admin.
35
+ * Tweak - Remove table row border in frontend stylesheet.
36
+ * Tweak - Automatically apply table adjustments on admin page load.
37
+ * Tweak - Simplify box score icon totals.
38
+ * Fix - Adjustments not applying to player list values.
39
+ * Fix - Minutes not displaying in box score.
40
+ * Fix - Player positions displaying not displaying in box score.
41
+ * Fix - Total time displaying as 0:00.
42
+
43
+ = 2.2.4 =
44
+ * Feature - Option to show or hide career totals in player profiles.
45
+ * Tweak - Icons not rendering when frontend stylesheet is active.
46
+ * Tweak - Remove underline from icon links in frontend stylesheet.
47
+ * Tweak - Change competition and season placeholders in events to "None".
48
+ * Tweak - Enable horizontal scrolling on large tables in admin.
49
+ * Fix - Equations returning zero when no events played.
50
+ * Fix - Player lists and player profiles showing different statistics when filtered by competition or season.
51
+ * Fix - Substitution icon not rendering for starting lineup players.
52
+ * Fix - Manual player performance errors in profile.
53
+ * Fix - Error in event results if team was deleted.
54
+ * Fix - Remove deprecated function in PHP 7.0.
55
+ * Fix - Non-numeric errors in PHP 7.1.
56
+
57
+ = 2.2.3 =
58
+ * Fix - Placeholders for non-numeric values in player list displaying as zero.
59
+
60
+ = 2.2.2 =
61
+ * Tweak - Center align form events.
62
+ * Fix - Reverse form array to display events in chronological order.
63
+ * Fix - Error in player lists when querying legacy events.
64
+ * Fix - Manual values in player lists when no events have been played.
65
+
66
+ = 2.2.1 =
67
+ * Fix - Empty timeline error when calculating substitution time.
68
+
69
+ = 2.2 =
70
+ * Feature - New frontend stylesheet for third-party themes.
71
+ * Feature - New chronological streak format in league tables.
72
+ * Feature - Head to head tiebreaker option in league tables.
73
+ * Feature - Add option to select number of players in player lists.
74
+ * Feature - Quick edit player's team and squad number.
75
+ * Feature - Bulk edit players' past and current teams.
76
+ * Feature - Taxonomies added to REST API.
77
+ * Feature - Ability to display event history in player profiles.
78
+ * Feature - Event list format option added to player and team events.
79
+ * Feature - Option to record minutes for specific statistics.
80
+ * Feature - Time format added for racing and timed sports.
81
+ * Feature - Dedicated option to redirect team pages to site URL.
82
+ * Feature - Bulk action to generate team calendars.
83
+ * Feature - Automatically adjust played minutes based on substitution times.
84
+ * Feature - Match day column option added to event lists.
85
+ * Tweak - Remove event limit in calendars.
86
+ * Tweak - Allow player squad number to be zero.
87
+ * Tweak - Enable mixing performance and statistic column order.
88
+ * Tweak - Filter player statistic equations by offense and defense.
89
+ * Tweak - System status hidden unless in debug mode.
90
+ * Tweak - Move event list column options to sidebar.
91
+ * Tweak - Return zero instead of error if dividing by zero.
92
+ * Tweak - Always display performance icons in admin.
93
+ * Tweak - Add preview notation in event blocks by default.
94
+ * Tweak - Single player performance name option added for hover text in icons mode.
95
+ * Fix - Player list precision number format error.
96
+ * Fix - Player list adjustments for existing values.
97
+ * Fix - Hide empty positions in player lists and galleries.
98
+ * Fix - Import button selectors disappeared in WordPress 4.7.
99
+ * Fix - Substitution time missing parentheses.
100
+ * Fix - Staff for home team not being displayed in events.
101
+ * Fix - Enable output of time and results without team names in home/away mode.
102
+ * Fix - Prevent totals override in box scores.
103
+ * Localization - Add Gibraltar nationality option and flag.
104
+
105
+ = 2.1.7 =
106
+ * Fix - Activation error on older versions of PHP.
107
+
108
+ = 2.1.6 =
109
+ * Feature - Add equation format option to player performance.
110
+ * Tweak - Add text options to change tab labels.
111
+ * Fix - Activation errors using TGMPA.
112
+ * Fix - Empty footer column in team staff table.
113
+ * Preset - Update basketball preset.
114
+
115
+ = 2.1.5 =
116
+ * Feature - Add option to filter players by current or past team in player lists.
117
+ * Fix - Scheduled events not queried in REST API.
118
+
119
+ = 2.1.4 =
120
+ * Feature - Player and staff dropdown templates added to layout designer.
121
+ * Tweak - Default tab labels from layout designer.
122
+ * Tweak - Add "Home" and "Away" to text options.
123
+ * Tweak - Add horizontal padding to centered event list columns.
124
+ * Fix - Disable numeric slug generation for events due to permalink issues in some cases.
125
+ * Fix - Permalink issues caused by filter for scheduled events.
126
+ * Fix - Scheduled events being ignored by REST API.
127
+ * Fix - Inconsistent styling of player and staff dropdowns.
128
+ * Fix - Only include current players in player lists.
129
+ * Fix - Age calculation in BuddyPress context.
130
+
131
+ = 2.1.3 =
132
+ * Tweak - Add options to select number, team, and position columns to player list shortcode.
133
+ * Fix - Totals row offset in player statistics admin.
134
+ * Fix - Events not automatically ordered by date in some cases.
135
+ * Fix - Google Maps error when address is empty.
136
+ * Fix - Player lists for all teams not appearing in team edit screen.
137
+ * Fix - Error in player list when team no longer exists.
138
+ * Fix - Error in event logos when results are empty.
139
+ * Fix - Issue with link to future event from daily archive when multiple events are scheduled for a single day.
140
+
141
+ = 2.1.2 =
142
+ * Feature - Add offense and defense statistics to REST API.
143
+ * Tweak - Hide template tabs with no content.
144
+ * Tweak - Allow selection of player lists without teams.
145
+ * Tweak - Center-align time/results when between home and away teams in event list.
146
+ * Tweak - Increase checklist panel height in admin.
147
+ * Tweak - Update text options.
148
+ * Fix - Hidden box score columns still displaying when in offense/defense mode.
149
+ * Preset - Update cricket preset.
150
+
151
  = 2.1.1 =
152
  * Feature - Add substitution times in box score.
153
  * Feature - Add text options to change template tab names.
dummy-data/events-sample.csv CHANGED
@@ -1 +1 @@
1
- Date,Time,Venue,Teams,Results,Outcome,Players,Goals,Assists,Yellow Cards,Red Cards
1
+ Date,Time,Venue,Teams,Results,Outcome,Players,Goals,Assists,Yellow Cards,Red Cards
includes/admin/class-sp-admin-assets.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -94,8 +94,12 @@ class SP_Admin_Assets {
94
 
95
  wp_register_script( 'sportspress-admin-equationbuilder', SP()->plugin_url() . '/assets/js/admin/equationbuilder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable' ), SP_VERSION, true );
96
 
 
 
97
  wp_register_script( 'sportspress-admin-widgets', SP()->plugin_url() . '/assets/js/admin/widgets.js', array( 'jquery' ), SP_VERSION, true );
98
 
 
 
99
  // SportsPress admin pages
100
  if ( in_array( $screen->id, sp_get_screen_ids() ) || strpos( $screen->id, 'sportspress-config' )) {
101
  wp_enqueue_script( 'jquery' );
@@ -135,10 +139,20 @@ class SP_Admin_Assets {
135
  wp_enqueue_script( 'sportspress-admin-locationpicker' );
136
  }
137
 
 
 
 
 
 
138
  // Edit equation
139
  if ( in_array( $screen->id, array( 'sp_result', 'sp_performance', 'sp_column', 'sp_statistic' ) ) ) {
140
  wp_enqueue_script( 'sportspress-admin-equationbuilder' );
141
  }
 
 
 
 
 
142
  }
143
  }
144
 
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
94
 
95
  wp_register_script( 'sportspress-admin-equationbuilder', SP()->plugin_url() . '/assets/js/admin/equationbuilder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable' ), SP_VERSION, true );
96
 
97
+ wp_register_script( 'sportspress-admin-colorpicker', SP()->plugin_url() . '/assets/js/admin/colorpicker.js', array( 'jquery', 'wp-color-picker', 'iris' ), SP_VERSION, true );
98
+
99
  wp_register_script( 'sportspress-admin-widgets', SP()->plugin_url() . '/assets/js/admin/widgets.js', array( 'jquery' ), SP_VERSION, true );
100
 
101
+ wp_register_script( 'sportspress-admin-quickeditor', SP()->plugin_url() . '/assets/js/admin/quickeditor.js', array( 'jquery' ), SP_VERSION, true );
102
+
103
  // SportsPress admin pages
104
  if ( in_array( $screen->id, sp_get_screen_ids() ) || strpos( $screen->id, 'sportspress-config' )) {
105
  wp_enqueue_script( 'jquery' );
139
  wp_enqueue_script( 'sportspress-admin-locationpicker' );
140
  }
141
 
142
+ // Edit color
143
+ if ( in_array( $screen->id, array( 'sp_outcome' ) ) ) {
144
+ wp_enqueue_script( 'sportspress-admin-colorpicker' );
145
+ }
146
+
147
  // Edit equation
148
  if ( in_array( $screen->id, array( 'sp_result', 'sp_performance', 'sp_column', 'sp_statistic' ) ) ) {
149
  wp_enqueue_script( 'sportspress-admin-equationbuilder' );
150
  }
151
+
152
+ // Quick edit
153
+ if ( in_array( $screen->id, array( 'edit-sp_player' ) ) ) {
154
+ wp_enqueue_script( 'sportspress-admin-quickeditor' );
155
+ }
156
  }
157
  }
158
 
includes/admin/class-sp-admin-settings.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -50,7 +50,9 @@ class SP_Admin_Settings {
50
  $settings[] = include( 'settings/class-sp-settings-licenses.php' );
51
  }
52
 
53
- if ( current_user_can( 'manage_options' ) ) $settings[] = include( 'settings/class-sp-settings-status.php' );
 
 
54
 
55
  self::$settings = apply_filters( 'sportspress_get_settings_config_pages', $settings );
56
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
50
  $settings[] = include( 'settings/class-sp-settings-licenses.php' );
51
  }
52
 
53
+ if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG && current_user_can( 'manage_options' ) ) {
54
+ $settings[] = include( 'settings/class-sp-settings-status.php' );
55
+ }
56
 
57
  self::$settings = apply_filters( 'sportspress_get_settings_config_pages', $settings );
58
  }
includes/admin/class-sp-admin-sports.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress admin sports class stores preset sport data.
6
  *
7
  * @class SP_Admin_Sports
8
- * @version 2.1.6
9
  * @package SportsPress/Admin
10
  * @category Class
11
  * @author ThemeBoy
@@ -157,12 +157,14 @@ class SP_Admin_Sports {
157
  if ( isset( $performance['position'] ) ) {
158
  wp_set_object_terms( $id, $performance['position'], 'sp_position', false );
159
  }
 
160
  update_post_meta( $id, 'sp_icon', sp_array_value( $performance, 'icon', null ) );
161
  update_post_meta( $id, 'sp_color', sp_array_value( $performance, 'color', null ) );
162
  update_post_meta( $id, 'sp_section', sp_array_value( $performance, 'section', -1 ) );
163
  update_post_meta( $id, 'sp_format', sp_array_value( $performance, 'format', 'number' ) );
164
  update_post_meta( $id, 'sp_equation', sp_array_value( $performance, 'equation', null ) );
165
  update_post_meta( $id, 'sp_precision', sp_array_value( $performance, 'precision', 0 ) );
 
166
  $i ++;
167
  }
168
 
5
  * The SportsPress admin sports class stores preset sport data.
6
  *
7
  * @class SP_Admin_Sports
8
+ * @version 2.2
9
  * @package SportsPress/Admin
10
  * @category Class
11
  * @author ThemeBoy
157
  if ( isset( $performance['position'] ) ) {
158
  wp_set_object_terms( $id, $performance['position'], 'sp_position', false );
159
  }
160
+ update_post_meta( $id, 'sp_singular', sp_array_value( $performance, 'singular', null ) );
161
  update_post_meta( $id, 'sp_icon', sp_array_value( $performance, 'icon', null ) );
162
  update_post_meta( $id, 'sp_color', sp_array_value( $performance, 'color', null ) );
163
  update_post_meta( $id, 'sp_section', sp_array_value( $performance, 'section', -1 ) );
164
  update_post_meta( $id, 'sp_format', sp_array_value( $performance, 'format', 'number' ) );
165
  update_post_meta( $id, 'sp_equation', sp_array_value( $performance, 'equation', null ) );
166
  update_post_meta( $id, 'sp_precision', sp_array_value( $performance, 'precision', 0 ) );
167
+ update_post_meta( $id, 'sp_timed', sp_array_value( $performance, 'timed', null ) );
168
  $i ++;
169
  }
170
 
includes/admin/class-sp-admin-welcome.php CHANGED
@@ -9,7 +9,7 @@
9
  * @author ThemeBoy
10
  * @category Admin
11
  * @package SportsPress/Admin
12
- * @version 2.1.6
13
  */
14
 
15
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -161,6 +161,7 @@ class SP_Admin_Welcome {
161
  $sport = $_POST['sportspress_sport'];
162
  SP_Admin_Sports::apply_preset( $sport );
163
  update_option( 'sportspress_sport', $_POST['sportspress_sport'] );
 
164
  update_option( 'sportspress_installed', 1 );
165
  ?>
166
  <div id="message" class="updated sportspress-message">
@@ -175,49 +176,95 @@ class SP_Admin_Welcome {
175
  ?>
176
  <?php if ( get_option( 'sportspress_installed' ) ) { ?>
177
 
178
- <div class="headline-feature feature-video sp-fitvids" style="background-color:#191E23;">
179
- <iframe width="990" height="557" src="https://www.youtube.com/embed/KQyga_C5a6M?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
180
- </div>
181
 
182
- <hr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
 
184
  <div class="feature-section three-col">
185
- <h2>Event Organization</h2>
186
  <div class="col">
187
- <img src="https://www.themeboy.com/wp-content/uploads/match-days.png" alt="Match Days"/>
188
- <h3>Match Days</h3>
189
- <p>A match day can be added to any event and displayed directly inside the event details section. It can also be used as a filter for shortcodes and widgets.</p>
190
  </div>
191
  <div class="col">
192
- <img src="https://www.themeboy.com/wp-content/uploads/event-status.gif" alt="Event Status"/>
193
- <h3>Event Status</h3>
194
- <p>For undecided, postponed, and cancelled events, a status can be displayed in place of the time. Leave the status alone to display the actual time of the event.</p>
195
  </div>
196
  <div class="col">
197
- <img src="https://www.themeboy.com/wp-content/uploads/box-score-minutes.png" alt="Box Score Minutes"/>
198
- <h3>Box Score Minutes</h3>
199
- <p>You can now can enter the time of goals or any other statistic for each player, and display them directly within the box score section of event pages.</p>
200
  </div>
201
  </div>
202
 
203
  <hr>
204
 
205
- <div class="feature-section three-col">
206
- <h2>Layout Enhancements</h2>
207
  <div class="col">
208
- <img src="https://www.themeboy.com/wp-content/uploads/template-tabs.gif" alt=""/>
209
- <h3>Template Tabs</h3>
210
- <p>Simply drag and drop any of the layout items to automatically group them into tabs. This will make your templates more compact and intuitive.</p>
211
  </div>
212
  <div class="col">
213
- <img src="https://www.themeboy.com/wp-content/uploads/event-logo-options.png" alt=""/>
214
- <h3>Event Logo Options</h3>
215
- <p>Display the teams playing using an inline layout or as a block section, with logos on either side and the date and time/results in the middle.</p>
216
  </div>
217
- <div class="col">
218
- <img src="https://www.themeboy.com/wp-content/uploads/player-profile-switching.png" alt=""/>
219
- <h3>Player Profile Switching</h3>
220
- <p>We also added a dropdown above the player details box which allows your visitors to quickly switch to another player's profile.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  </div>
222
  </div>
223
 
@@ -227,20 +274,22 @@ class SP_Admin_Welcome {
227
  <h2>Under the Hood</h2>
228
  <div class="under-the-hood three-col">
229
  <div class="col">
230
- <h3>Fixtures Importer</h3>
231
- <p>A new, simpler importer has been added for quickly scheduling events. Supports CSV files generated by <a href="http://tboy.co/leaguelobster" target="_blank">LeagueLobster</a>.</p>
232
  </div>
233
  <div class="col">
234
- <h3>Tutorials for Everyone</h3>
235
- <p>If you've enabled the Tutorials module, all SportsPress users will now be able to access them from the dashboard.</p>
236
  </div>
237
  <div class="col">
238
- <h3>REST API Improvements</h3>
239
- <p>The REST API has been updated to support meta query vars, allowing you to retrieve data for a specific team or player.</p>
240
  </div>
241
  </div>
242
  </div>
243
 
 
 
244
  <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
245
 
246
  <?php } else { ?>
@@ -287,7 +336,7 @@ class SP_Admin_Welcome {
287
  $settings = array(
288
  array(
289
  'id' => 'sportspress_sport',
290
- 'default' => 'custom',
291
  'type' => 'sport',
292
  'title' => __( 'Sport', 'sportspress' ),
293
  'welcome' => true,
@@ -309,7 +358,7 @@ class SP_Admin_Welcome {
309
  <?php if ( current_user_can( 'install_themes' ) && ! current_theme_supports( 'sportspress' ) ) { ?>
310
  <div class="last-feature">
311
  <h4><?php _e( 'Free SportsPress Theme', 'sportspress' ); ?></h4>
312
- <a href="<?php echo add_query_arg( array( 'theme' => 'rookie' ), network_admin_url( 'theme-install.php' ) ); ?>" class="sp-theme-screenshot"><img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>/assets/images/modules/rookie.png"></a>
313
  <p><?php _e( 'Have you tried the free Rookie theme yet?', 'sportspress' ); ?></p>
314
  <p><?php _e( 'Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress' ); ?></p>
315
  <p class="sp-module-actions">
9
  * @author ThemeBoy
10
  * @category Admin
11
  * @package SportsPress/Admin
12
+ * @version 2.2.10
13
  */
14
 
15
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
161
  $sport = $_POST['sportspress_sport'];
162
  SP_Admin_Sports::apply_preset( $sport );
163
  update_option( 'sportspress_sport', $_POST['sportspress_sport'] );
164
+ delete_option( '_sp_needs_welcome' );
165
  update_option( 'sportspress_installed', 1 );
166
  ?>
167
  <div id="message" class="updated sportspress-message">
176
  ?>
177
  <?php if ( get_option( 'sportspress_installed' ) ) { ?>
178
 
179
+ <?php do_action( 'sportspress_before_welcome_features' ); ?>
 
 
180
 
181
+ <?php if ( ! current_theme_supports( 'sportspress' ) ) { ?>
182
+
183
+ <div class="feature-section two-col">
184
+ <h2>New Frontend Stylesheet</h2>
185
+ <div class="col">
186
+ <img src="https://www.themeboy.com/wp-content/uploads/player-profile-style.jpg" alt="Templates">
187
+ <h3>Templates</h3>
188
+ <p>An optional default stylesheet has been added to enhance the design of SportsPress template elements in third-party themes.</p>
189
+ </div>
190
+ <div class="col">
191
+ <img src="https://www.themeboy.com/wp-content/uploads/event-blocks-style.png" alt="Widgets">
192
+ <h3>Widgets</h3>
193
+ <p>All related content including widgets can be styled instantly by enabling <strong>Frontend Styles</strong> in <a href="<?php echo add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), admin_url( 'admin.php' ) ); ?>">General Options</a>.</p>
194
+ </div>
195
+ </div>
196
+
197
+ <hr>
198
+
199
+ <?php } ?>
200
 
201
  <div class="feature-section three-col">
202
+ <h2>More Advanced Statistics</h2>
203
  <div class="col">
204
+ <img src="https://www.themeboy.com/wp-content/uploads/chronological-streaks.png" alt="Chronological Streaks">
205
+ <h3>Chronological Streaks</h3>
206
+ <p>A new <strong>Form</strong> preset variable has been added to the equation builder for table columns. Use this variable to display the most recent outcomes with each outcome linking to that event.</p>
207
  </div>
208
  <div class="col">
209
+ <img src="https://www.themeboy.com/wp-content/uploads/tiebreaker-setting.gif" alt="Head to Head Tiebreakers">
210
+ <h3>Head to Head Tiebreakers</h3>
211
+ <p>When two or more teams are tied in the general standings, SportsPress can now automatically analyze the events between those teams to determine who comes out on top.</p>
212
  </div>
213
  <div class="col">
214
+ <img src="https://www.themeboy.com/wp-content/uploads/time-format.png" alt="Time Format">
215
+ <h3>Time Format</h3>
216
+ <p>A new <strong>Time</strong> format has been added to player performance settings. Times are saved as minutes, and displayed using time format with <em>0:00</em> as the default.</p>
217
  </div>
218
  </div>
219
 
220
  <hr>
221
 
222
+ <div class="feature-section two-col">
223
+ <h2>Bulk Actions</h2>
224
  <div class="col">
225
+ <img src="https://www.themeboy.com/wp-content/uploads/bulk-team-calendars.gif" alt="Generate Team Calendars">
226
+ <h3>Generate Team Calendars</h3>
227
+ <p>Bulk actions has been added to instantly generate team calendars. Simply select the checkboxes next to each team, then choose <strong>Generate Calendars</strong> from the <strong>Bulk Actions</strong> dropdown and voilà!</p>
228
  </div>
229
  <div class="col">
230
+ <img src="https://www.themeboy.com/wp-content/uploads/bulk-player-teams.png" alt="Assign Teams to Players">
231
+ <h3>Assign Teams to Players</h3>
232
+ <p>Quickly add players to teams using the <strong>Bulk Edit</strong> feature. New sections have been added to select the current teams and past teams for multiple players at once.</p>
233
  </div>
234
+ </div>
235
+
236
+ <hr />
237
+
238
+ <div class="changelog">
239
+ <h2>Admin Improvements</h2>
240
+ <div class="under-the-hood three-col">
241
+ <div class="col">
242
+ <h3>Player List Limits</h3>
243
+ <p>A limit option has been added to player lists when automatically adding players, enabling speedier queries.</p>
244
+ </div>
245
+ <div class="col">
246
+ <h3>Mixed Statistic Columns</h3>
247
+ <p>The order of player performance and statistics can now be mixed together by editing the order of each variable.</p>
248
+ </div>
249
+ <div class="col">
250
+ <h3>Explicit Team URL Redirect</h3>
251
+ <p>Decide whether to use native team pages or to redirect teams to their external URLs using the new <strong>Redirect</strong> option.</p>
252
+ </div>
253
+ </div>
254
+
255
+ <div class="under-the-hood three-col">
256
+ <div class="col">
257
+ <h3>Quick Edit Players</h3>
258
+ <p>In addition to editing the teams a player belongs to, squad numbers can also be updated via the <strong>Quick Edit</strong> menu</p>
259
+ </div>
260
+ <div class="col">
261
+ <h3>Independent Timed Option</h3>
262
+ <p>Choose which values in the box score need minutes recorded, with an independent setting for each column.</p>
263
+ </div>
264
+ <div class="col">
265
+ <h3>Taxonomies in REST API</h3>
266
+ <p>New endpoints have been added for taxonomies including seasons, competitions, venues, positions, and jobs.</p>
267
+ </div>
268
  </div>
269
  </div>
270
 
274
  <h2>Under the Hood</h2>
275
  <div class="under-the-hood three-col">
276
  <div class="col">
277
+ <h3>Variables Filtered by Offense and Defense</h3>
278
+ <p>Offense and defense statistics are now calculated using only the player performance from the same category.</p>
279
  </div>
280
  <div class="col">
281
+ <h3>Account for Substitution Time</h3>
282
+ <p>The <strong>Minutes</strong> equation variable is now automatically adjusted by subtracting substitution time.</p>
283
  </div>
284
  <div class="col">
285
+ <h3>Division by Zero</h3>
286
+ <p>No more errors when dividing by zero. Equations with undefined solutions now simply return zero for that value.</p>
287
  </div>
288
  </div>
289
  </div>
290
 
291
+ <?php do_action( 'sportspress_after_welcome_features' ); ?>
292
+
293
  <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to SportsPress Settings', 'sportspress' ); ?></a>
294
 
295
  <?php } else { ?>
336
  $settings = array(
337
  array(
338
  'id' => 'sportspress_sport',
339
+ 'default' => get_option( 'sportspress_sport', 'custom' ),
340
  'type' => 'sport',
341
  'title' => __( 'Sport', 'sportspress' ),
342
  'welcome' => true,
358
  <?php if ( current_user_can( 'install_themes' ) && ! current_theme_supports( 'sportspress' ) ) { ?>
359
  <div class="last-feature">
360
  <h4><?php _e( 'Free SportsPress Theme', 'sportspress' ); ?></h4>
361
+ <a href="<?php echo add_query_arg( array( 'theme' => 'rookie' ), network_admin_url( 'theme-install.php' ) ); ?>" class="sp-theme-screenshot"><img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>/assets/images/welcome/rookie.png"></a>
362
  <p><?php _e( 'Have you tried the free Rookie theme yet?', 'sportspress' ); ?></p>
363
  <p><?php _e( 'Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress' ); ?></p>
364
  <p class="sp-module-actions">
includes/admin/class-sp-admin.php CHANGED
@@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
10
  * @author ThemeBoy
11
  * @category Admin
12
  * @package SportsPress/Admin
13
- * @version 2.1
14
  */
15
  class SP_Admin {
16
 
@@ -98,7 +98,7 @@ class SP_Admin {
98
  ?>
99
  <script type="text/javascript">
100
  (function($) {
101
- $(".wrap .page-title-action:first-child").after(
102
  $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_fixture_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import Fixtures', 'sportspress' ); ?></a>")
103
  ).after(
104
  $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_event_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import Events', 'sportspress' ); ?></a>")
@@ -110,7 +110,7 @@ class SP_Admin {
110
  ?>
111
  <script type="text/javascript">
112
  (function($) {
113
- $(".wrap .page-title-action:first-child").after(
114
  $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => $typenow . '_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import', 'sportspress' ); ?></a>")
115
  );
116
  })(jQuery);
10
  * @author ThemeBoy
11
  * @category Admin
12
  * @package SportsPress/Admin
13
+ * @version 2.2
14
  */
15
  class SP_Admin {
16
 
98
  ?>
99
  <script type="text/javascript">
100
  (function($) {
101
+ $(".wrap .page-title-action").first().after(
102
  $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_fixture_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import Fixtures', 'sportspress' ); ?></a>")
103
  ).after(
104
  $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_event_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import Events', 'sportspress' ); ?></a>")
110
  ?>
111
  <script type="text/javascript">
112
  (function($) {
113
+ $(".wrap .page-title-action").first().after(
114
  $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => $typenow . '_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import', 'sportspress' ); ?></a>")
115
  );
116
  })(jQuery);
includes/admin/post-types/class-sp-admin-cpt-player.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
- * @version 1.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -29,13 +29,22 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
29
  // Post title fields
30
  add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
31
 
32
- // Admin Columns
33
  add_filter( 'manage_edit-sp_player_columns', array( $this, 'edit_columns' ) );
34
  add_action( 'manage_sp_player_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );
35
 
36
  // Filtering
37
  add_action( 'restrict_manage_posts', array( $this, 'filters' ) );
38
  add_filter( 'parse_query', array( $this, 'filters_query' ) );
 
 
 
 
 
 
 
 
 
39
 
40
  // Call SP_Admin_CPT constructor
41
  parent::__construct();
@@ -86,12 +95,17 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
86
  echo get_the_terms( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : '&mdash;';
87
  break;
88
  case 'sp_team':
 
 
 
 
 
89
  $teams = (array)get_post_meta( $post_id, 'sp_team', false );
90
  $teams = array_filter( $teams );
 
91
  if ( empty( $teams ) ):
92
  echo '&mdash;';
93
  else:
94
- $current_teams = get_post_meta( $post_id, 'sp_current_team', false );
95
  foreach( $teams as $team_id ):
96
  if ( ! $team_id ) continue;
97
  $team = get_post( $team_id );
@@ -186,6 +200,167 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
186
  }
187
  }
188
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
190
 
191
  endif;
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
+ * @version 2.2.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
29
  // Post title fields
30
  add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
31
 
32
+ // Admin columns
33
  add_filter( 'manage_edit-sp_player_columns', array( $this, 'edit_columns' ) );
34
  add_action( 'manage_sp_player_posts_custom_column', array( $this, 'custom_columns' ), 2, 2 );
35
 
36
  // Filtering
37
  add_action( 'restrict_manage_posts', array( $this, 'filters' ) );
38
  add_filter( 'parse_query', array( $this, 'filters_query' ) );
39
+
40
+ // Quick edit
41
+ add_action( 'quick_edit_custom_box', array( $this, 'quick_edit_number' ), 10, 2 );
42
+ add_action( 'quick_edit_custom_box', array( $this, 'quick_edit_teams' ), 10, 2 );
43
+ add_action( 'save_post', array( $this, 'quick_save' ) );
44
+
45
+ // Bulk edit
46
+ add_action( 'bulk_edit_custom_box', array( $this, 'bulk_edit_teams' ), 10, 2 );
47
+ add_action( 'wp_ajax_save_bulk_edit_sp_player', array( $this, 'bulk_save' ) );
48
 
49
  // Call SP_Admin_CPT constructor
50
  parent::__construct();
95
  echo get_the_terms( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : '&mdash;';
96
  break;
97
  case 'sp_team':
98
+ $current_teams = get_post_meta( $post_id, 'sp_current_team', false );
99
+ $past_teams = get_post_meta( $post_id, 'sp_past_team', false );
100
+ $current_teams = array_filter( $current_teams );
101
+ $past_teams = array_filter( $past_teams );
102
+ echo '<span class="hidden sp-player-teams" data-current-teams="' . implode( ',', $current_teams ) . '" data-past-teams="' . implode( ',', $past_teams ) . '"></span>';
103
  $teams = (array)get_post_meta( $post_id, 'sp_team', false );
104
  $teams = array_filter( $teams );
105
+ $teams = array_unique( $teams );
106
  if ( empty( $teams ) ):
107
  echo '&mdash;';
108
  else:
 
109
  foreach( $teams as $team_id ):
110
  if ( ! $team_id ) continue;
111
  $team = get_post( $team_id );
200
  }
201
  }
202
  }
203
+
204
+ /**
205
+ * Quick edit squad number
206
+ *
207
+ * @param string $column_name
208
+ * @param string $post_type
209
+ */
210
+ public function quick_edit_number( $column_name, $post_type ) {
211
+ if ( $this->type !== $post_type ) return;
212
+ if ( 'sp_number' !== $column_name ) return;
213
+
214
+ static $print_nonce = true;
215
+ if ( $print_nonce ) {
216
+ $print_nonce = false;
217
+ wp_nonce_field( plugin_basename( __FILE__ ), 'sp_player_edit_nonce' );
218
+ }
219
+ ?>
220
+ <fieldset class="inline-edit-col-right">
221
+ <div class="inline-edit-col">
222
+ <label>
223
+ <span class="title"><?php _e( 'Squad Number', 'sportspress' ); ?></span>
224
+ <span class="input-text-wrap"><input type="text" name="sp_number" class="inline-edit-menu-order-input"></span>
225
+ </label>
226
+ </div>
227
+ </fieldset>
228
+ <?php
229
+ }
230
+
231
+ /**
232
+ * Quick edit teams
233
+ *
234
+ * @param string $column_name
235
+ * @param string $post_type
236
+ */
237
+ public function quick_edit_teams( $column_name, $post_type ) {
238
+ if ( $this->type !== $post_type ) return;
239
+ if ( 'sp_team' !== $column_name ) return;
240
+
241
+ $teams = get_posts( array(
242
+ 'post_type' => 'sp_team',
243
+ 'numberposts' => -1,
244
+ 'post_status' => 'publish',
245
+ ) );
246
+
247
+ if ( ! $teams ) return;
248
+ ?>
249
+ <fieldset class="inline-edit-col-right">
250
+ <div class="inline-edit-col">
251
+ <span class="title inline-edit-categories-label"><?php _e( 'Current Teams', 'sportspress' ); ?></span>
252
+ <input type="hidden" name="sp_current_team[]" value="0">
253
+ <ul class="cat-checklist">
254
+ <?php foreach ( $teams as $team ) { ?>
255
+ <li><label class="selectit"><input value="<?php echo $team->ID; ?>" type="checkbox" name="sp_current_team[]"> <?php echo $team->post_title; ?></label></li>
256
+ <?php } ?>
257
+ </ul>
258
+ <span class="title inline-edit-categories-label"><?php _e( 'Past Teams', 'sportspress' ); ?></span>
259
+ <input type="hidden" name="sp_past_team[]" value="0">
260
+ <ul class="cat-checklist">
261
+ <?php foreach ( $teams as $team ) { ?>
262
+ <li><label class="selectit"><input value="<?php echo $team->ID; ?>" type="checkbox" name="sp_past_team[]"> <?php echo $team->post_title; ?></label></li>
263
+ <?php } ?>
264
+ </ul>
265
+ </div>
266
+ </fieldset>
267
+ <?php
268
+ }
269
+
270
+ /**
271
+ * Save quick edit boxes
272
+ *
273
+ * @param int $post_id
274
+ */
275
+ public function quick_save( $post_id ) {
276
+ if ( empty( $_POST ) ) return $post_id;
277
+ if ( ! current_user_can( 'edit_post', $post_id ) ) return $post_id;;
278
+
279
+ $_POST += array( "{$this->type}_edit_nonce" => '' );
280
+ if ( ! wp_verify_nonce( $_POST["{$this->type}_edit_nonce"], plugin_basename( __FILE__ ) ) ) return $post_id;;
281
+
282
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id;
283
+ if ( isset( $post->post_type ) && $post->post_type == 'revision' ) return $post_id;
284
+
285
+ if ( isset( $_POST[ 'sp_number' ] ) ) {
286
+ update_post_meta( $post_id, 'sp_number', $_POST[ 'sp_number' ] );
287
+ }
288
+
289
+ sp_update_post_meta_recursive( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', array() ) );
290
+ sp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array() ) );
291
+ sp_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sp_array_value( $_POST, 'sp_current_team', array() ) ), sp_array_value( $_POST, 'sp_past_team', array() ) ) );
292
+ }
293
+
294
+ /**
295
+ * Bulk edit teams
296
+ *
297
+ * @param string $column_name
298
+ * @param string $post_type
299
+ */
300
+ public function bulk_edit_teams( $column_name, $post_type ) {
301
+ if ( $this->type !== $post_type ) return;
302
+ if ( 'sp_team' !== $column_name ) return;
303
+
304
+ static $print_nonce = true;
305
+ if ( $print_nonce ) {
306
+ $print_nonce = false;
307
+ wp_nonce_field( plugin_basename( __FILE__ ), 'sp_player_edit_nonce' );
308
+ }
309
+
310
+ $teams = get_posts( array(
311
+ 'post_type' => 'sp_team',
312
+ 'numberposts' => -1,
313
+ 'post_status' => 'publish',
314
+ ) );
315
+
316
+ if ( ! $teams ) return;
317
+ ?>
318
+ <fieldset class="inline-edit-col-right">
319
+ <div class="inline-edit-col">
320
+ <span class="title inline-edit-categories-label"><?php _e( 'Current Teams', 'sportspress' ); ?></span>
321
+ <input type="hidden" name="sp_current_team[]" value="0">
322
+ <ul class="cat-checklist">
323
+ <?php foreach ( $teams as $team ) { ?>
324
+ <li><label class="selectit"><input value="<?php echo $team->ID; ?>" type="checkbox" name="sp_current_team[]"> <?php echo $team->post_title; ?></label></li>
325
+ <?php } ?>
326
+ </ul>
327
+ <span class="title inline-edit-categories-label"><?php _e( 'Past Teams', 'sportspress' ); ?></span>
328
+ <input type="hidden" name="sp_past_team[]" value="0">
329
+ <ul class="cat-checklist">
330
+ <?php foreach ( $teams as $team ) { ?>
331
+ <li><label class="selectit"><input value="<?php echo $team->ID; ?>" type="checkbox" name="sp_past_team[]"> <?php echo $team->post_title; ?></label></li>
332
+ <?php } ?>
333
+ </ul>
334
+ </div>
335
+ </fieldset>
336
+ <?php
337
+ }
338
+
339
+ /**
340
+ * Save bulk edit boxes
341
+ */
342
+ public function bulk_save() {
343
+ $_POST += array( "nonce" => '' );
344
+ if ( ! wp_verify_nonce( $_POST["nonce"], plugin_basename( __FILE__ ) ) ) return;
345
+
346
+ $post_ids = ( ! empty( $_POST[ 'post_ids' ] ) ) ? $_POST[ 'post_ids' ] : array();
347
+
348
+ $current_teams = sp_array_value( $_POST, 'current_teams', array() );
349
+ $past_teams = sp_array_value( $_POST, 'past_teams', array() );
350
+ $teams = array_merge( $current_teams, $past_teams );
351
+
352
+ if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
353
+ foreach ( $post_ids as $post_id ) {
354
+ if ( ! current_user_can( 'edit_post', $post_id ) ) continue;
355
+
356
+ sp_add_post_meta_recursive( $post_id, 'sp_current_team', $current_teams );
357
+ sp_add_post_meta_recursive( $post_id, 'sp_past_team', $past_teams );
358
+ sp_add_post_meta_recursive( $post_id, 'sp_team', $teams );
359
+ }
360
+ }
361
+
362
+ die();
363
+ }
364
  }
365
 
366
  endif;
includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Calendar Columns
4
+ *
5
+ * @author ThemeBoy
6
+ * @category Admin
7
+ * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
+
13
+ /**
14
+ * SP_Meta_Box_Calendar_Columns
15
+ */
16
+ class SP_Meta_Box_Calendar_Columns {
17
+
18
+ /**
19
+ * Output the metabox
20
+ */
21
+ public static function output( $post ) {
22
+ $selected = (array) get_post_meta( $post->ID, 'sp_columns', true );
23
+ $title_format = get_option( 'sportspress_event_list_title_format', 'title' );
24
+ $time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
25
+
26
+ if ( is_array( $selected ) ) {
27
+ $selected = array_filter( $selected );
28
+ }
29
+
30
+ $columns = array();
31
+
32
+ if ( 'teams' === $title_format ) {
33
+ $columns[ 'event' ] = __( 'Home', 'sportspress' ) . ' | ' . __( 'Away', 'sportspress' );
34
+ } elseif ( 'homeaway' === $title_format ) {
35
+ $columns[ 'event' ] = __( 'Teams', 'sportspress' );
36
+ } else {
37
+ $columns[ 'event' ] = __( 'Title', 'sportspress' );
38
+ }
39
+
40
+ if ( 'time' === $time_format || 'separate' === $time_format ) {
41
+ $columns['time'] = __( 'Time', 'sportspress' );
42
+ } elseif ( 'combined' === $time_format ) {
43
+ $columns['time'] = __( 'Time/Results', 'sportspress' );
44
+ }
45
+
46
+ if ( 'results' === $time_format || 'separate' === $time_format ) {
47
+ $columns['results'] = __( 'Results', 'sportspress' );
48
+ }
49
+
50
+ $columns['league'] = __( 'Competition', 'sportspress' );
51
+ $columns['season'] = __( 'Season', 'sportspress' );
52
+ $columns['venue'] = __( 'Venue', 'sportspress' );
53
+ $columns['article'] = __( 'Article', 'sportspress' );
54
+ $columns['day'] = __( 'Match Day', 'sportspress' );
55
+
56
+ $columns = apply_filters( 'sportspress_calendar_columns', $columns );
57
+ ?>
58
+ <div class="sp-instance">
59
+ <ul class="categorychecklist form-no-clear">
60
+ <?php
61
+ foreach ( $columns as $key => $label ) {
62
+ ?>
63
+ <li>
64
+ <label>
65
+ <input type="checkbox" name="sp_columns[]" value="<?php echo $key; ?>" id="sp_columns_<?php echo $key; ?>" <?php checked( ! is_array( $selected ) || in_array( $key, $selected ) ); ?>>
66
+ <?php echo $label; ?>
67
+ </label>
68
+ </li>
69
+ <?php
70
+ }
71
+ ?>
72
+ </div>
73
+ <?php
74
+ }
75
+
76
+ /**
77
+ * Save meta box data
78
+ */
79
+ public static function save( $post_id, $post ) {
80
+ update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
81
+ }
82
+ }
includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -49,9 +49,9 @@ class SP_Meta_Box_Calendar_Data {
49
  <th class="column-date">
50
  <?php _e( 'Date', 'sportspress' ); ?>
51
  </th>
 
52
  <th class="column-event">
53
  <label for="sp_columns_event">
54
- <input type="checkbox" name="sp_columns[]" value="event" id="sp_columns_event" <?php checked( ! is_array( $usecolumns ) || in_array( 'event', $usecolumns ) ); ?>>
55
  <?php
56
  if ( 'teams' == $title_format ) {
57
  _e( 'Home', 'sportspress' ); ?> | <?php _e( 'Away', 'sportspress' );
@@ -63,10 +63,10 @@ class SP_Meta_Box_Calendar_Data {
63
  ?>
64
  </label>
65
  </th>
66
- <?php if ( in_array( $time_format, array( 'combined', 'separate', 'time' ) ) ) { ?>
 
67
  <th class="column-time">
68
  <label for="sp_columns_time">
69
- <input type="checkbox" name="sp_columns[]" value="time" id="sp_columns_time" <?php checked( ! is_array( $usecolumns ) || in_array( 'time', $usecolumns ) ); ?>>
70
  <?php
71
  if ( 'time' == $time_format || 'separate' == $time_format ) {
72
  _e( 'Time', 'sportspress' );
@@ -77,38 +77,48 @@ class SP_Meta_Box_Calendar_Data {
77
  </label>
78
  </th>
79
  <?php } ?>
80
- <?php if ( in_array( $time_format, array( 'separate', 'results' ) ) ) { ?>
81
  <th class="column-results">
82
  <label for="sp_columns_results">
83
- <input type="checkbox" name="sp_columns[]" value="results" id="sp_columns_results" <?php checked( ! is_array( $usecolumns ) || in_array( 'results', $usecolumns ) ); ?>>
84
  <?php _e( 'Results', 'sportspress' ); ?>
85
  </label>
86
  </th>
87
  <?php } ?>
88
- <th class="column-league">
89
- <label for="sp_columns_league">
90
- <input type="checkbox" name="sp_columns[]" value="league" id="sp_columns_league" <?php checked( ! is_array( $usecolumns ) || in_array( 'league', $usecolumns ) ); ?>>
91
- <?php _e( 'Competition', 'sportspress' ); ?>
92
- </label>
93
- </th>
94
- <th class="column-season">
95
- <label for="sp_columns_season">
96
- <input type="checkbox" name="sp_columns[]" value="season" id="sp_columns_season" <?php checked( ! is_array( $usecolumns ) || in_array( 'season', $usecolumns ) ); ?>>
97
- <?php _e( 'Season', 'sportspress' ); ?>
98
- </label>
99
- </th>
100
- <th class="column-venue">
101
- <label for="sp_columns_venue">
102
- <input type="checkbox" name="sp_columns[]" value="venue" id="sp_columns_venue" <?php checked( ! is_array( $usecolumns ) || in_array( 'venue', $usecolumns ) ); ?>>
103
- <?php _e( 'Venue', 'sportspress' ); ?>
104
- </label>
105
- </th>
106
- <th class="column-article">
107
- <label for="sp_columns_article">
108
- <input type="checkbox" name="sp_columns[]" value="article" id="sp_columns_article" <?php checked( ! is_array( $usecolumns ) || in_array( 'article', $usecolumns ) ); ?>>
109
- <?php _e( 'Article', 'sportspress' ); ?>
110
- </label>
111
- </th>
 
 
 
 
 
 
 
 
 
 
 
112
  </tr>
113
  </thead>
114
  <tbody>
@@ -125,46 +135,62 @@ class SP_Meta_Box_Calendar_Data {
125
  ?>
126
  <tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
127
  <td><?php echo get_post_time( get_option( 'date_format' ), false, $event, true ); ?></td>
128
- <td>
129
- <div class="sp-title-format sp-title-format-title<?php if ( $title_format && $title_format != 'title' ): ?> hidden<?php endif; ?>"><?php echo $event->post_title; ?></div>
130
- <div class="sp-title-format sp-title-format-teams sp-title-format-homeaway<?php if ( ! in_array( $title_format, array( 'teams', 'homeaway' ) ) ): ?> hidden<?php endif; ?>">
131
- <?php
132
- if ( $teams ): foreach ( $teams as $team ):
133
- $name = get_the_title( $team );
134
- if ( $name ):
135
- $team_results = sp_array_value( $results, $team, null );
 
136
 
137
- if ( $main_result ):
138
- $team_result = sp_array_value( $team_results, $main_result, null );
139
- else:
140
- if ( is_array( $team_results ) ):
141
- end( $team_results );
142
- $team_result = prev( $team_results );
143
  else:
144
- $team_result = null;
 
 
 
 
 
145
  endif;
146
- endif;
147
 
148
- if ( $team_result != null ):
149
- $team_result = apply_filters( 'sportspress_calendar_team_result_admin', $team_result, $event->ID, $team );
150
- $main_results[] = $team_result;
151
- unset( $team_results['outcome'] );
152
- $team_results = implode( ' | ', $team_results );
153
- echo '<a class="result sp-tip" title="' . $team_results . '" href="' . get_edit_post_link( $event->ID ) . '">' . $team_result . '</a> ';
154
- endif;
155
 
156
- echo $name . '<br>';
 
 
 
157
  endif;
158
- endforeach; else:
159
- echo '&mdash;';
160
- endif;
161
- ?>
162
- </div>
163
- </td>
164
- <?php if ( 'separate' == $time_format ) { ?>
165
- <td>
166
- <?php echo apply_filters( 'sportspress_event_time_admin', get_post_time( get_option( 'time_format' ), false, $event, true ), $event->ID ); ?>
167
  </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  <td>
169
  <?php
170
  if ( ! empty( $main_results ) ):
@@ -174,38 +200,48 @@ class SP_Meta_Box_Calendar_Data {
174
  endif;
175
  ?>
176
  </td>
177
- <?php } else { ?>
 
 
 
 
 
 
 
 
 
 
178
  <td>
179
- <?php
180
- if ( ! empty( $main_results ) ):
181
- echo implode( ' - ', $main_results );
 
 
 
 
 
 
 
 
182
  else:
183
- echo apply_filters( 'sportspress_event_time_admin', get_post_time( get_option( 'time_format' ), false, $event, true ), $event->ID );
184
  endif;
185
- ?>
 
186
  </td>
187
  <?php } ?>
188
- <td><?php the_terms( $event->ID, 'sp_league' ); ?></td>
189
- <td><?php the_terms( $event->ID, 'sp_season' ); ?></td>
190
- <td><?php the_terms( $event->ID, 'sp_venue' ); ?></td>
191
- <td>
192
- <a href="<?php echo get_edit_post_link( $event->ID ); ?>#sp_articlediv">
193
- <?php if ( $video ): ?>
194
- <div class="dashicons dashicons-video-alt"></div>
195
- <?php elseif ( has_post_thumbnail( $event->ID ) ): ?>
196
- <div class="dashicons dashicons-camera"></div>
197
- <?php endif; ?>
198
  <?php
199
- if ( $event->post_content == null ):
200
- _e( 'None', 'sportspress' );
201
- elseif ( $event->post_status == 'publish' ):
202
- _e( 'Recap', 'sportspress' );
203
- else:
204
- _e( 'Preview', 'sportspress' );
205
- endif;
206
  ?>
207
- </a>
208
- </td>
209
  </tr>
210
  <?php
211
  $i++;
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
49
  <th class="column-date">
50
  <?php _e( 'Date', 'sportspress' ); ?>
51
  </th>
52
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'event', $usecolumns ) ) { ?>
53
  <th class="column-event">
54
  <label for="sp_columns_event">
 
55
  <?php
56
  if ( 'teams' == $title_format ) {
57
  _e( 'Home', 'sportspress' ); ?> | <?php _e( 'Away', 'sportspress' );
63
  ?>
64
  </label>
65
  </th>
66
+ <?php } ?>
67
+ <?php if ( ( ! is_array( $usecolumns ) || in_array( 'time', $usecolumns ) ) && in_array( $time_format, array( 'combined', 'separate', 'time' ) ) ) { ?>
68
  <th class="column-time">
69
  <label for="sp_columns_time">
 
70
  <?php
71
  if ( 'time' == $time_format || 'separate' == $time_format ) {
72
  _e( 'Time', 'sportspress' );
77
  </label>
78
  </th>
79
  <?php } ?>
80
+ <?php if ( ( ! is_array( $usecolumns ) || in_array( 'results', $usecolumns ) ) && in_array( $time_format, array( 'separate', 'results' ) ) ) { ?>
81
  <th class="column-results">
82
  <label for="sp_columns_results">
 
83
  <?php _e( 'Results', 'sportspress' ); ?>
84
  </label>
85
  </th>
86
  <?php } ?>
87
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'league', $usecolumns ) ) { ?>
88
+ <th class="column-league">
89
+ <label for="sp_columns_league">
90
+ <?php _e( 'Competition', 'sportspress' ); ?>
91
+ </label>
92
+ </th>
93
+ <?php } ?>
94
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'season', $usecolumns ) ) { ?>
95
+ <th class="column-season">
96
+ <label for="sp_columns_season">
97
+ <?php _e( 'Season', 'sportspress' ); ?>
98
+ </label>
99
+ </th>
100
+ <?php } ?>
101
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'venue', $usecolumns ) ) { ?>
102
+ <th class="column-venue">
103
+ <label for="sp_columns_venue">
104
+ <?php _e( 'Venue', 'sportspress' ); ?>
105
+ </label>
106
+ </th>
107
+ <?php } ?>
108
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'article', $usecolumns ) ) { ?>
109
+ <th class="column-article">
110
+ <label for="sp_columns_article">
111
+ <?php _e( 'Article', 'sportspress' ); ?>
112
+ </label>
113
+ </th>
114
+ <?php } ?>
115
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'day', $usecolumns ) ) { ?>
116
+ <th class="column-day">
117
+ <label for="sp_columns_day">
118
+ <?php _e( 'Match Day', 'sportspress' ); ?>
119
+ </label>
120
+ </th>
121
+ <?php } ?>
122
  </tr>
123
  </thead>
124
  <tbody>
135
  ?>
136
  <tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
137
  <td><?php echo get_post_time( get_option( 'date_format' ), false, $event, true ); ?></td>
138
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'event', $usecolumns ) ) { ?>
139
+ <td>
140
+ <div class="sp-title-format sp-title-format-title<?php if ( $title_format && $title_format != 'title' ): ?> hidden<?php endif; ?>"><?php echo $event->post_title; ?></div>
141
+ <div class="sp-title-format sp-title-format-teams sp-title-format-homeaway<?php if ( ! in_array( $title_format, array( 'teams', 'homeaway' ) ) ): ?> hidden<?php endif; ?>">
142
+ <?php
143
+ if ( $teams ): foreach ( $teams as $team ):
144
+ $name = get_the_title( $team );
145
+ if ( $name ):
146
+ $team_results = sp_array_value( $results, $team, null );
147
 
148
+ if ( $main_result ):
149
+ $team_result = sp_array_value( $team_results, $main_result, null );
 
 
 
 
150
  else:
151
+ if ( is_array( $team_results ) ):
152
+ end( $team_results );
153
+ $team_result = prev( $team_results );
154
+ else:
155
+ $team_result = null;
156
+ endif;
157
  endif;
 
158
 
159
+ if ( $team_result != null ):
160
+ $team_result = apply_filters( 'sportspress_calendar_team_result_admin', $team_result, $event->ID, $team );
161
+ $main_results[] = $team_result;
162
+ unset( $team_results['outcome'] );
163
+ $team_results = implode( ' | ', $team_results );
164
+ echo '<a class="result sp-tip" title="' . $team_results . '" href="' . get_edit_post_link( $event->ID ) . '">' . $team_result . '</a> ';
165
+ endif;
166
 
167
+ echo $name . '<br>';
168
+ endif;
169
+ endforeach; else:
170
+ echo '&mdash;';
171
  endif;
172
+ ?>
173
+ </div>
 
 
 
 
 
 
 
174
  </td>
175
+ <?php } ?>
176
+ <?php if ( ( ! is_array( $usecolumns ) || in_array( 'time', $usecolumns ) ) && in_array( $time_format, array( 'combined', 'separate', 'time' ) ) ) { ?>
177
+ <?php if ( 'time' == $time_format || 'separate' == $time_format ) { ?>
178
+ <td>
179
+ <?php echo apply_filters( 'sportspress_event_time_admin', get_post_time( get_option( 'time_format' ), false, $event, true ), $event->ID ); ?>
180
+ </td>
181
+ <?php } else { ?>
182
+ <td>
183
+ <?php
184
+ if ( ! empty( $main_results ) ):
185
+ echo implode( ' - ', $main_results );
186
+ else:
187
+ echo apply_filters( 'sportspress_event_time_admin', get_post_time( get_option( 'time_format' ), false, $event, true ), $event->ID );
188
+ endif;
189
+ ?>
190
+ </td>
191
+ <?php } ?>
192
+ <?php } ?>
193
+ <?php if ( ( ! is_array( $usecolumns ) || in_array( 'results', $usecolumns ) ) && in_array( $time_format, array( 'separate', 'results' ) ) ) { ?>
194
  <td>
195
  <?php
196
  if ( ! empty( $main_results ) ):
200
  endif;
201
  ?>
202
  </td>
203
+ <?php } ?>
204
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'league', $usecolumns ) ) { ?>
205
+ <td><?php the_terms( $event->ID, 'sp_league' ); ?></td>
206
+ <?php } ?>
207
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'season', $usecolumns ) ) { ?>
208
+ <td><?php the_terms( $event->ID, 'sp_season' ); ?></td>
209
+ <?php } ?>
210
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'venue', $usecolumns ) ) { ?>
211
+ <td><?php the_terms( $event->ID, 'sp_venue' ); ?></td>
212
+ <?php } ?>
213
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'article', $usecolumns ) ) { ?>
214
  <td>
215
+ <a href="<?php echo get_edit_post_link( $event->ID ); ?>#sp_articlediv">
216
+ <?php if ( $video ): ?>
217
+ <div class="dashicons dashicons-video-alt"></div>
218
+ <?php elseif ( has_post_thumbnail( $event->ID ) ): ?>
219
+ <div class="dashicons dashicons-camera"></div>
220
+ <?php endif; ?>
221
+ <?php
222
+ if ( $event->post_content == null ):
223
+ _e( 'None', 'sportspress' );
224
+ elseif ( $event->post_status == 'publish' ):
225
+ _e( 'Recap', 'sportspress' );
226
  else:
227
+ _e( 'Preview', 'sportspress' );
228
  endif;
229
+ ?>
230
+ </a>
231
  </td>
232
  <?php } ?>
233
+ <?php if ( ! is_array( $usecolumns ) || in_array( 'day', $usecolumns ) ) { ?>
234
+ <td>
 
 
 
 
 
 
 
 
235
  <?php
236
+ $day = get_post_meta( $event->ID, 'sp_day', true );
237
+ if ( '' == $day ) {
238
+ echo '&mdash;';
239
+ } else {
240
+ echo $day;
241
+ }
 
242
  ?>
243
+ </td>
244
+ <?php } ?>
245
  </tr>
246
  <?php
247
  $i++;
includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -43,7 +43,7 @@ class SP_Meta_Box_Equation {
43
  $options[ 'Outcomes' ] = self::optgroup( 'sp_outcome' );
44
  break;
45
  case 'preset':
46
- $options[ 'Presets' ] = array( '$gamesback' => __( 'Games Back', 'sportspress' ), '$homerecord' => __( 'Home Record', 'sportspress' ), '$awayrecord' => __( 'Away Record', 'sportspress' ), '$streak' => __( 'Streak', 'sportspress' ), '$last5' => __( 'Last 5', 'sportspress' ), '$last10' => __( 'Last 10', 'sportspress' ) );
47
  break;
48
  case 'subset':
49
  $options[ 'Subsets' ] = array( '_home' => '@' . __( 'Home', 'sportspress' ), '_away' => '@' . __( 'Away', 'sportspress' ), '_venue' => '@' . __( 'Venue', 'sportspress' ) );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
43
  $options[ 'Outcomes' ] = self::optgroup( 'sp_outcome' );
44
  break;
45
  case 'preset':
46
+ $options[ 'Presets' ] = array( '$gamesback' => __( 'Games Back', 'sportspress' ), '$homerecord' => __( 'Home Record', 'sportspress' ), '$awayrecord' => __( 'Away Record', 'sportspress' ), '$streak' => __( 'Streak', 'sportspress' ), '$form' => __( 'Form', 'sportspress' ), '$last5' => __( 'Last 5', 'sportspress' ), '$last10' => __( 'Last 10', 'sportspress' ) );
47
  break;
48
  case 'subset':
49
  $options[ 'Subsets' ] = array( '_home' => '@' . __( 'Home', 'sportspress' ), '_away' => '@' . __( 'Away', 'sportspress' ), '_venue' => '@' . __( 'Venue', 'sportspress' ) );
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -40,7 +40,7 @@ class SP_Meta_Box_Event_Details {
40
  <?php
41
  foreach ( $taxonomies as $taxonomy ) {
42
  if ( 'sp_venue' == $taxonomy ) continue;
43
- sp_taxonomy_field( $taxonomy, $post, true, true );
44
  }
45
  ?>
46
  <div class="sp-event-sp_venue-field">
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2.4
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
40
  <?php
41
  foreach ( $taxonomies as $taxonomy ) {
42
  if ( 'sp_venue' == $taxonomy ) continue;
43
+ sp_taxonomy_field( $taxonomy, $post, true, true, __( 'None', 'sportspress' ) );
44
  }
45
  ?>
46
  <div class="sp-event-sp_venue-field">
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -20,9 +20,9 @@ class SP_Meta_Box_Event_Performance {
20
  */
21
  public static function output( $post ) {
22
  $event = new SP_Event( $post );
23
- list( $labels, $columns, $stats, $teams, $formats, $order ) = $event->performance( true );
24
 
25
- if ( 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'yes' ) )
26
  $timeline = $event->timeline( true );
27
  else
28
  $timeline = false;
@@ -65,7 +65,7 @@ class SP_Meta_Box_Event_Performance {
65
  // Check if individual mode
66
  $is_individual = get_option( 'sportspress_load_individual_mode_module', 'no' ) === 'yes' ? true : false;
67
 
68
- self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline );
69
  }
70
 
71
  /**
@@ -81,7 +81,7 @@ class SP_Meta_Box_Event_Performance {
81
  /**
82
  * Admin edit tables
83
  */
84
- public static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $positions = array(), $status = true, $formats = array(), $order = array(), $numbers = true, $is_individual = false, $timeline = array() ) {
85
  $sections = get_option( 'sportspress_event_performance_sections', -1 );
86
 
87
  if ( $is_individual ) {
@@ -116,7 +116,7 @@ class SP_Meta_Box_Event_Performance {
116
  $player_timeline = false;
117
  endif;
118
 
119
- self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, $numbers, -1, $formats, $player_timeline );
120
  endforeach;
121
  endforeach;
122
  ?>
@@ -145,7 +145,7 @@ class SP_Meta_Box_Event_Performance {
145
  ?>
146
  <div>
147
  <p><strong><?php echo get_the_title( $team_id ); ?></strong></p>
148
- <?php self::table( $labels, $columns, $data, $team_id, $has_checkboxes, $positions, $status, -1, $formats, $order, $numbers, $team_timeline ); ?>
149
  <?php do_action( 'sportspress_after_event_performance_table_admin', $labels, $columns, $data, $team_id ); ?>
150
  </div>
151
  <?php } else { ?>
@@ -227,7 +227,7 @@ class SP_Meta_Box_Event_Performance {
227
  ?>
228
  <div>
229
  <p><strong><?php echo get_the_title( $team_id ); ?> &mdash; <?php echo $section_label; ?></strong></p>
230
- <?php self::table( $labels[ $section_id ], $columns, $data[ $section_id ], $team_id, ( $has_checkboxes && 0 === $i ), $positions, $status, $section_id, $formats, $order, $numbers, $team_timeline ); ?>
231
  <?php do_action( 'sportspress_after_event_performance_table_admin', $labels[ $section_id ], $columns, $data[ $section_id ], $team_id ); ?>
232
  </div>
233
  <?php
@@ -241,7 +241,7 @@ class SP_Meta_Box_Event_Performance {
241
  /**
242
  * Admin edit table
243
  */
244
- public static function table( $labels = array(), $columns = array(), $data = array(), $team_id, $has_checkboxes = false, $positions = array(), $status = true, $section = -1, $formats = array(), $order = array(), $numbers = true, $team_timeline = array() ) {
245
  ?>
246
  <div class="sp-data-table-container">
247
  <table class="widefat sp-data-table sp-performance-table sp-sortable-table">
@@ -276,7 +276,7 @@ class SP_Meta_Box_Event_Performance {
276
  $player_timeline = false;
277
  endif;
278
 
279
- self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, true, $numbers, $section, $formats, $player_timeline );
280
 
281
  endforeach;
282
  ?>
@@ -369,7 +369,7 @@ class SP_Meta_Box_Event_Performance {
369
  /**
370
  * Admin edit table row
371
  */
372
- public static function row( $labels = array(), $player_id = 0, $player_performance = array(), $team_id = 0, $data = array(), $positions = true, $status = true, $sortable = true, $numbers = true, $section = -1, $formats = array(), $player_timeline = array() ) {
373
  if ( $player_id <= 0 ) return;
374
 
375
  $value = sp_array_value( $player_performance, 'number', '' );
@@ -418,8 +418,25 @@ class SP_Meta_Box_Event_Performance {
418
  $placeholder = sp_get_format_placeholder( sp_array_value( $formats, $column, 'number' ) );
419
  ?>
420
  <td>
421
- <input class="sp-player-<?php echo $column; ?>-input sp-sync-input" type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo $placeholder; ?>" />
422
- <?php if ( $intval ) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  <?php
424
  // Get performance times
425
  if ( is_array( $player_timeline ) ) {
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2.4
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
20
  */
21
  public static function output( $post ) {
22
  $event = new SP_Event( $post );
23
+ list( $labels, $columns, $stats, $teams, $formats, $order, $timed ) = $event->performance( true );
24
 
25
+ if ( 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'no' ) )
26
  $timeline = $event->timeline( true );
27
  else
28
  $timeline = false;
65
  // Check if individual mode
66
  $is_individual = get_option( 'sportspress_load_individual_mode_module', 'no' ) === 'yes' ? true : false;
67
 
68
+ self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline, $timed );
69
  }
70
 
71
  /**
81
  /**
82
  * Admin edit tables
83
  */
84
+ public static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $positions = array(), $status = true, $formats = array(), $order = array(), $numbers = true, $is_individual = false, $timeline = array(), $timed = array() ) {
85
  $sections = get_option( 'sportspress_event_performance_sections', -1 );
86
 
87
  if ( $is_individual ) {
116
  $player_timeline = false;
117
  endif;
118
 
119
+ self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, $numbers, -1, $formats, $player_timeline, $timed );
120
  endforeach;
121
  endforeach;
122
  ?>
145
  ?>
146
  <div>
147
  <p><strong><?php echo get_the_title( $team_id ); ?></strong></p>
148
+ <?php self::table( $labels, $columns, $data, $team_id, $has_checkboxes, $positions, $status, -1, $formats, $order, $numbers, $team_timeline, $timed ); ?>
149
  <?php do_action( 'sportspress_after_event_performance_table_admin', $labels, $columns, $data, $team_id ); ?>
150
  </div>
151
  <?php } else { ?>
227
  ?>
228
  <div>
229
  <p><strong><?php echo get_the_title( $team_id ); ?> &mdash; <?php echo $section_label; ?></strong></p>
230
+ <?php self::table( $labels[ $section_id ], $columns, $data[ $section_id ], $team_id, ( $has_checkboxes && 0 === $i ), $positions, $status, $section_id, $formats, $order, $numbers, $team_timeline, $timed ); ?>
231
  <?php do_action( 'sportspress_after_event_performance_table_admin', $labels[ $section_id ], $columns, $data[ $section_id ], $team_id ); ?>
232
  </div>
233
  <?php
241
  /**
242
  * Admin edit table
243
  */
244
+ public static function table( $labels = array(), $columns = array(), $data = array(), $team_id, $has_checkboxes = false, $positions = array(), $status = true, $section = -1, $formats = array(), $order = array(), $numbers = true, $team_timeline = array(), $timed = array() ) {
245
  ?>
246
  <div class="sp-data-table-container">
247
  <table class="widefat sp-data-table sp-performance-table sp-sortable-table">
276
  $player_timeline = false;
277
  endif;
278
 
279
+ self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, true, $numbers, $section, $formats, $player_timeline, $timed );
280
 
281
  endforeach;
282
  ?>
369
  /**
370
  * Admin edit table row
371
  */
372
+ public static function row( $labels = array(), $player_id = 0, $player_performance = array(), $team_id = 0, $data = array(), $positions = true, $status = true, $sortable = true, $numbers = true, $section = -1, $formats = array(), $player_timeline = array(), $timed = array() ) {
373
  if ( $player_id <= 0 ) return;
374
 
375
  $value = sp_array_value( $player_performance, 'number', '' );
418
  $placeholder = sp_get_format_placeholder( sp_array_value( $formats, $column, 'number' ) );
419
  ?>
420
  <td>
421
+ <?php if ( 'time' === sp_array_value( $formats, $column, 'number' ) ) { ?>
422
+ <?php
423
+ $intval = intval( $value );
424
+ $timeval = gmdate( 'i:s', $intval );
425
+ $hours = floor( $intval / 3600 );
426
+
427
+ if ( '00' != $hours )
428
+ $timeval = $hours . ':' . $timeval;
429
+
430
+ $timeval = preg_replace( '/^0/', '', $timeval );
431
+ ?>
432
+
433
+ <input class="sp-player-<?php echo $column; ?>-input sp-convert-time-input sp-sync-input" type="text" name="sp_times[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $timeval ); ?>" placeholder="<?php echo $placeholder; ?>" />
434
+ <input class="sp-convert-time-output" type="hidden" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $value ); ?>" />
435
+ <?php } else { ?>
436
+ <input class="sp-player-<?php echo $column; ?>-input sp-sync-input" type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo $placeholder; ?>" />
437
+ <?php } ?>
438
+
439
+ <?php if ( $intval && in_array( $column, $timed ) ) { ?>
440
  <?php
441
  // Get performance times
442
  if ( is_array( $player_timeline ) ) {
includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.1.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -27,6 +27,7 @@ class SP_Meta_Box_List_Details {
27
  $orderby = get_post_meta( $post->ID, 'sp_orderby', true );
28
  $order = get_post_meta( $post->ID, 'sp_order', true );
29
  $select = get_post_meta( $post->ID, 'sp_select', true );
 
30
  if ( ! $select ) {
31
  global $pagenow;
32
  $select = ( 'post-new.php' == $pagenow ? 'auto' : 'manual' );
@@ -104,6 +105,11 @@ class SP_Meta_Box_List_Details {
104
  if ( 'manual' == $select ) {
105
  sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) );
106
  sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
 
 
 
 
 
107
  }
108
  ?>
109
  </div>
@@ -121,6 +127,7 @@ class SP_Meta_Box_List_Details {
121
  update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array() ) );
122
  update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
123
  update_post_meta( $post_id, 'sp_select', sp_array_value( $_POST, 'sp_select', array() ) );
 
124
  sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) );
125
  }
126
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
27
  $orderby = get_post_meta( $post->ID, 'sp_orderby', true );
28
  $order = get_post_meta( $post->ID, 'sp_order', true );
29
  $select = get_post_meta( $post->ID, 'sp_select', true );
30
+ $number = get_post_meta( $post->ID, 'sp_number', true );
31
  if ( ! $select ) {
32
  global $pagenow;
33
  $select = ( 'post-new.php' == $pagenow ? 'auto' : 'manual' );
105
  if ( 'manual' == $select ) {
106
  sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) );
107
  sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
108
+ } else {
109
+ ?>
110
+ <p><strong><?php _e( 'Display', 'sportspress' ); ?></strong></p>
111
+ <p><input name="sp_number" id="sp_number" type="number" step="1" min="0" class="small-text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo $number; ?>"> <?php _e( 'Players', 'sportspress' ); ?></p>
112
+ <?php
113
  }
114
  ?>
115
  </div>
127
  update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array() ) );
128
  update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
129
  update_post_meta( $post_id, 'sp_select', sp_array_value( $_POST, 'sp_select', array() ) );
130
+ update_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', array() ) );
131
  sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) );
132
  }
133
  }
includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 1.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -30,10 +30,13 @@ class SP_Meta_Box_Outcome_Details extends SP_Meta_Box_Config {
30
  $readonly = false;
31
  }
32
  $abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
 
33
  $condition = get_post_meta( $post->ID, 'sp_condition', true );
34
  $main_result = get_option( 'sportspress_primary_result', null );
35
  $result = get_page_by_path( $main_result, ARRAY_A, 'sp_result' );
36
  $label = sp_array_value( $result, 'post_title', __( 'Primary', 'sportspress' ) );
 
 
37
  ?>
38
  <p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
39
  <p>
@@ -44,6 +47,13 @@ class SP_Meta_Box_Outcome_Details extends SP_Meta_Box_Config {
44
  <p>
45
  <input name="sp_abbreviation" type="text" id="sp_abbreviation" value="<?php echo $abbreviation; ?>" placeholder="<?php echo substr( $post->post_title, 0, 1 ); ?>">
46
  </p>
 
 
 
 
 
 
 
47
  <p><strong><?php _e( 'Condition', 'sportspress' ); ?></strong></p>
48
  <p>
49
  <select name="sp_condition">
@@ -72,6 +82,7 @@ class SP_Meta_Box_Outcome_Details extends SP_Meta_Box_Config {
72
  */
73
  public static function save( $post_id, $post ) {
74
  update_post_meta( $post_id, 'sp_abbreviation', sp_array_value( $_POST, 'sp_abbreviation', array() ) );
 
75
  update_post_meta( $post_id, 'sp_condition', sp_array_value( $_POST, 'sp_condition', array() ) );
76
  }
77
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  $readonly = false;
31
  }
32
  $abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
33
+ $color = get_post_meta( $post->ID, 'sp_color', true );
34
  $condition = get_post_meta( $post->ID, 'sp_condition', true );
35
  $main_result = get_option( 'sportspress_primary_result', null );
36
  $result = get_page_by_path( $main_result, ARRAY_A, 'sp_result' );
37
  $label = sp_array_value( $result, 'post_title', __( 'Primary', 'sportspress' ) );
38
+
39
+ if ( '' === $color ) $color = '#888888';
40
  ?>
41
  <p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
42
  <p>
47
  <p>
48
  <input name="sp_abbreviation" type="text" id="sp_abbreviation" value="<?php echo $abbreviation; ?>" placeholder="<?php echo substr( $post->post_title, 0, 1 ); ?>">
49
  </p>
50
+ <p><strong><?php _e( 'Color', 'sportspress' ); ?></strong></p>
51
+ <p>
52
+ <div class="sp-color-box">
53
+ <input name="sp_color" id="sp_color" type="text" value="<?php echo $color; ?>" class="colorpick">
54
+ <div id="sp_color" class="colorpickdiv"></div>
55
+ </div>
56
+ </p>
57
  <p><strong><?php _e( 'Condition', 'sportspress' ); ?></strong></p>
58
  <p>
59
  <select name="sp_condition">
82
  */
83
  public static function save( $post_id, $post ) {
84
  update_post_meta( $post_id, 'sp_abbreviation', sp_array_value( $_POST, 'sp_abbreviation', array() ) );
85
+ update_post_meta( $post_id, 'sp_color', sp_array_value( $_POST, 'sp_color', array() ) );
86
  update_post_meta( $post_id, 'sp_condition', sp_array_value( $_POST, 'sp_condition', array() ) );
87
  }
88
  }
includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -31,6 +31,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
31
  }
32
 
33
  // Post Meta
 
34
  $section = get_post_meta( $post->ID, 'sp_section', true );
35
  if ( '' === $section ) {
36
  $section = -1;
@@ -40,12 +41,23 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
40
  $format = 'number';
41
  }
42
  $precision = get_post_meta( $post->ID, 'sp_precision', true );
 
 
 
 
 
 
 
43
  ?>
44
  <p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
45
  <p>
46
  <input name="sp_default_key" type="hidden" id="sp_default_key" value="<?php echo $post->post_name; ?>">
47
  <input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>"<?php if ( $readonly ) { ?> readonly="readonly"<?php } ?>>
48
  </p>
 
 
 
 
49
  <p><strong><?php _e( 'Category', 'sportspress' ); ?></strong></p>
50
  <p class="sp-section-selector">
51
  <select name="sp_section">
@@ -61,17 +73,39 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
61
  <p class="sp-format-selector">
62
  <select name="sp_format">
63
  <?php
64
- $options = apply_filters( 'sportspress_performance_formats', array( 'number' => __( 'Number', 'sportspress' ), 'text' => __( 'Text', 'sportspress' ), 'equation' => __( 'Equation', 'sportspress' ) ) );
65
  foreach ( $options as $key => $value ):
66
  printf( '<option value="%s" %s>%s</option>', $key, selected( $key == $format, true, false ), $value );
67
  endforeach;
68
  ?>
69
  </select>
70
  </p>
71
- <p><strong><?php _e( 'Decimal Places', 'sportspress' ); ?></strong></p>
72
- <p>
73
- <input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>" placeholder="0">
74
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  <?php
76
  if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
77
  $visible = get_post_meta( $post->ID, 'sp_visible', true );
@@ -106,9 +140,11 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
106
  */
107
  public static function save( $post_id, $post ) {
108
  self::delete_duplicate( $_POST );
 
109
  update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) );
110
  update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
111
  update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0 ) );
 
112
  if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
113
  update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
114
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
31
  }
32
 
33
  // Post Meta
34
+ $singular = get_post_meta( $post->ID, 'sp_singular', true );
35
  $section = get_post_meta( $post->ID, 'sp_section', true );
36
  if ( '' === $section ) {
37
  $section = -1;
41
  $format = 'number';
42
  }
43
  $precision = get_post_meta( $post->ID, 'sp_precision', true );
44
+ if ( '' === $precision ) {
45
+ $precision = 0;
46
+ }
47
+ $timed = get_post_meta( $post->ID, 'sp_timed', true );
48
+ if ( '' === $timed ) {
49
+ $timed = true;
50
+ }
51
  ?>
52
  <p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
53
  <p>
54
  <input name="sp_default_key" type="hidden" id="sp_default_key" value="<?php echo $post->post_name; ?>">
55
  <input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>"<?php if ( $readonly ) { ?> readonly="readonly"<?php } ?>>
56
  </p>
57
+ <p><strong><?php _e( 'Singular', 'sportspress' ); ?></strong></p>
58
+ <p>
59
+ <input name="sp_singular" type="text" id="sp_singular" placeholder="<?php echo $post->post_title; ?>" value="<?php echo $singular; ?>">
60
+ </p>
61
  <p><strong><?php _e( 'Category', 'sportspress' ); ?></strong></p>
62
  <p class="sp-section-selector">
63
  <select name="sp_section">
73
  <p class="sp-format-selector">
74
  <select name="sp_format">
75
  <?php
76
+ $options = apply_filters( 'sportspress_performance_formats', array( 'number' => __( 'Number', 'sportspress' ), 'time' => __( 'Time', 'sportspress' ), 'text' => __( 'Text', 'sportspress' ), 'equation' => __( 'Equation', 'sportspress' ) ) );
77
  foreach ( $options as $key => $value ):
78
  printf( '<option value="%s" %s>%s</option>', $key, selected( $key == $format, true, false ), $value );
79
  endforeach;
80
  ?>
81
  </select>
82
  </p>
83
+ <div id="sp_precisiondiv">
84
+ <p><strong><?php _e( 'Decimal Places', 'sportspress' ); ?></strong></p>
85
+ <p>
86
+ <input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>" placeholder="0">
87
+ </p>
88
+ </div>
89
+ <div id="sp_timeddiv">
90
+ <p>
91
+ <strong><?php _e( 'Timed', 'sportspress' ); ?></strong>
92
+ <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Record minutes?', 'sportspress' ); ?>"></i>
93
+ </p>
94
+ <ul class="sp-timed-selector">
95
+ <li>
96
+ <label class="selectit">
97
+ <input name="sp_timed" id="sp_timed_yes" type="radio" value="1" <?php checked( $timed ); ?>>
98
+ <?php _e( 'Yes', 'sportspress' ); ?>
99
+ </label>
100
+ </li>
101
+ <li>
102
+ <label class="selectit">
103
+ <input name="sp_timed" id="sp_timed_no" type="radio" value="0" <?php checked( ! $timed ); ?>>
104
+ <?php _e( 'No', 'sportspress' ); ?>
105
+ </label>
106
+ </li>
107
+ </ul>
108
+ </div>
109
  <?php
110
  if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
111
  $visible = get_post_meta( $post->ID, 'sp_visible', true );
140
  */
141
  public static function save( $post_id, $post ) {
142
  self::delete_duplicate( $_POST );
143
+ update_post_meta( $post_id, 'sp_singular', sp_array_value( $_POST, 'sp_singular', '' ) );
144
  update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) );
145
  update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
146
  update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0 ) );
147
+ update_post_meta( $post_id, 'sp_timed', sp_array_value( $_POST, 'sp_timed', 0 ) );
148
  if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
149
  update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
150
  }
includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.1.3
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -23,6 +23,7 @@ class SP_Meta_Box_Player_Statistics {
23
  $leagues = get_the_terms( $post->ID, 'sp_league' );
24
  $league_num = sizeof( $leagues );
25
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
 
26
 
27
  if ( $leagues ) {
28
  if ( -1 == $sections ) {
@@ -32,15 +33,17 @@ class SP_Meta_Box_Player_Statistics {
32
  ?>
33
  <p><strong><?php echo $league->name; ?></strong></p>
34
  <?php
35
- list( $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes ) = $player->data( $league->term_id, true );
36
- self::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0, true );
37
  $i ++;
38
  endforeach;
39
- ?>
40
- <p><strong><?php _e( 'Career Total', 'sportspress' ); ?></strong></p>
41
- <?php
42
- list( $columns, $data, $placeholders, $merged, $seasons_teams ) = $player->data( 0, true );
43
- self::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams );
 
 
44
  } else {
45
  // Determine order of sections
46
  if ( 1 == $sections ) {
@@ -61,11 +64,13 @@ class SP_Meta_Box_Player_Statistics {
61
  self::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0 );
62
  $i ++;
63
  endforeach;
64
- ?>
65
- <p><strong><?php _e( 'Career Total', 'sportspress' ); ?> &mdash; <?php echo $section_label; ?></strong></p>
66
- <?php
67
- list( $columns, $data, $placeholders, $merged, $seasons_teams ) = $player->data( 0, true, $section_id );
68
- self::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0 );
 
 
69
  $s ++;
70
  }
71
  }
@@ -83,7 +88,7 @@ class SP_Meta_Box_Player_Statistics {
83
  /**
84
  * Admin edit table
85
  */
86
- public static function table( $id = null, $league_id, $columns = array(), $data = array(), $placeholders = array(), $merged = array(), $leagues = array(), $has_checkboxes = false, $team_select = false ) {
87
  $readonly = false;
88
  $teams = array_filter( get_post_meta( $id, 'sp_team', false ) );
89
  ?>
@@ -188,10 +193,41 @@ class SP_Meta_Box_Player_Statistics {
188
  <td><?php
189
  $value = sp_array_value( sp_array_value( $data, $div_id, array() ), $column, null );
190
  $placeholder = sp_array_value( sp_array_value( $placeholders, $div_id, array() ), $column, 0 );
191
- if ( $readonly )
192
- echo $value ? $value : $placeholder;
193
- else
194
- echo '<input type="text" name="sp_statistics[' . $league_id . '][' . $div_id . '][' . $column . ']" value="' . esc_attr( $value ) . '" placeholder="' . esc_attr( $placeholder ) . '"' . ( $readonly ? ' disabled="disabled"' : '' ) . ' />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  ?></td>
196
  <?php endforeach; ?>
197
  </tr>
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2.4
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
23
  $leagues = get_the_terms( $post->ID, 'sp_league' );
24
  $league_num = sizeof( $leagues );
25
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
26
+ $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
27
 
28
  if ( $leagues ) {
29
  if ( -1 == $sections ) {
33
  ?>
34
  <p><strong><?php echo $league->name; ?></strong></p>
35
  <?php
36
+ list( $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes, $formats ) = $player->data( $league->term_id, true );
37
+ self::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0, true, $formats );
38
  $i ++;
39
  endforeach;
40
+ if ( $show_career_totals ) {
41
+ ?>
42
+ <p><strong><?php _e( 'Career Total', 'sportspress' ); ?></strong></p>
43
+ <?php
44
+ list( $columns, $data, $placeholders, $merged, $seasons_teams ) = $player->data( 0, true );
45
+ self::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams );
46
+ }
47
  } else {
48
  // Determine order of sections
49
  if ( 1 == $sections ) {
64
  self::table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0 );
65
  $i ++;
66
  endforeach;
67
+ if ( $show_career_totals ) {
68
+ ?>
69
+ <p><strong><?php _e( 'Career Total', 'sportspress' ); ?> &mdash; <?php echo $section_label; ?></strong></p>
70
+ <?php
71
+ list( $columns, $data, $placeholders, $merged, $seasons_teams ) = $player->data( 0, true, $section_id );
72
+ self::table( $post->ID, 0, $columns, $data, $placeholders, $merged, $seasons_teams, $has_checkboxes && $i == 0 && $s == 0, $s == 0 );
73
+ }
74
  $s ++;
75
  }
76
  }
88
  /**
89
  * Admin edit table
90
  */
91
+ public static function table( $id = null, $league_id, $columns = array(), $data = array(), $placeholders = array(), $merged = array(), $leagues = array(), $has_checkboxes = false, $team_select = false, $formats = array() ) {
92
  $readonly = false;
93
  $teams = array_filter( get_post_meta( $id, 'sp_team', false ) );
94
  ?>
193
  <td><?php
194
  $value = sp_array_value( sp_array_value( $data, $div_id, array() ), $column, null );
195
  $placeholder = sp_array_value( sp_array_value( $placeholders, $div_id, array() ), $column, 0 );
196
+
197
+ // Convert value and placeholder to time format
198
+ if ( 'time' === sp_array_value( $formats, $column, 'number' ) ) {
199
+
200
+ // Convert value
201
+ $intval = intval( $value );
202
+ $timeval = gmdate( 'i:s', $intval );
203
+ $hours = floor( $intval / 3600 );
204
+
205
+ if ( '00' != $hours )
206
+ $timeval = $hours . ':' . $timeval;
207
+
208
+ $timeval = preg_replace( '/^0/', '', $timeval );
209
+
210
+ // Convert placeholder
211
+ $intval = intval( $placeholder );
212
+ $placeholder = gmdate( 'i:s', $intval );
213
+ $hours = floor( $intval / 3600 );
214
+
215
+ if ( '00' != $hours )
216
+ $placeholder = $hours . ':' . $placeholder;
217
+
218
+ $placeholder = preg_replace( '/^0/', '', $placeholder );
219
+ }
220
+
221
+ if ( $readonly ) {
222
+ echo $timeval ? $timeval : $placeholder;
223
+ } else {
224
+ if ( 'time' === sp_array_value( $formats, $column, 'number' ) ) {
225
+ echo '<input class="sp-convert-time-input" type="text" name="sp_times[' . $league_id . '][' . $div_id . '][' . $column . ']" value="' . ( '' === $value ? '' : esc_attr( $timeval ) ) . '" placeholder="' . esc_attr( $placeholder ) . '"' . ( $readonly ? ' disabled="disabled"' : '' ) . ' />';
226
+ echo '<input class="sp-convert-time-output" type="hidden" name="sp_statistics[' . $league_id . '][' . $div_id . '][' . $column . ']" value="' . esc_attr( $value ) . '" />';
227
+ } else {
228
+ echo '<input type="text" name="sp_statistics[' . $league_id . '][' . $div_id . '][' . $column . ']" value="' . esc_attr( $value ) . '" placeholder="' . esc_attr( $placeholder ) . '"' . ( $readonly ? ' disabled="disabled"' : '' ) . ' />';
229
+ }
230
+ }
231
  ?></td>
232
  <?php endforeach; ?>
233
  </tr>
includes/admin/post-types/meta-boxes/class-sp-meta-box-statistic-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -52,6 +52,17 @@ class SP_Meta_Box_Statistic_Details extends SP_Meta_Box_Config {
52
  ?>
53
  </select>
54
  </p>
 
 
 
 
 
 
 
 
 
 
 
55
  <p>
56
  <strong><?php _e( 'Visible', 'sportspress' ); ?></strong>
57
  <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Display in player profile?', 'sportspress' ); ?>"></i>
@@ -79,6 +90,7 @@ class SP_Meta_Box_Statistic_Details extends SP_Meta_Box_Config {
79
  public static function save( $post_id, $post ) {
80
  self::delete_duplicate( $_POST );
81
  update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) );
 
82
  update_post_meta( $post_id, 'sp_precision', (int) sp_array_value( $_POST, 'sp_precision', 1 ) );
83
  update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
84
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
52
  ?>
53
  </select>
54
  </p>
55
+ <p><strong><?php _e( 'Format', 'sportspress' ); ?></strong></p>
56
+ <p>
57
+ <select name="sp_format">
58
+ <?php
59
+ $options = apply_filters( 'sportspress_statistic_formats', array( 'number' => __( 'Number', 'sportspress' ), 'time' => __( 'Time', 'sportspress' ) ) );
60
+ foreach ( $options as $key => $value ):
61
+ printf( '<option value="%s" %s>%s</option>', $key, selected( $key == $format, true, false ), $value );
62
+ endforeach;
63
+ ?>
64
+ </select>
65
+ </p>
66
  <p>
67
  <strong><?php _e( 'Visible', 'sportspress' ); ?></strong>
68
  <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Display in player profile?', 'sportspress' ); ?>"></i>
90
  public static function save( $post_id, $post ) {
91
  self::delete_duplicate( $_POST );
92
  update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) );
93
+ update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
94
  update_post_meta( $post_id, 'sp_precision', (int) sp_array_value( $_POST, 'sp_precision', 1 ) );
95
  update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
96
  }
includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 1.9.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -92,6 +92,7 @@ class SP_Meta_Box_Table_Data {
92
  <?php foreach( $columns as $column => $label ):
93
  $value = sp_array_value( $team_stats, $column, '' );
94
  $placeholder = sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $column, 0 );
 
95
  ?>
96
  <td><input type="text" name="sp_teams[<?php echo $team_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" data-placeholder="<?php echo esc_attr( $placeholder ); ?>" data-matrix="<?php echo $team_id; ?>_<?php echo $column; ?>" data-adjustment="<?php echo esc_attr( sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $column, 0 ) ); ?>" /></td>
97
  <?php endforeach; ?>
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
92
  <?php foreach( $columns as $column => $label ):
93
  $value = sp_array_value( $team_stats, $column, '' );
94
  $placeholder = sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $column, 0 );
95
+ $placeholder = wp_strip_all_tags( $placeholder );
96
  ?>
97
  <td><input type="text" name="sp_teams[<?php echo $team_id; ?>][<?php echo $column; ?>]" value="<?php echo esc_attr( $value ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" data-placeholder="<?php echo esc_attr( $placeholder ); ?>" data-matrix="<?php echo $team_id; ?>_<?php echo $column; ?>" data-adjustment="<?php echo esc_attr( sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $column, 0 ) ); ?>" /></td>
98
  <?php endforeach; ?>
includes/admin/post-types/meta-boxes/class-sp-meta-box-team-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 1.9.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -52,6 +52,7 @@ class SP_Meta_Box_Team_Details {
52
  endif;
53
 
54
  $abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
 
55
  $url = get_post_meta( $post->ID, 'sp_url', true );
56
  ?>
57
 
@@ -108,9 +109,7 @@ class SP_Meta_Box_Team_Details {
108
 
109
  <p><strong><?php _e( 'Site URL', 'sportspress' ); ?></strong></p>
110
  <p><input type="text" class="widefat" id="sp_url" name="sp_url" value="<?php echo esc_url( $url ); ?>"></p>
111
- <?php if ( $url ): ?>
112
- <p><a class="sp-link" title="<?php _e( 'Visit Site', 'sportspress' ); ?>" href="<?php echo $url; ?>" target="_blank"><?php _e( 'Visit Site', 'sportspress' ); ?></a></p>
113
- <?php endif; ?>
114
 
115
  <p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
116
  <p><input type="text" id="sp_abbreviation" name="sp_abbreviation" value="<?php echo esc_attr( $abbreviation ); ?>"></p>
@@ -122,6 +121,7 @@ class SP_Meta_Box_Team_Details {
122
  */
123
  public static function save( $post_id, $post ) {
124
  update_post_meta( $post_id, 'sp_url', esc_url( sp_array_value( $_POST, 'sp_url', '' ) ) );
 
125
  update_post_meta( $post_id, 'sp_abbreviation', esc_attr( sp_array_value( $_POST, 'sp_abbreviation', '' ) ) );
126
  }
127
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
52
  endif;
53
 
54
  $abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
55
+ $redirect = get_post_meta( $post->ID, 'sp_redirect', true );
56
  $url = get_post_meta( $post->ID, 'sp_url', true );
57
  ?>
58
 
109
 
110
  <p><strong><?php _e( 'Site URL', 'sportspress' ); ?></strong></p>
111
  <p><input type="text" class="widefat" id="sp_url" name="sp_url" value="<?php echo esc_url( $url ); ?>"></p>
112
+ <p><label class="selectit"><input type="checkbox" name="sp_redirect" value="1" <?php checked( $redirect ); ?>> <?php _e( 'Redirect', 'sportspress' ); ?></label></p>
 
 
113
 
114
  <p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
115
  <p><input type="text" id="sp_abbreviation" name="sp_abbreviation" value="<?php echo esc_attr( $abbreviation ); ?>"></p>
121
  */
122
  public static function save( $post_id, $post ) {
123
  update_post_meta( $post_id, 'sp_url', esc_url( sp_array_value( $_POST, 'sp_url', '' ) ) );
124
+ update_post_meta( $post_id, 'sp_redirect', sp_array_value( $_POST, 'sp_redirect', 0 ) );
125
  update_post_meta( $post_id, 'sp_abbreviation', esc_attr( sp_array_value( $_POST, 'sp_abbreviation', '' ) ) );
126
  }
127
  }
includes/admin/settings/class-sp-settings-events.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -231,7 +231,7 @@ class SP_Settings_Events extends SP_Settings_Page {
231
  ),
232
 
233
  array(
234
- array( 'title' => __( 'Logos', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'event_logo_options' ),
235
  ),
236
 
237
  apply_filters( 'sportspress_event_logo_options', array(
@@ -250,7 +250,7 @@ class SP_Settings_Events extends SP_Settings_Page {
250
  'title' => __( 'Display', 'sportspress' ),
251
  'desc' => __( 'Name', 'sportspress' ),
252
  'id' => 'sportspress_event_logos_show_team_names',
253
- 'default' => 'no',
254
  'type' => 'checkbox',
255
  'checkboxgroup' => 'start',
256
  ),
@@ -388,7 +388,7 @@ class SP_Settings_Events extends SP_Settings_Page {
388
  array(
389
  'desc' => __( 'Minutes', 'sportspress' ),
390
  'id' => 'sportspress_event_performance_show_minutes',
391
- 'default' => 'yes',
392
  'type' => 'checkbox',
393
  'checkboxgroup' => 'end',
394
  ),
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
231
  ),
232
 
233
  array(
234
+ array( 'title' => __( 'Teams', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'event_logo_options' ),
235
  ),
236
 
237
  apply_filters( 'sportspress_event_logo_options', array(
250
  'title' => __( 'Display', 'sportspress' ),
251
  'desc' => __( 'Name', 'sportspress' ),
252
  'id' => 'sportspress_event_logos_show_team_names',
253
+ 'default' => 'yes',
254
  'type' => 'checkbox',
255
  'checkboxgroup' => 'start',
256
  ),
388
  array(
389
  'desc' => __( 'Minutes', 'sportspress' ),
390
  'id' => 'sportspress_event_performance_show_minutes',
391
+ 'default' => 'no',
392
  'type' => 'checkbox',
393
  'checkboxgroup' => 'end',
394
  ),
includes/admin/settings/class-sp-settings-general.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 1.9.17
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -27,7 +27,7 @@ class SP_Settings_General extends SP_Settings_Page {
27
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
28
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
29
  add_action( 'sportspress_admin_field_timezone', array( $this, 'timezone_setting' ) );
30
- add_action( 'sportspress_admin_field_frontend_styles', array( $this, 'frontend_styles_setting' ) );
31
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
32
  }
33
 
@@ -65,7 +65,7 @@ class SP_Settings_General extends SP_Settings_Page {
65
  );
66
 
67
  $options = array(
68
- array( 'type' => 'frontend_styles' ),
69
  );
70
 
71
  if ( ( $styles = SP_Frontend_Scripts::get_styles() ) && array_key_exists( 'sportspress-general', $styles ) ):
@@ -191,10 +191,11 @@ class SP_Settings_General extends SP_Settings_Page {
191
  * Save settings
192
  */
193
  public function save() {
194
- if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
195
  $sport = $_POST['sportspress_sport'];
196
  SP_Admin_Sports::apply_preset( $sport );
197
- update_option( '_sp_needs_welcome', 0 );
 
198
  endif;
199
 
200
  if ( isset( $_POST['add_sample_data'] ) ):
@@ -294,7 +295,7 @@ class SP_Settings_General extends SP_Settings_Page {
294
  * @access public
295
  * @return void
296
  */
297
- public function frontend_styles_setting() {
298
  // Define color schemes each with 5 colors: Primary, Background, Text, Heading, Link
299
  $color_schemes = apply_filters( 'sportspress_color_schemes', array(
300
  'ThemeBoy' => array( '2b353e', 'f4f4f4', '222222', 'ffffff', '00a69c' ),
@@ -308,7 +309,7 @@ class SP_Settings_General extends SP_Settings_Page {
308
  ) );
309
  ?><tr valign="top" class="themeboy">
310
  <th scope="row" class="titledesc">
311
- <?php _e( 'Frontend Styles', 'sportspress' ); ?>
312
  </th>
313
  <td class="forminp">
314
  <fieldset>
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.2.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
27
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
28
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
29
  add_action( 'sportspress_admin_field_timezone', array( $this, 'timezone_setting' ) );
30
+ add_action( 'sportspress_admin_field_colors', array( $this, 'colors_setting' ) );
31
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
32
  }
33
 
65
  );
66
 
67
  $options = array(
68
+ array( 'type' => 'colors' ),
69
  );
70
 
71
  if ( ( $styles = SP_Frontend_Scripts::get_styles() ) && array_key_exists( 'sportspress-general', $styles ) ):
191
  * Save settings
192
  */
193
  public function save() {
194
+ if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) !== $_POST['sportspress_sport'] ):
195
  $sport = $_POST['sportspress_sport'];
196
  SP_Admin_Sports::apply_preset( $sport );
197
+ delete_option( '_sp_needs_welcome' );
198
+ update_option( 'sportspress_installed', 1 );
199
  endif;
200
 
201
  if ( isset( $_POST['add_sample_data'] ) ):
295
  * @access public
296
  * @return void
297
  */
298
+ public function colors_setting() {
299
  // Define color schemes each with 5 colors: Primary, Background, Text, Heading, Link
300
  $color_schemes = apply_filters( 'sportspress_color_schemes', array(
301
  'ThemeBoy' => array( '2b353e', 'f4f4f4', '222222', 'ffffff', '00a69c' ),
309
  ) );
310
  ?><tr valign="top" class="themeboy">
311
  <th scope="row" class="titledesc">
312
+ <?php _e( 'Color Scheme', 'sportspress' ); ?>
313
  </th>
314
  <td class="forminp">
315
  <fieldset>
includes/admin/settings/class-sp-settings-modules.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -74,33 +74,19 @@ class SP_Settings_Modules extends SP_Settings_Page {
74
  </table>
75
  <?php } ?>
76
 
77
- <?php if ( ! class_exists( 'SportsPress_Twitter' ) ) { ?>
78
  <table class="widefat" cellspacing="0">
79
  <thead>
80
  <tr><th>
81
- <strong><?php _e( 'Twitter Module', 'sportspress' ); ?></strong>
82
  </th></tr>
83
  </thead>
84
  <tbody>
85
  <tr><td>
86
- <ol><li><?php echo str_replace(
87
- array( '[link]', '[/link]' ),
88
- array( '<a target="_blank" href="http://twitter.com/themeboy">', '</a>' ),
89
- __( 'Follow [link]@ThemeBoy[/link] on Twitter.','sportspress' )
90
- ); ?></li>
91
- <li><?php echo str_replace(
92
- array( '[link]', '[/link]' ),
93
- array( '<a target="_blank" href="http://tboy.co/tweet">', '</a>' ),
94
- __( 'Help spread the word by tweeting with [link]#SportsPress[/link] and get the Twitter module for free.','sportspress' )
95
- ); ?></li>
96
- <li><?php echo str_replace(
97
- array( '[link]', '[/link]' ),
98
- array( '<a target="_blank" href="http://tboy.co/twittermodule">', '</a>' ),
99
- __( '[link]Get the download link[/link].', 'sportspress' )
100
- ); ?></li></ol>
101
  <p class="sp-module-actions">
102
- <span><?php _e( 'Free with tweet', 'sportspress' ); ?></span>
103
- <a class="button" href="http://tboy.co/tweet" target="_blank"><?php _e( 'Tweet', 'sportspress' ); ?></a>
104
  </p>
105
  </td></tr>
106
  </tbody>
@@ -239,17 +225,14 @@ class SP_Settings_Modules extends SP_Settings_Page {
239
  <i class="<?php echo sp_array_value( $module, 'icon', 'dashicons dashicons-admin-generic' ); ?>"></i>
240
  <?php echo sp_array_value( $module, 'label', $id ); ?>
241
  </span>
242
- <?php if ( isset( $module['desc'] ) && ! array_key_exists( 'action', $module ) ) { ?>
243
  <span class="sp-desc">
244
  <?php echo $module['desc']; ?>
245
- <?php if ( array_key_exists( 'link', $module ) && ! array_key_exists( 'action', $module ) ) { ?>
246
  <a href="<?php echo $module['link']; ?>" target="_blank"><?php echo sp_array_value( $module, 'action', __( 'Learn more', 'sportspress' ) ); ?></a>
247
  <?php } ?>
248
  </span>
249
  <?php } ?>
250
- <?php if ( array_key_exists( 'link', $module ) && array_key_exists( 'action', $module ) ) { ?>
251
- <a class="button" href="<?php echo $module['link']; ?>" target="_blank"><?php echo sp_array_value( $module, 'action', __( 'Learn more', 'sportspress' ) ); ?></a>
252
- <?php } ?>
253
  </td></tr>
254
  <?php } else { ?>
255
  <tr><td>
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.2.10
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
74
  </table>
75
  <?php } ?>
76
 
77
+ <?php if ( ! class_exists( 'SportsPress_Twitter' ) || ! class_exists( 'SportsPress_Facebook' ) ) { ?>
78
  <table class="widefat" cellspacing="0">
79
  <thead>
80
  <tr><th>
81
+ <strong><?php _e( 'Get Freebies', 'sportspress' ); ?></strong>
82
  </th></tr>
83
  </thead>
84
  <tbody>
85
  <tr><td>
86
+ <p><?php _e( 'Instant access to exclusive SportsPress extensions and free downloads.', 'sportspress' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  <p class="sp-module-actions">
88
+ <span><?php _e( 'Create a free account', 'sportspress' ); ?></span>
89
+ <a class="button" href="http://tboy.co/account" target="_blank"><?php _e( 'Sign Up', 'sportspress' ); ?></a>
90
  </p>
91
  </td></tr>
92
  </tbody>
225
  <i class="<?php echo sp_array_value( $module, 'icon', 'dashicons dashicons-admin-generic' ); ?>"></i>
226
  <?php echo sp_array_value( $module, 'label', $id ); ?>
227
  </span>
228
+ <?php if ( isset( $module['desc'] ) ) { ?>
229
  <span class="sp-desc">
230
  <?php echo $module['desc']; ?>
231
+ <?php if ( array_key_exists( 'link', $module ) ) { ?>
232
  <a href="<?php echo $module['link']; ?>" target="_blank"><?php echo sp_array_value( $module, 'action', __( 'Learn more', 'sportspress' ) ); ?></a>
233
  <?php } ?>
234
  </span>
235
  <?php } ?>
 
 
 
236
  </td></tr>
237
  <?php } else { ?>
238
  <tr><td>
includes/admin/settings/class-sp-settings-players.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -122,6 +122,22 @@ class SP_Settings_Players extends SP_Settings_Page {
122
  'checkboxgroup' => 'end',
123
  ),
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  array(
126
  'title' => __( 'Columns', 'sportspress' ),
127
  'id' => 'sportspress_player_columns',
@@ -134,7 +150,7 @@ class SP_Settings_Players extends SP_Settings_Page {
134
  ),
135
 
136
  array(
137
- 'title' => __( 'Statistics', 'sportspress' ),
138
  'id' => 'sportspress_player_performance_sections',
139
  'default' => -1,
140
  'type' => 'radio',
@@ -146,24 +162,28 @@ class SP_Settings_Players extends SP_Settings_Page {
146
  ),
147
 
148
  array(
149
- 'title' => __( 'Total', 'sportspress' ),
150
- 'desc' => __( 'Display total', 'sportspress' ),
151
  'id' => 'sportspress_player_show_total',
152
  'default' => 'no',
153
  'type' => 'checkbox',
 
154
  ),
155
 
156
  array(
157
- 'title' => __( 'Nationality', 'sportspress' ),
158
- 'desc' => __( 'Display national flags', 'sportspress' ),
159
- 'id' => 'sportspress_player_show_flags',
160
- 'default' => 'yes',
161
  'type' => 'checkbox',
 
162
  ),
 
 
 
163
  ) ),
164
 
165
  array(
166
- array( 'type' => 'sectionend', 'id' => 'player_options' ),
167
  )
168
 
169
  );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.2.4
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
122
  'checkboxgroup' => 'end',
123
  ),
124
 
125
+ array(
126
+ 'title' => __( 'Nationality', 'sportspress' ),
127
+ 'desc' => __( 'Display national flags', 'sportspress' ),
128
+ 'id' => 'sportspress_player_show_flags',
129
+ 'default' => 'yes',
130
+ 'type' => 'checkbox',
131
+ ),
132
+ ) ),
133
+
134
+ array(
135
+ array( 'type' => 'sectionend', 'id' => 'player_options' ),
136
+ ),
137
+
138
+ array(
139
+ array( 'title' => __( 'Statistics', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'player_statistic_options' ),
140
+
141
  array(
142
  'title' => __( 'Columns', 'sportspress' ),
143
  'id' => 'sportspress_player_columns',
150
  ),
151
 
152
  array(
153
+ 'title' => __( 'Categories', 'sportspress' ),
154
  'id' => 'sportspress_player_performance_sections',
155
  'default' => -1,
156
  'type' => 'radio',
162
  ),
163
 
164
  array(
165
+ 'title' => __( 'Display', 'sportspress' ),
166
+ 'desc' => __( 'Total', 'sportspress' ),
167
  'id' => 'sportspress_player_show_total',
168
  'default' => 'no',
169
  'type' => 'checkbox',
170
+ 'checkboxgroup' => 'start',
171
  ),
172
 
173
  array(
174
+ 'desc' => __( 'Career Total', 'sportspress' ),
175
+ 'id' => 'sportspress_player_show_career_total',
176
+ 'default' => 'no',
 
177
  'type' => 'checkbox',
178
+ 'checkboxgroup' => 'end',
179
  ),
180
+ ),
181
+
182
+ apply_filters( 'sportspress_player_statistic_options', array(
183
  ) ),
184
 
185
  array(
186
+ array( 'type' => 'sectionend', 'id' => 'player_statistic_options' ),
187
  )
188
 
189
  );
includes/admin/views/html-admin-config.php CHANGED
@@ -140,10 +140,8 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
140
  <tbody>
141
  <?php
142
  $selection = get_option( 'sportspress_primary_performance', 0 );
143
- $mode = get_option( 'sportspress_event_performance_mode', 'values' );
144
- $colspan = 7;
145
-
146
- if ( 'icons' === $mode ) $colspan ++;
147
  if ( 'auto' === $columns ) $colspan ++;
148
 
149
  $args = array(
@@ -168,9 +166,7 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
168
  <thead>
169
  <tr>
170
  <th class="radio" scope="col"><?php _e( 'Primary', 'sportspress' ); ?></th>
171
- <?php if ( 'icons' === $mode ) { ?>
172
- <th class="icon" scope="col"><?php _e( 'Icon', 'sportspress' ); ?></th>
173
- <?php } ?>
174
  <th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
175
  <th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
176
  <th scope="col"><?php _e( 'Category', 'sportspress' ); ?></th>
@@ -188,9 +184,7 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
188
  <tfoot>
189
  <tr>
190
  <th class="radio"><input type="radio" class="sp-primary-performance-option" id="sportspress_primary_performance_0" name="sportspress_primary_performance" value="0" <?php checked( $selection, 0 ); ?>></th>
191
- <?php if ( 'icons' === $mode ) { ?>
192
- <th class="icon">&nbsp;</td>
193
- <?php } ?>
194
  <th colspan="<?php echo $colspan - 1; ?>"><label for="sportspress_primary_performance_0">
195
  <?php
196
  if ( sizeof( $data ) > 0 ):
@@ -210,18 +204,16 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
210
  ?>
211
  <tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
212
  <td class="radio"><input type="radio" class="sp-primary-performance-option" id="sportspress_primary_performance_<?php echo $row->post_name; ?>" name="sportspress_primary_performance" value="<?php echo $row->post_name; ?>" <?php checked( $selection, $row->post_name ); ?>></td>
213
- <?php if ( 'icons' === $mode ) { ?>
214
- <td class="icon">
215
- <?php
216
- if ( has_post_thumbnail( $row->ID ) )
217
- $icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );
218
- else
219
- $icon = '&nbsp;';
220
 
221
- echo apply_filters( 'sportspress_performance_icon', $icon, $row->ID );
222
- ?>
223
- </td>
224
- <?php } ?>
225
  <td class="row-title"><?php echo $row->post_title; ?></td>
226
  <td><code><?php echo $row->post_name; ?></code></td>
227
  <td><?php echo sp_get_post_section( $row->ID ); ?></td>
140
  <tbody>
141
  <?php
142
  $selection = get_option( 'sportspress_primary_performance', 0 );
143
+ $colspan = 8;
144
+
 
 
145
  if ( 'auto' === $columns ) $colspan ++;
146
 
147
  $args = array(
166
  <thead>
167
  <tr>
168
  <th class="radio" scope="col"><?php _e( 'Primary', 'sportspress' ); ?></th>
169
+ <th class="icon" scope="col"><?php _e( 'Icon', 'sportspress' ); ?></th>
 
 
170
  <th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
171
  <th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
172
  <th scope="col"><?php _e( 'Category', 'sportspress' ); ?></th>
184
  <tfoot>
185
  <tr>
186
  <th class="radio"><input type="radio" class="sp-primary-performance-option" id="sportspress_primary_performance_0" name="sportspress_primary_performance" value="0" <?php checked( $selection, 0 ); ?>></th>
187
+ <th class="icon">&nbsp;</td>
 
 
188
  <th colspan="<?php echo $colspan - 1; ?>"><label for="sportspress_primary_performance_0">
189
  <?php
190
  if ( sizeof( $data ) > 0 ):
204
  ?>
205
  <tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
206
  <td class="radio"><input type="radio" class="sp-primary-performance-option" id="sportspress_primary_performance_<?php echo $row->post_name; ?>" name="sportspress_primary_performance" value="<?php echo $row->post_name; ?>" <?php checked( $selection, $row->post_name ); ?>></td>
207
+ <td class="icon">
208
+ <?php
209
+ if ( has_post_thumbnail( $row->ID ) )
210
+ $icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );
211
+ else
212
+ $icon = '&nbsp;';
 
213
 
214
+ echo apply_filters( 'sportspress_performance_icon', $icon, $row->ID );
215
+ ?>
216
+ </td>
 
217
  <td class="row-title"><?php echo $row->post_title; ?></td>
218
  <td><code><?php echo $row->post_name; ?></code></td>
219
  <td><?php echo sp_get_post_section( $row->ID ); ?></td>
includes/api/class-sp-rest-api.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress REST API class handles all API-related hooks.
6
  *
7
  * @class SP_REST_API
8
- * @version 2.1.5
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @package SportsPress/API
@@ -41,23 +41,14 @@ class SP_REST_API {
41
  * Create REST routes.
42
  */
43
  public static function create_routes() {
44
- if ( ! class_exists( 'WP_REST_Posts_Controller' ) ) return;
45
 
46
  if ( ! class_exists( 'SP_REST_Posts_Controller' ) ) {
47
  require_once dirname( __FILE__ ) . '/class-sp-rest-posts-controller.php';
48
  }
49
 
50
- $controller = new SP_REST_Posts_Controller( 'sp_event' );
51
- $controller->register_routes();
52
-
53
- $controller = new SP_REST_Posts_Controller( 'sp_team' );
54
- $controller->register_routes();
55
-
56
- $controller = new SP_REST_Posts_Controller( 'sp_player' );
57
- $controller->register_routes();
58
-
59
- $controller = new SP_REST_Posts_Controller( 'sp_staff' );
60
- $controller->register_routes();
61
 
62
  do_action( 'sportspress_create_rest_routes' );
63
  }
5
  * The SportsPress REST API class handles all API-related hooks.
6
  *
7
  * @class SP_REST_API
8
+ * @version 2.2
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @package SportsPress/API
41
  * Create REST routes.
42
  */
43
  public static function create_routes() {
 
44
 
45
  if ( ! class_exists( 'SP_REST_Posts_Controller' ) ) {
46
  require_once dirname( __FILE__ ) . '/class-sp-rest-posts-controller.php';
47
  }
48
 
49
+ if ( ! class_exists( 'SP_REST_Terms_Controller' ) ) {
50
+ require_once dirname( __FILE__ ) . '/class-sp-rest-terms-controller.php';
51
+ }
 
 
 
 
 
 
 
 
52
 
53
  do_action( 'sportspress_create_rest_routes' );
54
  }
includes/api/class-sp-rest-posts-controller.php CHANGED
@@ -1,64 +1,10 @@
1
  <?php
2
 
3
- class SP_REST_Posts_Controller extends WP_REST_Posts_Controller {
4
-
5
- protected $post_type;
6
-
7
- public function __construct( $post_type ) {
8
- $this->post_type = $post_type;
9
- $this->namespace = 'sportspress/v2';
10
- $obj = get_post_type_object( $post_type );
11
- $this->rest_base = ! empty( $obj->rest_base ) ? $obj->rest_base : $obj->name;
12
- }
13
-
14
- /**
15
- * Register the routes for the objects of the controller.
16
- */
17
- public function register_routes() {
18
-
19
- register_rest_route( $this->namespace, '/' . $this->rest_base, array(
20
- array(
21
- 'methods' => WP_REST_Server::READABLE,
22
- 'callback' => array( $this, 'get_items' ),
23
- 'permission_callback' => array( $this, 'get_items_permissions_check' ),
24
- 'args' => $this->get_collection_params(),
25
- ),
26
- array(
27
- 'methods' => WP_REST_Server::CREATABLE,
28
- 'callback' => array( $this, 'create_item' ),
29
- 'permission_callback' => array( $this, 'create_item_permissions_check' ),
30
- 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
31
- ),
32
- 'schema' => array( $this, 'get_public_item_schema' ),
33
- ) );
34
- register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array(
35
- array(
36
- 'methods' => WP_REST_Server::READABLE,
37
- 'callback' => array( $this, 'get_item' ),
38
- 'permission_callback' => array( $this, 'get_item_permissions_check' ),
39
- 'args' => array(
40
- 'context' => $this->get_context_param( array( 'default' => 'view' ) ),
41
- ),
42
- ),
43
- array(
44
- 'methods' => WP_REST_Server::EDITABLE,
45
- 'callback' => array( $this, 'update_item' ),
46
- 'permission_callback' => array( $this, 'update_item_permissions_check' ),
47
- 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
48
- ),
49
- array(
50
- 'methods' => WP_REST_Server::DELETABLE,
51
- 'callback' => array( $this, 'delete_item' ),
52
- 'permission_callback' => array( $this, 'delete_item_permissions_check' ),
53
- 'args' => array(
54
- 'force' => array(
55
- 'default' => false,
56
- 'description' => __( 'Whether to bypass trash and force deletion.' ),
57
- ),
58
- ),
59
- ),
60
- 'schema' => array( $this, 'get_public_item_schema' ),
61
- ) );
62
  }
63
-
64
  }
1
  <?php
2
 
3
+ if ( class_exists( 'WP_REST_Posts_Controller' ) ) {
4
+ class SP_REST_Posts_Controller extends WP_REST_Posts_Controller {
5
+ public function __construct( $post_type ) {
6
+ parent::__construct( $post_type );
7
+ $this->namespace = 'sportspress/v2';
8
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
 
10
  }
includes/api/class-sp-rest-terms-controller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( class_exists( 'WP_REST_Terms_Controller' ) ) {
4
+ class SP_REST_Terms_Controller extends WP_REST_Terms_Controller {
5
+ public function __construct( $taxonomy ) {
6
+ parent::__construct( $taxonomy );
7
+ $this->namespace = 'sportspress/v2';
8
+ }
9
+ }
10
+ }
includes/class-sp-calendar.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress calendar class handles individual calendar data.
6
  *
7
  * @class SP_Calendar
8
- * @version 2.1.3
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -95,7 +95,7 @@ class SP_Calendar extends SP_Custom_Post {
95
  $this->day = get_post_meta( $this->ID, 'sp_day', true );
96
 
97
  if ( ! $this->number )
98
- $this->number = 500;
99
  }
100
 
101
  /**
5
  * The SportsPress calendar class handles individual calendar data.
6
  *
7
  * @class SP_Calendar
8
+ * @version 2.2
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
95
  $this->day = get_post_meta( $this->ID, 'sp_day', true );
96
 
97
  if ( ! $this->number )
98
+ $this->number = -1;
99
  }
100
 
101
  /**
includes/class-sp-countries.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress countries class stores continent/country data.
6
  *
7
  * @class SP_Countries
8
- * @version 1.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -155,6 +155,7 @@ class SP_Countries {
155
  'fro',
156
  'gbr',
157
  'ger',
 
158
  'gre',
159
  'hun',
160
  'irl',
@@ -344,6 +345,7 @@ class SP_Countries {
344
  'geo' => __( "Georgia", 'sportspress' ),
345
  'ger' => __( "Germany", 'sportspress' ),
346
  'gha' => __( "Ghana", 'sportspress' ),
 
347
  'gnb' => __( "Guinea-Bissau", 'sportspress' ),
348
  'gre' => __( "Greece", 'sportspress' ),
349
  'grn' => __( "Grenada", 'sportspress' ),
5
  * The SportsPress countries class stores continent/country data.
6
  *
7
  * @class SP_Countries
8
+ * @version 2.2
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
155
  'fro',
156
  'gbr',
157
  'ger',
158
+ 'gib',
159
  'gre',
160
  'hun',
161
  'irl',
345
  'geo' => __( "Georgia", 'sportspress' ),
346
  'ger' => __( "Germany", 'sportspress' ),
347
  'gha' => __( "Ghana", 'sportspress' ),
348
+ 'gib' => __( "Gibraltar", 'sportspress' ),
349
  'gnb' => __( "Guinea-Bissau", 'sportspress' ),
350
  'gre' => __( "Greece", 'sportspress' ),
351
  'grn' => __( "Grenada", 'sportspress' ),
includes/class-sp-event.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
- * @version 2.1.6
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -98,16 +98,23 @@ class SP_Event extends SP_Custom_Post{
98
 
99
  $labels = array();
100
  $formats = array();
 
101
  $equations = array();
102
  foreach ( $vars as $var ) {
103
  $labels[ $var->post_name ] = $var->post_title;
 
104
  $format = get_post_meta( $var->ID, 'sp_format', true );
105
  if ( '' === $format ) {
106
  $format = 'number';
107
  }
108
  $formats[ $var->post_name ] = $format;
109
-
110
- if ( 'equation' === $format ) {
 
 
 
 
 
111
  $equation = get_post_meta( $var->ID, 'sp_equation', true );
112
  $precision = get_post_meta( $var->ID, 'sp_precision', true );
113
 
@@ -130,19 +137,9 @@ class SP_Event extends SP_Custom_Post{
130
  $players = sp_array_between( (array)get_post_meta( $this->ID, 'sp_player', false ), 0, $i );
131
  $data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
132
 
133
- $totals = array();
134
- foreach( $labels as $key => $label ):
135
- $totals[ $key ] = 0;
136
- endforeach;
137
-
138
  foreach( $data as $player_id => $player_performance ):
139
  if ( ! $player_id ) continue;
140
 
141
- foreach( $labels as $key => $label ):
142
- if ( array_key_exists( $key, $totals ) ):
143
- $totals[ $key ] += sp_array_value( $player_performance, $key, 0 );
144
- endif;
145
- endforeach;
146
  if ( ! array_key_exists( 'number', $player_performance ) ):
147
  $performance[ $team_id ][ $player_id ]['number'] = apply_filters( 'sportspress_event_performance_default_squad_number', get_post_meta( $player_id, 'sp_number', true ) );
148
  endif;
@@ -150,19 +147,11 @@ class SP_Event extends SP_Custom_Post{
150
  $performance[ $team_id ][ $player_id ]['position'] = sp_get_the_term_id( $player_id, 'sp_position', null );
151
  endif;
152
  endforeach;
153
-
154
- foreach( $totals as $key => $value ):
155
- $manual_total = sp_array_value( sp_array_value( $performance, 0, array() ), $key, null );
156
- if ( $manual_total != null ):
157
- $totals[ $key ] = $manual_total;
158
- endif;
159
- endforeach;
160
- $performance[ $team_id ][0] = array_merge( $totals, sp_array_value( sp_array_value( $performance, $team_id, array() ), 0, array() ) );
161
  endforeach;
162
  endif;
163
 
164
  if ( $admin ):
165
- return array( $labels, $columns, $performance, $teams, $formats, $order );
166
  else:
167
  // Add position to performance labels
168
  if ( taxonomy_exists( 'sp_position' ) ):
@@ -186,9 +175,14 @@ class SP_Event extends SP_Custom_Post{
186
  // Calculate equation-based performance
187
  if ( sizeof( $equations ) ):
188
  foreach ( $performance as $team => $players ):
 
 
189
  foreach ( $players as $player => $player_performance ):
 
 
190
  // Prepare existing values for equation calculation
191
  $vars = $player_performance;
 
192
  foreach ( $vars as $key => $var ):
193
  if ( empty( $var ) ) $vars[ $key ] = 0;
194
  endforeach;
@@ -201,8 +195,36 @@ class SP_Event extends SP_Custom_Post{
201
  endforeach;
202
  endif;
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  // Add minutes to box score values
205
- if ( 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'yes' ) ):
206
  $timeline = $this->timeline();
207
  if ( ! empty( $timeline ) ):
208
  foreach ( $performance as $team => $players ):
@@ -220,6 +242,9 @@ class SP_Event extends SP_Custom_Post{
220
 
221
  foreach ( $player_performance as $performance_key => $performance_value ):
222
 
 
 
 
223
  // Get performance times
224
  $times = sp_array_value( $player_timeline, $performance_key, array() );
225
  $times = array_filter( $times );
@@ -239,8 +264,152 @@ class SP_Event extends SP_Custom_Post{
239
  endif;
240
  }
241
 
242
- public function timeline( $admin = false) {
243
- return (array) get_post_meta( $this->ID, 'sp_timeline', true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  }
245
 
246
  public function main_results() {
@@ -471,4 +640,8 @@ class SP_Event extends SP_Custom_Post{
471
  public function sub_filter( $v ) {
472
  return sp_array_value( $v, 'status', 'lineup' ) == 'sub';
473
  }
 
 
 
 
474
  }
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
+ * @version 2.2.4
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
98
 
99
  $labels = array();
100
  $formats = array();
101
+ $timed = array();
102
  $equations = array();
103
  foreach ( $vars as $var ) {
104
  $labels[ $var->post_name ] = $var->post_title;
105
+
106
  $format = get_post_meta( $var->ID, 'sp_format', true );
107
  if ( '' === $format ) {
108
  $format = 'number';
109
  }
110
  $formats[ $var->post_name ] = $format;
111
+
112
+ if ( 'number' === $format ) {
113
+ $is_timed = get_post_meta( $var->ID, 'sp_timed', true );
114
+ if ( '' === $is_timed || $is_timed ) {
115
+ $timed[] = $var->post_name;
116
+ }
117
+ } elseif ( 'equation' === $format ) {
118
  $equation = get_post_meta( $var->ID, 'sp_equation', true );
119
  $precision = get_post_meta( $var->ID, 'sp_precision', true );
120
 
137
  $players = sp_array_between( (array)get_post_meta( $this->ID, 'sp_player', false ), 0, $i );
138
  $data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
139
 
 
 
 
 
 
140
  foreach( $data as $player_id => $player_performance ):
141
  if ( ! $player_id ) continue;
142
 
 
 
 
 
 
143
  if ( ! array_key_exists( 'number', $player_performance ) ):
144
  $performance[ $team_id ][ $player_id ]['number'] = apply_filters( 'sportspress_event_performance_default_squad_number', get_post_meta( $player_id, 'sp_number', true ) );
145
  endif;
147
  $performance[ $team_id ][ $player_id ]['position'] = sp_get_the_term_id( $player_id, 'sp_position', null );
148
  endif;
149
  endforeach;
 
 
 
 
 
 
 
 
150
  endforeach;
151
  endif;
152
 
153
  if ( $admin ):
154
+ return array( $labels, $columns, $performance, $teams, $formats, $order, $timed );
155
  else:
156
  // Add position to performance labels
157
  if ( taxonomy_exists( 'sp_position' ) ):
175
  // Calculate equation-based performance
176
  if ( sizeof( $equations ) ):
177
  foreach ( $performance as $team => $players ):
178
+ if ( ! is_array( $players ) ) continue;
179
+
180
  foreach ( $players as $player => $player_performance ):
181
+ if ( ! is_array( $player_performance ) ) continue;
182
+
183
  // Prepare existing values for equation calculation
184
  $vars = $player_performance;
185
+
186
  foreach ( $vars as $key => $var ):
187
  if ( empty( $var ) ) $vars[ $key ] = 0;
188
  endforeach;
195
  endforeach;
196
  endif;
197
 
198
+ // Convert to time notation
199
+ if ( in_array( 'time', $formats ) ):
200
+ foreach ( $performance as $team => $players ):
201
+ if ( ! is_array( $players ) ) continue;
202
+
203
+ foreach ( $players as $player => $player_performance ):
204
+ if ( ! $player ) continue;
205
+
206
+ foreach ( $player_performance as $performance_key => $performance_value ):
207
+
208
+ // Continue if not time format
209
+ if ( 'time' !== sp_array_value( $formats, $performance_key ) ) continue;
210
+
211
+ $intval = intval( $performance_value );
212
+ $timeval = gmdate( 'i:s', $intval );
213
+ $hours = floor( $intval / 3600 );
214
+
215
+ if ( '00' != $hours )
216
+ $timeval = $hours . ':' . $timeval;
217
+
218
+ $timeval = preg_replace( '/^0/', '', $timeval );
219
+
220
+ $performance[ $team ][ $player ][ $performance_key ] = $timeval;
221
+ endforeach;
222
+ endforeach;
223
+ endforeach;
224
+ endif;
225
+
226
  // Add minutes to box score values
227
+ if ( in_array( 'number', $formats ) && 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'no' ) ):
228
  $timeline = $this->timeline();
229
  if ( ! empty( $timeline ) ):
230
  foreach ( $performance as $team => $players ):
242
 
243
  foreach ( $player_performance as $performance_key => $performance_value ):
244
 
245
+ // Continue if not timed
246
+ if ( ! in_array( $performance_key, $timed ) ) continue;
247
+
248
  // Get performance times
249
  $times = sp_array_value( $player_timeline, $performance_key, array() );
250
  $times = array_filter( $times );
264
  endif;
265
  }
266
 
267
+ public function timeline( $admin = false, $linear = false ) {
268
+ $timeline = (array) get_post_meta( $this->ID, 'sp_timeline', true );
269
+
270
+ if ( ! $linear ) return $timeline;
271
+
272
+ $performance = (array) get_post_meta( $this->ID, 'sp_players', true );
273
+ if ( empty( $timeline ) ) return array();
274
+
275
+ $stats = array();
276
+ $player_ids = array();
277
+ $performance_keys = array();
278
+
279
+ // Clean up timeline
280
+ foreach ( $timeline as $team => $players ) {
281
+ if ( ! $team ) continue;
282
+
283
+ // Set home team
284
+ if ( ! isset( $home_team ) ) $home_team = $team;
285
+
286
+ // Determine side
287
+ if ( $home_team === $team ) {
288
+ $side = 'home';
289
+ } else {
290
+ $side = 'away';
291
+ }
292
+
293
+ $stats[] = array(
294
+ 'time' => -1,
295
+ 'id' => $team,
296
+ 'team' => $team,
297
+ 'side' => $side,
298
+ 'key' => 'team',
299
+ );
300
+
301
+ if ( ! is_array( $players ) ) continue;
302
+
303
+ foreach ( $players as $player => $keys ) {
304
+ if ( ! $player ) continue;
305
+ if ( ! is_array( $keys ) ) continue;
306
+
307
+ $player_ids[] = $player;
308
+
309
+ foreach ( $keys as $key => $times ) {
310
+ if ( ! is_array( $times ) || empty( $times ) ) continue;
311
+
312
+ foreach ( $times as $time ) {
313
+ if ( '' === $time ) continue;
314
+
315
+ $entry = array(
316
+ 'time' => $time,
317
+ 'id' => $player,
318
+ 'team' => $team,
319
+ 'side' => $side,
320
+ 'key' => $key,
321
+ );
322
+
323
+ if ( 'sub' === $key ) {
324
+ $sub = sp_array_value( sp_array_value( sp_array_value( $performance, $team ), $player ), 'sub', 0 );
325
+ $entry['sub'] = $sub;
326
+ $player_ids[] = $sub;
327
+ }
328
+
329
+ $stats[] = $entry;
330
+ }
331
+
332
+ $performance_keys[] = $key;
333
+ }
334
+ }
335
+ }
336
+
337
+ // Filter out duplicate player IDs and performance keys
338
+ $player_ids = array_unique( $player_ids );
339
+ $performance_keys = array_unique( $performance_keys );
340
+
341
+ // Get player names and numbers
342
+ $posts = get_posts( array(
343
+ 'post_type' => 'sp_player',
344
+ 'posts_per_page' => -1,
345
+ 'post__in' => $player_ids
346
+ ) );
347
+
348
+ $player_names = array();
349
+ $player_numbers = array();
350
+
351
+ if ( $posts ) {
352
+ foreach ( $posts as $post ) {
353
+ $player_names[ $post->ID ] = $post->post_title;
354
+ $player_numbers[ $post->ID ] = get_post_meta( $post->ID, 'sp_number', true );
355
+ }
356
+ }
357
+
358
+ // Get performance labels and icons
359
+ $posts = get_posts( array(
360
+ 'post_type' => 'sp_performance',
361
+ 'posts_per_page' => -1,
362
+ 'post_name__in' => $performance_keys
363
+ ) );
364
+
365
+ $performance_labels = array();
366
+ $performance_icons = array();
367
+
368
+ if ( $posts ) {
369
+ foreach ( $posts as $post ) {
370
+ $performance_labels[ $post->post_name ] = $post->post_title;
371
+
372
+ $icon = '';
373
+ if ( has_post_thumbnail( $post->ID ) ) {
374
+ $icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post->ID ) ) );
375
+ }
376
+ $performance_icons[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );
377
+ }
378
+ }
379
+
380
+ // Add missing info to stats
381
+ foreach ( $stats as $index => $details ) {
382
+ $stats[ $index ]['name'] = sp_array_value( $player_names, $details['id'] );
383
+ $stats[ $index ]['number'] = sp_array_value( $player_numbers, $details['id'] );
384
+
385
+ if ( 'team' === $details['key'] ) {
386
+ $name = sp_get_team_name( $details['team'] );
387
+ $stats[ $index ]['name'] = $name;
388
+ $stats[ $index ]['label'] = $name;
389
+ $stats[ $index ]['icon'] = sp_get_logo( $details['team'] );
390
+ } elseif ( 'sub' === $details['key'] ) {
391
+ $sub_name = sp_array_value( $player_names, $details['sub'], __( 'Substitute', 'sportspress' ) );
392
+ $sub_number = sp_array_value( $player_numbers, $details['sub'] );
393
+
394
+ if ( '' !== $sub_number ) {
395
+ $icon_title = $sub_number . '. ' . $sub_name;
396
+ } else {
397
+ $icon_title = $sub_name;
398
+ }
399
+
400
+ $stats[ $index ]['sub_name'] = $sub_name;
401
+ $stats[ $index ]['sub_number'] = $sub_number;
402
+ $stats[ $index ]['label'] = __( 'Substite', 'sportspress' );
403
+ $stats[ $index ]['icon'] = '<i class="sp-icon-sub" title="' . $icon_title . '"></i>';
404
+ } else {
405
+ $stats[ $index ]['label'] = sp_array_value( $performance_labels, $details['key'] );
406
+ $stats[ $index ]['icon'] = sp_array_value( $performance_icons, $details['key'] );
407
+ }
408
+ }
409
+
410
+ usort( $stats, array( $this, 'sort_timeline' ) );
411
+
412
+ return $stats;
413
  }
414
 
415
  public function main_results() {
640
  public function sub_filter( $v ) {
641
  return sp_array_value( $v, 'status', 'lineup' ) == 'sub';
642
  }
643
+
644
+ public function sort_timeline( $a, $b ) {
645
+ return $a['time'] - $b['time'];
646
+ }
647
  }
includes/class-sp-frontend-scripts.php CHANGED
@@ -3,7 +3,7 @@
3
  * Handle frontend forms
4
  *
5
  * @class SP_Frontend_Scripts
6
- * @version 2.0.11
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
@@ -167,7 +167,7 @@ class SP_Frontend_Scripts {
167
  echo '.sp-event-calendar tbody td a,.sp-event-calendar tbody td a:hover{background: none;}';
168
 
169
  if ( isset( $colors['primary'] ) )
170
- echo '.sp-data-table th,.sp-calendar th,.sp-data-table tfoot,.sp-calendar tfoot,.sp-button,.sp-heading{background:' . $colors['primary'] . ' !important}.sp-data-table tbody a,.sp-calendar tbody a{color:' . $colors['primary'] . ' !important}';
171
 
172
  if ( isset( $colors['background'] ) )
173
  echo '.sp-data-table tbody,.sp-calendar tbody{background: ' . $colors['background'] . ' !important}';
3
  * Handle frontend forms
4
  *
5
  * @class SP_Frontend_Scripts
6
+ * @version 2.2
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
167
  echo '.sp-event-calendar tbody td a,.sp-event-calendar tbody td a:hover{background: none;}';
168
 
169
  if ( isset( $colors['primary'] ) )
170
+ echo '.sp-data-table th,.sp-calendar th,.sp-data-table tfoot,.sp-calendar tfoot,.sp-button,.sp-heading{background:' . $colors['primary'] . ' !important}.sp-calendar tbody a{color:' . $colors['primary'] . ' !important}';
171
 
172
  if ( isset( $colors['background'] ) )
173
  echo '.sp-data-table tbody,.sp-calendar tbody{background: ' . $colors['background'] . ' !important}';
includes/class-sp-install.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Classes
8
- * @version 2.1.4
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -54,6 +54,7 @@ class SP_Install {
54
 
55
  // We no longer need to install pages
56
  delete_option( '_sp_needs_welcome' );
 
57
  delete_transient( '_sp_activation_redirect' );
58
 
59
  // What's new redirect
@@ -65,6 +66,7 @@ class SP_Install {
65
 
66
  // We no longer need to install configs
67
  delete_option( '_sp_needs_welcome' );
 
68
  delete_transient( '_sp_activation_redirect' );
69
 
70
  // What's new redirect
@@ -423,6 +425,17 @@ class SP_Install {
423
  update_option( 'sportspress_staff_template_order', $layout );
424
  }
425
  }
 
 
 
 
 
 
 
 
 
 
 
426
  }
427
 
428
  /**
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Classes
8
+ * @version 2.2.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
54
 
55
  // We no longer need to install pages
56
  delete_option( '_sp_needs_welcome' );
57
+ update_option( 'sportspress_installed', 1 );
58
  delete_transient( '_sp_activation_redirect' );
59
 
60
  // What's new redirect
66
 
67
  // We no longer need to install configs
68
  delete_option( '_sp_needs_welcome' );
69
+ update_option( 'sportspress_installed', 1 );
70
  delete_transient( '_sp_activation_redirect' );
71
 
72
  // What's new redirect
425
  update_option( 'sportspress_staff_template_order', $layout );
426
  }
427
  }
428
+
429
+ if ( version_compare( $version, '2.2', '<' ) ) {
430
+ update_option( 'sportspress_frontend_styles', 'no' );
431
+ update_option( 'sportspress_event_show_timeline', 'no' );
432
+ update_option( 'sportspress_event_logos_show_team_names', 'no' );
433
+ }
434
+
435
+ if ( version_compare( $version, '2.2.3', '<' ) ) {
436
+ $option = get_option( 'sportspress_player_show_total', 'no' );
437
+ update_option( 'sportspress_player_show_career_total', $option );
438
+ }
439
  }
440
 
441
  /**
includes/class-sp-league-table.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress league table class handles individual league table data.
6
  *
7
  * @class SP_League_Table
8
- * @version 2.0.13
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -21,6 +21,9 @@ class SP_League_Table extends SP_Custom_Post{
21
  /** @var array Inremental value for team position. */
22
  public $counter;
23
 
 
 
 
24
  /**
25
  * Returns formatted data
26
  *
@@ -28,7 +31,7 @@ class SP_League_Table extends SP_Custom_Post{
28
  * @param bool $admin
29
  * @return array
30
  */
31
- public function data( $admin = false ) {
32
  $league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' );
33
  $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );
34
  $table_stats = (array)get_post_meta( $this->ID, 'sp_teams', true );
@@ -36,52 +39,59 @@ class SP_League_Table extends SP_Custom_Post{
36
  $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true );
37
  $select = get_post_meta( $this->ID, 'sp_select', true );
38
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
 
 
39
 
40
  // Get labels from result variables
41
  $result_labels = (array)sp_get_var_labels( 'sp_result' );
42
 
43
  // Get labels from outcome variables
44
  $outcome_labels = (array)sp_get_var_labels( 'sp_outcome' );
 
 
 
45
 
46
- // Get teams automatically if set to auto
47
- if ( 'auto' == $select ) {
48
- $team_ids = array();
49
 
50
- $args = array(
51
- 'post_type' => 'sp_team',
52
- 'numberposts' => -1,
53
- 'posts_per_page' => -1,
54
- 'order' => 'ASC',
55
- 'tax_query' => array(
56
- 'relation' => 'AND',
57
- ),
58
- );
59
 
60
- if ( $league_ids ):
61
- $args['tax_query'][] = array(
62
- 'taxonomy' => 'sp_league',
63
- 'field' => 'term_id',
64
- 'terms' => $league_ids
65
- );
66
- endif;
67
 
68
- if ( $season_ids ):
69
- $args['tax_query'][] = array(
70
- 'taxonomy' => 'sp_season',
71
- 'field' => 'term_id',
72
- 'terms' => $season_ids
 
 
 
 
73
  );
74
- endif;
75
 
76
- $teams = get_posts( $args );
 
 
 
 
 
 
77
 
78
- if ( $teams && is_array( $teams ) ) {
79
- foreach ( $teams as $team ) {
80
- $team_ids[] = $team->ID;
81
- }
 
 
 
 
 
 
 
82
  }
83
- } else {
84
- $team_ids = (array)get_post_meta( $this->ID, 'sp_team', false );
85
  }
86
 
87
  // Get all leagues populated with stats where available
@@ -101,6 +111,9 @@ class SP_League_Table extends SP_Custom_Post{
101
  // Initialize streaks counter
102
  $streaks = array();
103
 
 
 
 
104
  // Initialize last counters
105
  $last5s = array();
106
  $last10s = array();
@@ -116,6 +129,9 @@ class SP_League_Table extends SP_Custom_Post{
116
  // Initialize team streaks counter
117
  $streaks[ $team_id ] = array( 'name' => '', 'count' => 0, 'fire' => 1 );
118
 
 
 
 
119
  // Initialize team last counters
120
  $last5s[ $team_id ] = array();
121
  $last10s[ $team_id ] = array();
@@ -217,6 +233,16 @@ class SP_League_Table extends SP_Custom_Post{
217
 
218
  $args = apply_filters( 'sportspress_table_data_event_args', $args );
219
 
 
 
 
 
 
 
 
 
 
 
220
  $events = get_posts( $args );
221
 
222
  $e = 0;
@@ -224,6 +250,10 @@ class SP_League_Table extends SP_Custom_Post{
224
  // Event loop
225
  foreach ( $events as $event ):
226
 
 
 
 
 
227
  $results = (array)get_post_meta( $event->ID, 'sp_results', true );
228
  $minutes = get_post_meta( $event->ID, 'sp_minutes', true );
229
  if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
@@ -232,8 +262,12 @@ class SP_League_Table extends SP_Custom_Post{
232
 
233
  foreach ( $results as $team_id => $team_result ):
234
 
235
- if ( ! in_array( $team_id, $team_ids ) )
 
 
 
236
  continue;
 
237
 
238
  if ( $team_result ): foreach ( $team_result as $key => $value ):
239
 
@@ -280,6 +314,12 @@ class SP_League_Table extends SP_Custom_Post{
280
  $streaks[ $team_id ]['fire'] = 0;
281
  endif;
282
 
 
 
 
 
 
 
283
  // Add to last 5 counter if sum is less than 5
284
  if ( array_key_exists( $team_id, $last5s ) && array_key_exists( $outcome, $last5s[ $team_id ] ) && array_sum( $last5s[ $team_id ] ) < 5 ):
285
  $last5s[ $team_id ][ $outcome ] ++;
@@ -307,6 +347,10 @@ class SP_League_Table extends SP_Custom_Post{
307
 
308
  else:
309
  if ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $key . 'for', $totals[ $team_id ] ) ):
 
 
 
 
310
  $totals[ $team_id ][ $key . 'for' ] += $value;
311
  $totals[ $team_id ][ $key . 'for' . ( $e + 1 ) ] = $value;
312
 
@@ -324,19 +368,23 @@ class SP_League_Table extends SP_Custom_Post{
324
 
325
  foreach( $results as $other_team_id => $other_result ):
326
  if ( $other_team_id != $team_id && array_key_exists( $key . 'against', $totals[ $team_id ] ) ):
327
- $totals[ $team_id ][ $key . 'against' ] += sp_array_value( $other_result, $key, 0 );
328
- $totals[ $team_id ][ $key . 'against' . ( $e + 1 ) ] = sp_array_value( $other_result, $key, 0 );
 
 
 
 
329
 
330
  // Add to home or away stats
331
  if ( 0 === $i ):
332
- $totals[ $team_id ][ $key . 'against_home' ] += sp_array_value( $other_result, $key, 0 );
333
  else:
334
- $totals[ $team_id ][ $key . 'against_away' ] += sp_array_value( $other_result, $key, 0 );
335
  endif;
336
 
337
  // Add to venue stats
338
  if ( sp_is_home_venue( $team_id, $event->ID ) ):
339
- $totals[ $team_id ][ $key . 'against_venue' ] += sp_array_value( $other_result, $key, 0 );
340
  endif;
341
  endif;
342
  endforeach;
@@ -352,26 +400,51 @@ class SP_League_Table extends SP_Custom_Post{
352
  $e++;
353
 
354
  endforeach;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
 
356
  foreach ( $streaks as $team_id => $streak ):
357
  // Compile streaks counter and add to totals
358
  if ( $streak['name'] ):
359
- $args = array(
360
- 'name' => $streak['name'],
361
- 'post_type' => 'sp_outcome',
362
- 'post_status' => 'publish',
363
- 'posts_per_page' => 1,
364
- 'orderby' => 'menu_order',
365
- 'order' => 'ASC',
366
- );
367
- $outcomes = get_posts( $args );
368
-
369
- if ( $outcomes ):
370
- $outcome = reset( $outcomes );
371
- $abbreviation = get_post_meta( $outcome->ID, 'sp_abbreviation', true );
372
- if ( ! $abbreviation )
373
- $abbreviation = substr( $outcome->post_title, 0, 1 );
374
- $totals[ $team_id ]['streak'] = $abbreviation . $streak['count'];
375
  else:
376
  $totals[ $team_id ]['streak'] = null;
377
  endif;
@@ -380,6 +453,45 @@ class SP_League_Table extends SP_Custom_Post{
380
  endif;
381
  endforeach;
382
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  foreach ( $last5s as $team_id => $last5 ):
384
  // Add last 5 to totals
385
  $totals[ $team_id ]['last5'] = $last5;
@@ -446,6 +558,8 @@ class SP_League_Table extends SP_Custom_Post{
446
  if ( ! $team_id )
447
  continue;
448
 
 
 
449
  foreach ( $stats as $stat ):
450
  if ( sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $stat->post_name, '' ) == '' ):
451
 
@@ -461,12 +575,13 @@ class SP_League_Table extends SP_Custom_Post{
461
  if ( '$gamesback' == $stat->equation )
462
  $gb_column = $stat->post_name;
463
 
464
- if ( ! in_array( $stat->equation, array( '$gamesback', '$streak', '$last5', '$last10', '$homerecord', '$awayrecord' ) ) ):
465
  // Adjustments
466
  $adjustment = sp_array_value( $adjustments, $team_id, array() );
467
 
468
  if ( $adjustment != 0 ):
469
- $placeholder += sp_array_value( $adjustment, $stat->post_name, 0 );
 
470
  $placeholder = number_format( $placeholder, $stat->precision, '.', '' );
471
  endif;
472
  endif;
@@ -557,7 +672,37 @@ class SP_League_Table extends SP_Custom_Post{
557
 
558
  // Calculate position of teams for ties
559
  foreach ( $merged as $team_id => $team_columns ) {
560
- $merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  }
562
 
563
  // Rearrange data array to reflect values
@@ -566,7 +711,9 @@ class SP_League_Table extends SP_Custom_Post{
566
  $data[ $key ] = $tempdata[ $key ];
567
  endforeach;
568
 
569
- if ( $admin ):
 
 
570
  $this->add_gb( $placeholders, $w, $l, $gb_column );
571
  return array( $columns, $usecolumns, $data, $placeholders, $merged );
572
  else:
@@ -613,17 +760,37 @@ class SP_League_Table extends SP_Custom_Post{
613
  /**
614
  * Find accurate position of teams.
615
  *
616
- * @param array $a
617
- * @param array $b
618
  * @return int
619
  */
620
- public function calculate_pos( $columns ) {
621
  $this->counter++;
622
-
623
- if ( 'yes' == get_option( 'sportspress_table_increment', 'no' ) ) {
624
- return $this->counter;
 
 
 
 
 
 
 
 
 
 
625
  }
 
 
 
626
 
 
 
 
 
 
 
 
627
  // Replace compare data and use last set
628
  $compare = $this->compare;
629
  $this->compare = $columns;
@@ -642,6 +809,10 @@ class SP_League_Table extends SP_Custom_Post{
642
 
643
  endforeach;
644
 
 
 
 
 
645
  // Repeat position if equal
646
  return $this->pos;
647
  }
5
  * The SportsPress league table class handles individual league table data.
6
  *
7
  * @class SP_League_Table
8
+ * @version 2.2.10
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
21
  /** @var array Inremental value for team position. */
22
  public $counter;
23
 
24
+ /** @var array Teams to check for tiebreakers. */
25
+ public $tiebreakers = array();
26
+
27
  /**
28
  * Returns formatted data
29
  *
31
  * @param bool $admin
32
  * @return array
33
  */
34
+ public function data( $admin = false, $team_ids = null ) {
35
  $league_ids = sp_get_the_term_ids( $this->ID, 'sp_league' );
36
  $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );
37
  $table_stats = (array)get_post_meta( $this->ID, 'sp_teams', true );
39
  $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true );
40
  $select = get_post_meta( $this->ID, 'sp_select', true );
41
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
42
+ $link_events = get_option( 'sportspress_link_events', 'yes' ) === 'yes' ? true : false;
43
+ $form_limit = (int) get_option( 'sportspress_form_limit', 5 );
44
 
45
  // Get labels from result variables
46
  $result_labels = (array)sp_get_var_labels( 'sp_result' );
47
 
48
  // Get labels from outcome variables
49
  $outcome_labels = (array)sp_get_var_labels( 'sp_outcome' );
50
+
51
+ // Determine if main loop
52
+ if ( $team_ids ) {
53
 
54
+ $is_main_loop = false;
 
 
55
 
56
+ } else {
 
 
 
 
 
 
 
 
57
 
58
+ // Get teams automatically if set to auto
59
+ if ( 'auto' == $select ) {
60
+ $team_ids = array();
 
 
 
 
61
 
62
+ $args = array(
63
+ 'post_type' => 'sp_team',
64
+ 'numberposts' => -1,
65
+ 'posts_per_page' => -1,
66
+ 'order' => 'ASC',
67
+ 'tax_query' => array(
68
+ 'relation' => 'AND',
69
+ ),
70
+ 'fields' => 'ids',
71
  );
 
72
 
73
+ if ( $league_ids ):
74
+ $args['tax_query'][] = array(
75
+ 'taxonomy' => 'sp_league',
76
+ 'field' => 'term_id',
77
+ 'terms' => $league_ids
78
+ );
79
+ endif;
80
 
81
+ if ( $season_ids ):
82
+ $args['tax_query'][] = array(
83
+ 'taxonomy' => 'sp_season',
84
+ 'field' => 'term_id',
85
+ 'terms' => $season_ids
86
+ );
87
+ endif;
88
+
89
+ $team_ids = get_posts( $args );
90
+ } else {
91
+ $team_ids = (array)get_post_meta( $this->ID, 'sp_team', false );
92
  }
93
+
94
+ $is_main_loop = true;
95
  }
96
 
97
  // Get all leagues populated with stats where available
111
  // Initialize streaks counter
112
  $streaks = array();
113
 
114
+ // Initialize form counter
115
+ $forms = array();
116
+
117
  // Initialize last counters
118
  $last5s = array();
119
  $last10s = array();
129
  // Initialize team streaks counter
130
  $streaks[ $team_id ] = array( 'name' => '', 'count' => 0, 'fire' => 1 );
131
 
132
+ // Initialize team form counter
133
+ $forms[ $team_id ] = array();
134
+
135
  // Initialize team last counters
136
  $last5s[ $team_id ] = array();
137
  $last10s[ $team_id ] = array();
233
 
234
  $args = apply_filters( 'sportspress_table_data_event_args', $args );
235
 
236
+ if ( ! $is_main_loop ):
237
+ if ( sizeof( $team_ids ) ):
238
+ $args['meta_query'][] = array(
239
+ 'key' => 'sp_team',
240
+ 'value' => $team_ids,
241
+ 'compare' => 'IN',
242
+ );
243
+ endif;
244
+ endif;
245
+
246
  $events = get_posts( $args );
247
 
248
  $e = 0;
250
  // Event loop
251
  foreach ( $events as $event ):
252
 
253
+ $teams = (array)get_post_meta( $event->ID, 'sp_team', false );
254
+ $teams = array_filter( $teams );
255
+ if ( ! $is_main_loop && sizeof( array_diff( $teams, $team_ids ) ) ) continue;
256
+
257
  $results = (array)get_post_meta( $event->ID, 'sp_results', true );
258
  $minutes = get_post_meta( $event->ID, 'sp_minutes', true );
259
  if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
262
 
263
  foreach ( $results as $team_id => $team_result ):
264
 
265
+ if ( ! in_array( $team_id, $teams ) ) continue;
266
+
267
+ if ( ! in_array( $team_id, $team_ids ) ) {
268
+ $i++;
269
  continue;
270
+ }
271
 
272
  if ( $team_result ): foreach ( $team_result as $key => $value ):
273
 
314
  $streaks[ $team_id ]['fire'] = 0;
315
  endif;
316
 
317
+ // Add to form counter
318
+ $forms[ $team_id ][] = array(
319
+ 'id' => $event->ID,
320
+ 'outcome' => $outcome,
321
+ );
322
+
323
  // Add to last 5 counter if sum is less than 5
324
  if ( array_key_exists( $team_id, $last5s ) && array_key_exists( $outcome, $last5s[ $team_id ] ) && array_sum( $last5s[ $team_id ] ) < 5 ):
325
  $last5s[ $team_id ][ $outcome ] ++;
347
 
348
  else:
349
  if ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $key . 'for', $totals[ $team_id ] ) ):
350
+
351
+ // Get numeric value
352
+ $value = floatval( $value );
353
+
354
  $totals[ $team_id ][ $key . 'for' ] += $value;
355
  $totals[ $team_id ][ $key . 'for' . ( $e + 1 ) ] = $value;
356
 
368
 
369
  foreach( $results as $other_team_id => $other_result ):
370
  if ( $other_team_id != $team_id && array_key_exists( $key . 'against', $totals[ $team_id ] ) ):
371
+
372
+ // Get numeric value of other team's result
373
+ $value = floatval( sp_array_value( $other_result, $key, 0 ) );
374
+
375
+ $totals[ $team_id ][ $key . 'against' ] += $value;
376
+ $totals[ $team_id ][ $key . 'against' . ( $e + 1 ) ] = $value;
377
 
378
  // Add to home or away stats
379
  if ( 0 === $i ):
380
+ $totals[ $team_id ][ $key . 'against_home' ] += $value;
381
  else:
382
+ $totals[ $team_id ][ $key . 'against_away' ] += $value;
383
  endif;
384
 
385
  // Add to venue stats
386
  if ( sp_is_home_venue( $team_id, $event->ID ) ):
387
+ $totals[ $team_id ][ $key . 'against_venue' ] += $value;
388
  endif;
389
  endif;
390
  endforeach;
400
  $e++;
401
 
402
  endforeach;
403
+
404
+ // Get outcomes
405
+ $outcomes = array();
406
+
407
+ $args = array(
408
+ 'post_type' => 'sp_outcome',
409
+ 'post_status' => 'publish',
410
+ 'posts_per_page' => -1,
411
+ );
412
+ $posts = get_posts( $args );
413
+
414
+ if ( $posts ):
415
+ foreach ( $posts as $post ):
416
+ // Get ID
417
+ $id = $post->ID;
418
+
419
+ // Get title
420
+ $title = $post->post_title;
421
+
422
+ // Get abbreviation
423
+ $abbreviation = get_post_meta( $id, 'sp_abbreviation', true );
424
+ if ( ! $abbreviation ):
425
+ $abbreviation = substr( $title, 0, 1 );
426
+ endif;
427
+
428
+ // Get color
429
+ $color = get_post_meta( $id, 'sp_color', true );
430
+ if ( '' === $color ) $color = '#888888';
431
+
432
+ $outcomes[ $post->post_name ] = array(
433
+ 'id' => $id,
434
+ 'title' => $title,
435
+ 'abbreviation' => $abbreviation,
436
+ 'color' => $color,
437
+ );
438
+ endforeach;
439
+ endif;
440
 
441
  foreach ( $streaks as $team_id => $streak ):
442
  // Compile streaks counter and add to totals
443
  if ( $streak['name'] ):
444
+ $outcome = sp_array_value( $outcomes, $streak['name'], false );
445
+ if ( $outcome ):
446
+ $color = $outcome['color'];
447
+ $totals[ $team_id ]['streak'] = '<span style="color:' . $color . '">' . $outcome['abbreviation'] . $streak['count'] . '</span>';
 
 
 
 
 
 
 
 
 
 
 
 
448
  else:
449
  $totals[ $team_id ]['streak'] = null;
450
  endif;
453
  endif;
454
  endforeach;
455
 
456
+ foreach ( $forms as $team_id => $form ):
457
+ // Apply form limit
458
+ if ( $form_limit && sizeof( $form ) > $form_limit ):
459
+ $form = array_slice( $form, 0, $form_limit );
460
+ endif;
461
+
462
+ // Initialize team form array
463
+ $team_form = array();
464
+
465
+ // Reverse form array to display in chronological order
466
+ $form = array_reverse( $form );
467
+
468
+ // Loop through event form
469
+ foreach ( $form as $form_event ):
470
+ if ( $form_event['id'] ):
471
+ $outcome = sp_array_value( $outcomes, $form_event['outcome'], false );
472
+ if ( $outcome ):
473
+ $abbreviation = $outcome['abbreviation'];
474
+ $color = $outcome['color'];
475
+ if ( $link_events ):
476
+ $abbreviation = '<a class="sp-form-event-link" href="' . get_post_permalink( $form_event['id'], false, true ) . '" style="background-color:' . $color . '">' . $abbreviation . '</a>';
477
+ else:
478
+ $abbreviation = '<span class="sp-form-event-link" style="background-color:' . $color . '">' . $abbreviation . '</span>';
479
+ endif;
480
+
481
+ // Add to team form
482
+ $team_form[] = $abbreviation;
483
+ endif;
484
+ endif;
485
+ endforeach;
486
+
487
+ // Append to totals
488
+ if ( sizeof( $team_form ) ):
489
+ $totals[ $team_id ]['form'] = '<div class="sp-form-events">' . implode( ' ', $team_form ) . '</div>';
490
+ else:
491
+ $totals[ $team_id ]['form'] = null;
492
+ endif;
493
+ endforeach;
494
+
495
  foreach ( $last5s as $team_id => $last5 ):
496
  // Add last 5 to totals
497
  $totals[ $team_id ]['last5'] = $last5;
558
  if ( ! $team_id )
559
  continue;
560
 
561
+ $placeholders[ $team_id ] = array();
562
+
563
  foreach ( $stats as $stat ):
564
  if ( sp_array_value( sp_array_value( $placeholders, $team_id, array() ), $stat->post_name, '' ) == '' ):
565
 
575
  if ( '$gamesback' == $stat->equation )
576
  $gb_column = $stat->post_name;
577
 
578
+ if ( ! in_array( $stat->equation, array( '$gamesback', '$streak', '$form', '$last5', '$last10', '$homerecord', '$awayrecord' ) ) ):
579
  // Adjustments
580
  $adjustment = sp_array_value( $adjustments, $team_id, array() );
581
 
582
  if ( $adjustment != 0 ):
583
+ $value = floatval( sp_array_value( $adjustment, $stat->post_name, 0 ) );
584
+ $placeholder += $value;
585
  $placeholder = number_format( $placeholder, $stat->precision, '.', '' );
586
  endif;
587
  endif;
672
 
673
  // Calculate position of teams for ties
674
  foreach ( $merged as $team_id => $team_columns ) {
675
+ $merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id );
676
+ }
677
+
678
+ // Head to head table sorting
679
+ if ( $is_main_loop && 'h2h' == get_option( 'sportspress_table_tiebreaker', 'none' ) ) {
680
+ $order = array();
681
+
682
+ foreach ( $this->tiebreakers as $pos => $teams ) {
683
+ if ( sizeof( $teams ) === 1 ) {
684
+ $order[] = reset( $teams );
685
+ } else {
686
+ $standings = $this->data( false, $teams );
687
+ $teams = array_keys( $standings );
688
+ foreach( $teams as $team ) {
689
+ $order[] = $team;
690
+ }
691
+ }
692
+ }
693
+
694
+ $head_to_head = array();
695
+ foreach ( $order as $team ) {
696
+ $head_to_head[ $team ] = sp_array_value( $merged, $team, array() );
697
+ }
698
+ $merged = $head_to_head;
699
+
700
+ // Recalculate position of teams after head to head
701
+ $this->pos = 0;
702
+ $this->counter = 0;
703
+ foreach ( $merged as $team_id => $team_columns ) {
704
+ $merged[ $team_id ]['pos'] = $this->calculate_pos( $team_columns, $team_id, false );
705
+ }
706
  }
707
 
708
  // Rearrange data array to reflect values
711
  $data[ $key ] = $tempdata[ $key ];
712
  endforeach;
713
 
714
+ if ( ! $is_main_loop ):
715
+ return $merged;
716
+ elseif ( $admin ):
717
  $this->add_gb( $placeholders, $w, $l, $gb_column );
718
  return array( $columns, $usecolumns, $data, $placeholders, $merged );
719
  else:
760
  /**
761
  * Find accurate position of teams.
762
  *
763
+ * @param array $columns
764
+ * @param int $id
765
  * @return int
766
  */
767
+ public function calculate_pos( $columns, $id = 0, $add_tiebreakers = true ) {
768
  $this->counter++;
769
+
770
+ $pos = $this->increment( $columns );
771
+
772
+ if ( $add_tiebreakers ) {
773
+ // Initialize tiebreaker position
774
+ if ( ! array_key_exists( $this->pos, $this->tiebreakers ) ) {
775
+ $this->tiebreakers[ $this->pos ] = array();
776
+ }
777
+
778
+ // Add to tiebreakers
779
+ if ( ! in_array( $id, $this->tiebreakers[ $this->pos ] ) ) {
780
+ $this->tiebreakers[ $this->pos ][] = $id;
781
+ }
782
  }
783
+
784
+ return $pos;
785
+ }
786
 
787
+ /**
788
+ * Increment position as needed.
789
+ *
790
+ * @param array $columns
791
+ * @return int
792
+ */
793
+ public function increment( $columns ) {
794
  // Replace compare data and use last set
795
  $compare = $this->compare;
796
  $this->compare = $columns;
809
 
810
  endforeach;
811
 
812
+ if ( 'yes' == get_option( 'sportspress_table_increment', 'no' ) ) {
813
+ return $this->counter;
814
+ }
815
+
816
  // Repeat position if equal
817
  return $this->pos;
818
  }
includes/class-sp-modules.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress modules class stores available modules.
6
  *
7
  * @class SP_Modules
8
- * @version 2.0
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -33,21 +33,28 @@ class SP_Modules {
33
  'label' => __( 'Scoreboard', 'sportspress' ),
34
  'class' => 'SportsPress_Scoreboard',
35
  'icon' => 'sp-icon-scoreboard',
36
- 'link' => 'http://tboy.co/pro',
37
  'desc' => __( 'Display multiple event results in a horizontal scoreboard.', 'sportspress' ),
38
  ),
39
  'match_stats' => array(
40
  'label' => __( 'Match Stats', 'sportspress' ),
41
  'class' => 'SportsPress_Match_Stats',
42
  'icon' => 'sp-icon-statistics',
43
- 'link' => 'http://tboy.co/pro',
44
  'desc' => __( 'Display head-to-head team comparison charts in events.', 'sportspress' ),
45
  ),
 
 
 
 
 
 
 
46
  'tournaments' => array(
47
  'label' => __( 'Tournaments', 'sportspress' ),
48
  'class' => 'SportsPress_Tournaments',
49
  'icon' => 'sp-icon-tournament',
50
- 'link' => 'http://tboy.co/pro',
51
  'desc' => __( 'Schedule tournaments and create interactive playoff brackets.', 'sportspress' ),
52
  ),
53
  ),
@@ -61,21 +68,21 @@ class SP_Modules {
61
  'label' => __( 'League Menu', 'sportspress' ),
62
  'class' => 'SportsPress_League_Menu',
63
  'icon' => 'sp-icon-menu',
64
- 'link' => 'http://tboy.co/pro',
65
  'desc' => __( 'Add a global navigation bar to display logos that link to each team.', 'sportspress' ),
66
  ),
67
  'team_colors' => array(
68
  'label' => __( 'Team Colors', 'sportspress' ),
69
  'class' => 'SportsPress_Team_Colors',
70
  'icon' => 'sp-icon-color',
71
- 'link' => 'http://tboy.co/pro',
72
  'desc' => __( 'Create a custom color palette for each team.', 'sportspress' ),
73
  ),
74
  'team_access' => array(
75
  'label' => __( 'Team Access', 'sportspress' ),
76
  'class' => 'SportsPress_Team_Access',
77
  'icon' => 'sp-icon-key',
78
- 'link' => 'http://tboy.co/pro',
79
  'desc' => __( 'Limit user access to data that is related to their team.', 'sportspress' ),
80
  ),
81
  ),
@@ -89,7 +96,7 @@ class SP_Modules {
89
  'label' => __( 'Directories', 'sportspress' ),
90
  'class' => 'SportsPress_Staff_Directories',
91
  'icon' => 'sp-icon-archive',
92
- 'link' => 'http://tboy.co/pro',
93
  'desc' => __( 'Organize and display staff in list and gallery layouts.', 'sportspress' ),
94
  ),
95
  ),
@@ -103,14 +110,14 @@ class SP_Modules {
103
  'label' => __( 'Branding', 'sportspress' ),
104
  'class' => 'SportsPress_Branding',
105
  'icon' => 'sp-icon-sportspress',
106
- 'link' => 'http://tboy.co/pro',
107
  'desc' => __( 'Instantly rebrand the dashboard with your own logo and colors.', 'sportspress' ),
108
  ),
109
  'duplicator' => array(
110
  'label' => __( 'Duplicator', 'sportspress' ),
111
  'class' => 'SportsPress_Duplicator',
112
  'icon' => 'sp-icon-copy',
113
- 'link' => 'http://tboy.co/pro',
114
  'desc' => __( 'Clone anything with just one click. Great for creating multiple events.', 'sportspress' ),
115
  ),
116
  ),
@@ -118,17 +125,24 @@ class SP_Modules {
118
  'twitter' => array(
119
  'label' => __( 'Twitter', 'sportspress' ),
120
  'class' => 'SportsPress_Twitter',
121
- 'action' => __( 'Tweet #SportsPress', 'sportspress' ),
122
- 'link' => 'http://tboy.co/tweet',
123
- 'tip' => __( 'Help spread the word by tweeting with #SportsPress and get the Twitter module for free.', 'sportspress' ),
124
  'icon' => 'dashicons dashicons-twitter',
 
125
  'desc' => __( 'Add a Twitter feed to team, player, and staff pages.', 'sportspress' ),
 
 
 
 
 
 
 
 
 
126
  ),
127
  'sponsors' => array(
128
  'label' => __( 'Sponsors', 'sportspress' ),
129
  'class' => 'SportsPress_Sponsors',
130
  'icon' => 'sp-icon-megaphone',
131
- 'link' => 'http://tboy.co/pro',
132
  'desc' => __( 'Attract sponsors by offering them advertising space on your website.', 'sportspress' ),
133
  ),
134
  ),
@@ -139,7 +153,7 @@ class SP_Modules {
139
  'label' => __( 'Multisite', 'sportspress' ),
140
  'class' => 'SportsPress_Multisite',
141
  'icon' => 'sp-icon-globe',
142
- 'link' => 'http://tboy.co/pro',
143
  'desc' => __( 'Manage multiple sports and display different widgets all on one site.', 'sportspress' ),
144
  );
145
  }
5
  * The SportsPress modules class stores available modules.
6
  *
7
  * @class SP_Modules
8
+ * @version 2.2.10
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
33
  'label' => __( 'Scoreboard', 'sportspress' ),
34
  'class' => 'SportsPress_Scoreboard',
35
  'icon' => 'sp-icon-scoreboard',
36
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/scoreboard/',
37
  'desc' => __( 'Display multiple event results in a horizontal scoreboard.', 'sportspress' ),
38
  ),
39
  'match_stats' => array(
40
  'label' => __( 'Match Stats', 'sportspress' ),
41
  'class' => 'SportsPress_Match_Stats',
42
  'icon' => 'sp-icon-statistics',
43
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/match-stats/',
44
  'desc' => __( 'Display head-to-head team comparison charts in events.', 'sportspress' ),
45
  ),
46
+ 'timelines' => array(
47
+ 'label' => __( 'Timelines', 'sportspress' ),
48
+ 'class' => 'SportsPress_Timelines',
49
+ 'icon' => 'sp-icon-timeline',
50
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/timelines/',
51
+ 'desc' => __( 'Display a visual timeline of player performance in events.', 'sportspress' ),
52
+ ),
53
  'tournaments' => array(
54
  'label' => __( 'Tournaments', 'sportspress' ),
55
  'class' => 'SportsPress_Tournaments',
56
  'icon' => 'sp-icon-tournament',
57
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/tournaments/',
58
  'desc' => __( 'Schedule tournaments and create interactive playoff brackets.', 'sportspress' ),
59
  ),
60
  ),
68
  'label' => __( 'League Menu', 'sportspress' ),
69
  'class' => 'SportsPress_League_Menu',
70
  'icon' => 'sp-icon-menu',
71
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/league-menu/',
72
  'desc' => __( 'Add a global navigation bar to display logos that link to each team.', 'sportspress' ),
73
  ),
74
  'team_colors' => array(
75
  'label' => __( 'Team Colors', 'sportspress' ),
76
  'class' => 'SportsPress_Team_Colors',
77
  'icon' => 'sp-icon-color',
78
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/team-colors/',
79
  'desc' => __( 'Create a custom color palette for each team.', 'sportspress' ),
80
  ),
81
  'team_access' => array(
82
  'label' => __( 'Team Access', 'sportspress' ),
83
  'class' => 'SportsPress_Team_Access',
84
  'icon' => 'sp-icon-key',
85
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/team-access/',
86
  'desc' => __( 'Limit user access to data that is related to their team.', 'sportspress' ),
87
  ),
88
  ),
96
  'label' => __( 'Directories', 'sportspress' ),
97
  'class' => 'SportsPress_Staff_Directories',
98
  'icon' => 'sp-icon-archive',
99
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/directories/',
100
  'desc' => __( 'Organize and display staff in list and gallery layouts.', 'sportspress' ),
101
  ),
102
  ),
110
  'label' => __( 'Branding', 'sportspress' ),
111
  'class' => 'SportsPress_Branding',
112
  'icon' => 'sp-icon-sportspress',
113
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/branding/',
114
  'desc' => __( 'Instantly rebrand the dashboard with your own logo and colors.', 'sportspress' ),
115
  ),
116
  'duplicator' => array(
117
  'label' => __( 'Duplicator', 'sportspress' ),
118
  'class' => 'SportsPress_Duplicator',
119
  'icon' => 'sp-icon-copy',
120
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/duplicator/',
121
  'desc' => __( 'Clone anything with just one click. Great for creating multiple events.', 'sportspress' ),
122
  ),
123
  ),
125
  'twitter' => array(
126
  'label' => __( 'Twitter', 'sportspress' ),
127
  'class' => 'SportsPress_Twitter',
 
 
 
128
  'icon' => 'dashicons dashicons-twitter',
129
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/twitter/',
130
  'desc' => __( 'Add a Twitter feed to team, player, and staff pages.', 'sportspress' ),
131
+ 'tip' => __( 'Free', 'sportspress' ),
132
+ ),
133
+ 'facebook' => array(
134
+ 'label' => __( 'Facebook', 'sportspress' ),
135
+ 'class' => 'SportsPress_Facebook',
136
+ 'icon' => 'dashicons dashicons-facebook',
137
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/facebook/',
138
+ 'desc' => __( 'Add a Facebook Page widget to embed and promote each team.', 'sportspress' ),
139
+ 'tip' => __( 'Free', 'sportspress' ),
140
  ),
141
  'sponsors' => array(
142
  'label' => __( 'Sponsors', 'sportspress' ),
143
  'class' => 'SportsPress_Sponsors',
144
  'icon' => 'sp-icon-megaphone',
145
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/sponsors/',
146
  'desc' => __( 'Attract sponsors by offering them advertising space on your website.', 'sportspress' ),
147
  ),
148
  ),
153
  'label' => __( 'Multisite', 'sportspress' ),
154
  'class' => 'SportsPress_Multisite',
155
  'icon' => 'sp-icon-globe',
156
+ 'link' => 'https://www.themeboy.com/sportspress-extensions/multisite/',
157
  'desc' => __( 'Manage multiple sports and display different widgets all on one site.', 'sportspress' ),
158
  );
159
  }
includes/class-sp-player-list.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
- * @version 2.1.6
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -24,7 +24,8 @@ class SP_Player_List extends SP_Custom_Post {
24
  public function __construct( $post ) {
25
  parent::__construct( $post );
26
  $this->columns = get_post_meta( $this->ID, 'sp_columns', true );
27
- if ( ! is_array( $this->columns ) ) $this->columns = array();
 
28
  }
29
 
30
  /**
@@ -196,6 +197,7 @@ class SP_Player_List extends SP_Custom_Post {
196
  if ( is_array( $player_league_season_stats ) ):
197
  foreach ( $player_league_season_stats as $key => $value ):
198
  $current_value = sp_array_value( sp_array_value( $placeholders, $player_id, array() ), $key, 0 );
 
199
  $placeholders[ $player_id ][ $key ] = $current_value + $value;
200
  endforeach;
201
  endif;
@@ -250,6 +252,7 @@ class SP_Player_List extends SP_Custom_Post {
250
  foreach ( $events as $i => $event ):
251
  $results = (array)get_post_meta( $event->ID, 'sp_results', true );
252
  $team_performance = get_post_meta( $event->ID, 'sp_players', true );
 
253
  $minutes = get_post_meta( $event->ID, 'sp_minutes', true );
254
  if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
255
 
@@ -302,6 +305,7 @@ class SP_Player_List extends SP_Custom_Post {
302
  endif;
303
  endforeach;
304
  elseif ( array_key_exists( $key, $totals[ $player_id ] ) ):
 
305
  $totals[ $player_id ][ $key ] += $value;
306
  endif;
307
  endforeach;
@@ -320,6 +324,23 @@ class SP_Player_List extends SP_Custom_Post {
320
  $totals[ $player_id ]['eventsplayed'] ++;
321
  $totals[ $player_id ]['eventminutes'] += $minutes;
322
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
324
  $totals[ $player_id ]['eventsstarted'] ++;
325
  elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
@@ -366,7 +387,7 @@ class SP_Player_List extends SP_Custom_Post {
366
 
367
  // Add to total
368
  $value = sp_array_value( $totals[ $player_id ], $result_slug . 'for', 0 );
369
- $value += $team_result;
370
  $totals[ $player_id ][ $result_slug . 'for' ] = $value;
371
 
372
  // Add subset
@@ -383,7 +404,7 @@ class SP_Player_List extends SP_Custom_Post {
383
 
384
  // Add to total
385
  $value = sp_array_value( $totals[ $player_id ], $result_slug . 'against', 0 );
386
- $value += $team_result;
387
  $totals[ $player_id ][ $result_slug . 'against' ] = $value;
388
 
389
  // Add subset
@@ -453,26 +474,56 @@ class SP_Player_List extends SP_Custom_Post {
453
  );
454
  $stats = get_posts( $args );
455
 
456
- foreach ( $stats as $stat ):
 
 
 
 
 
 
457
 
458
- // Get post meta
459
- $meta = get_post_meta( $stat->ID );
460
 
461
- // Add equation to object
462
- if ( $stat->post_type == 'sp_metric' ):
463
- $stat->equation = null;
464
- else:
465
- $stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, 0 );
466
- endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
 
468
- // Add precision to object
469
- $stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 );
470
 
471
- // Add column name to columns
472
- $columns[ $stat->post_name ] = $stat->post_title;
 
 
 
 
 
 
 
473
 
474
  endforeach;
475
 
 
 
 
476
  // Fill in empty placeholder values for each player
477
  foreach ( $player_ids as $player_id ):
478
  if ( ! $player_id )
@@ -480,38 +531,50 @@ class SP_Player_List extends SP_Custom_Post {
480
 
481
  $placeholders[ $player_id ] = array_merge( sp_array_value( $totals, $player_id, array() ), array_filter( sp_array_value( $placeholders, $player_id, array() ) ) );
482
 
483
- foreach ( $stats as $stat ):
484
- if ( sp_array_value( $placeholders[ $player_id ], $stat->post_name, '' ) == '' ):
485
 
486
- if ( $stat->equation === null ):
487
- $placeholder = sp_array_value( sp_array_value( $adjustments, $player_id, array() ), $stat->post_name, null );
488
- if ( $placeholder == null ):
489
- $placeholder = '-';
490
- endif;
491
- else:
492
- // Solve
493
- $placeholder = sp_solve( $stat->equation, $placeholders[ $player_id ], $stat->precision );
 
494
 
495
- // Adjustments
496
- $adjustment = sp_array_value( $adjustments, $player_id, array() );
497
 
498
- if ( $adjustment != 0 ):
499
- $placeholder += sp_array_value( $adjustment, $stat->post_name, 0 );
500
- $placeholder = number_format( $placeholder, $stat->precision, '.', '' );
501
- endif;
502
  endif;
 
 
 
 
 
 
 
503
 
504
- $placeholders[ $player_id ][ $stat->post_name ] = $placeholder;
 
505
  endif;
 
 
506
  endforeach;
507
 
508
  endforeach;
509
 
510
  // Merge the data and placeholders arrays
511
- $merged = array();
512
-
513
  foreach( $placeholders as $player_id => $player_data ):
514
 
 
 
 
515
  // Add player number and name to row
516
  $merged[ $player_id ] = array();
517
  if ( in_array( 'number', $this->columns ) ):
@@ -551,12 +614,36 @@ class SP_Player_List extends SP_Custom_Post {
551
  endif;
552
 
553
  // Rearrange data array to reflect values
554
- $data = array();
555
  foreach( $merged as $key => $value ):
556
  $data[ $key ] = $tempdata[ $key ];
557
  endforeach;
558
 
559
  if ( $admin ):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  $labels = array();
561
  foreach( $this->columns as $key ):
562
  if ( $key == 'number' ):
@@ -569,8 +656,34 @@ class SP_Player_List extends SP_Custom_Post {
569
  $labels[ $key ] = $columns[ $key ];
570
  endif;
571
  endforeach;
 
572
  return array( $labels, $data, $placeholders, $merged, $orderby );
573
  else:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
574
  if ( ! is_array( $this->columns ) )
575
  $this->columns = array();
576
  foreach ( $columns as $key => $label ):
@@ -612,7 +725,7 @@ class SP_Player_List extends SP_Custom_Post {
612
  else:
613
 
614
  // Compare performance values
615
- $output = sp_array_value( $a, $priority['key'], 0 ) - sp_array_value( $b, $priority['key'], 0 );
616
 
617
  endif;
618
 
@@ -626,6 +739,6 @@ class SP_Player_List extends SP_Custom_Post {
626
  endforeach; endif;
627
 
628
  // Default sort by number
629
- return sp_array_value( $a, 'number', 0 ) - sp_array_value( $b, 'number', 0 );
630
  }
631
  }
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
+ * @version 2.2.9
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
24
  public function __construct( $post ) {
25
  parent::__construct( $post );
26
  $this->columns = get_post_meta( $this->ID, 'sp_columns', true );
27
+ if ( is_array( $this->columns ) ) $this->columns = array_filter( $this->columns );
28
+ else $this->columns = array();
29
  }
30
 
31
  /**
197
  if ( is_array( $player_league_season_stats ) ):
198
  foreach ( $player_league_season_stats as $key => $value ):
199
  $current_value = sp_array_value( sp_array_value( $placeholders, $player_id, array() ), $key, 0 );
200
+ $value = floatval( $value );
201
  $placeholders[ $player_id ][ $key ] = $current_value + $value;
202
  endforeach;
203
  endif;
252
  foreach ( $events as $i => $event ):
253
  $results = (array)get_post_meta( $event->ID, 'sp_results', true );
254
  $team_performance = get_post_meta( $event->ID, 'sp_players', true );
255
+ $timeline = (array)get_post_meta( $event->ID, 'sp_timeline', true );
256
  $minutes = get_post_meta( $event->ID, 'sp_minutes', true );
257
  if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
258
 
305
  endif;
306
  endforeach;
307
  elseif ( array_key_exists( $key, $totals[ $player_id ] ) ):
308
+ $value = floatval( $value );
309
  $totals[ $player_id ][ $key ] += $value;
310
  endif;
311
  endforeach;
324
  $totals[ $player_id ]['eventsplayed'] ++;
325
  $totals[ $player_id ]['eventminutes'] += $minutes;
326
 
327
+ // Adjust for substitution time
328
+ if ( sp_array_value( $player_performance, 'status' ) === 'sub' ):
329
+ $totals[ $player_id ]['eventminutes'] -= sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), 'sub' ), 0, 0 );
330
+ else:
331
+ foreach ( $timeline as $timeline_team => $timeline_players ):
332
+ if ( ! is_array( $timeline_players ) ) continue;
333
+ foreach ( $timeline_players as $timeline_player => $timeline_performance ):
334
+ if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $player_id === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
335
+ $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
336
+ if ( $substitution_time ):
337
+ $totals[ $player_id ]['eventminutes'] += $substitution_time - $minutes;
338
+ endif;
339
+ endif;
340
+ endforeach;
341
+ endforeach;
342
+ endif;
343
+
344
  if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
345
  $totals[ $player_id ]['eventsstarted'] ++;
346
  elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
387
 
388
  // Add to total
389
  $value = sp_array_value( $totals[ $player_id ], $result_slug . 'for', 0 );
390
+ $value += floatval( $team_result );
391
  $totals[ $player_id ][ $result_slug . 'for' ] = $value;
392
 
393
  // Add subset
404
 
405
  // Add to total
406
  $value = sp_array_value( $totals[ $player_id ], $result_slug . 'against', 0 );
407
+ $value += floatval( $team_result );
408
  $totals[ $player_id ][ $result_slug . 'against' ] = $value;
409
 
410
  // Add subset
474
  );
475
  $stats = get_posts( $args );
476
 
477
+ $formats = array();
478
+ $data = array();
479
+ $merged = array();
480
+ $column_order = array();
481
+ $ordered_columns = array();
482
+
483
+ if ( $stats ):
484
 
485
+ foreach ( $stats as $stat ):
 
486
 
487
+ // Get post meta
488
+ $meta = get_post_meta( $stat->ID );
489
+
490
+ // Add equation to object
491
+ if ( $stat->post_type == 'sp_metric' ):
492
+ $stat->equation = null;
493
+ else:
494
+ $stat->equation = sp_array_value( sp_array_value( $meta, 'sp_equation', array() ), 0, 0 );
495
+ endif;
496
+
497
+ // Add precision to object
498
+ $stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ) + 0;
499
+
500
+ // Add column name to columns
501
+ $columns[ $stat->post_name ] = $stat->post_title;
502
+
503
+ // Add format
504
+ $format = get_post_meta( $stat->ID, 'sp_format', true );
505
+ if ( '' === $format ) {
506
+ $format = 'number';
507
+ }
508
+ $formats[ $stat->post_name ] = $format;
509
 
510
+ $column_order[] = $stat->post_name;
 
511
 
512
+ endforeach;
513
+
514
+ endif;
515
+
516
+ foreach ( $column_order as $slug ):
517
+
518
+ if ( ! in_array( $slug, $this->columns ) ) continue;
519
+
520
+ $ordered_columns[] = $slug;
521
 
522
  endforeach;
523
 
524
+ $diff = array_diff( $this->columns, $ordered_columns );
525
+ $this->columns = array_merge( $diff, $ordered_columns );
526
+
527
  // Fill in empty placeholder values for each player
528
  foreach ( $player_ids as $player_id ):
529
  if ( ! $player_id )
531
 
532
  $placeholders[ $player_id ] = array_merge( sp_array_value( $totals, $player_id, array() ), array_filter( sp_array_value( $placeholders, $player_id, array() ) ) );
533
 
534
+ // Player adjustments
535
+ $player_adjustments = sp_array_value( $adjustments, $player_id, array() );
536
 
537
+ foreach ( $stats as $stat ):
538
+ if ( $stat->equation === null ):
539
+ $placeholder = sp_array_value( $player_adjustments, $stat->post_name, null );
540
+ if ( $placeholder == null ):
541
+ $placeholder = '-';
542
+ endif;
543
+ else:
544
+ // Solve
545
+ $placeholder = sp_solve( $stat->equation, $placeholders[ $player_id ], $stat->precision );
546
 
547
+ // Adjustment
548
+ $adjustment = sp_array_value( $player_adjustments, $stat->post_name, 0 );
549
 
550
+ // Apply adjustment
551
+ if ( $adjustment != 0 ):
552
+ $placeholder += $adjustment;
553
+ $placeholder = number_format( $placeholder, $stat->precision, '.', '' );
554
  endif;
555
+ endif;
556
+
557
+ if ( $placeholder !== '' && is_numeric( $placeholder ) ):
558
+ $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder;
559
+ else:
560
+ $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' );
561
+ endif;
562
 
563
+ if ( is_numeric( $placeholder ) && $stat->precision ):
564
+ $placeholder = number_format( $placeholder, $stat->precision, '.', '' );
565
  endif;
566
+
567
+ $placeholders[ $player_id ][ $stat->post_name ] = $placeholder;
568
  endforeach;
569
 
570
  endforeach;
571
 
572
  // Merge the data and placeholders arrays
 
 
573
  foreach( $placeholders as $player_id => $player_data ):
574
 
575
+ $player_data = array_merge( $column_order, $player_data );
576
+ $placeholders[ $player_id ] = $player_data;
577
+
578
  // Add player number and name to row
579
  $merged[ $player_id ] = array();
580
  if ( in_array( 'number', $this->columns ) ):
614
  endif;
615
 
616
  // Rearrange data array to reflect values
 
617
  foreach( $merged as $key => $value ):
618
  $data[ $key ] = $tempdata[ $key ];
619
  endforeach;
620
 
621
  if ( $admin ):
622
+
623
+ // Convert to time notation
624
+ if ( in_array( 'time', $formats ) ):
625
+ foreach ( $placeholders as $player => $stats ):
626
+ if ( ! is_array( $stats ) ) continue;
627
+
628
+ foreach ( $stats as $key => $value ):
629
+
630
+ // Continue if not time format
631
+ if ( 'time' !== sp_array_value( $formats, $key ) ) continue;
632
+
633
+ $intval = intval( $value );
634
+ $timeval = gmdate( 'i:s', $intval );
635
+ $hours = floor( $intval / 3600 );
636
+
637
+ if ( '00' != $hours )
638
+ $timeval = $hours . ':' . $timeval;
639
+
640
+ $timeval = preg_replace( '/^0/', '', $timeval );
641
+
642
+ $placeholders[ $player ][ $key ] = $timeval;
643
+ endforeach;
644
+ endforeach;
645
+ endif;
646
+
647
  $labels = array();
648
  foreach( $this->columns as $key ):
649
  if ( $key == 'number' ):
656
  $labels[ $key ] = $columns[ $key ];
657
  endif;
658
  endforeach;
659
+
660
  return array( $labels, $data, $placeholders, $merged, $orderby );
661
  else:
662
+
663
+ // Convert to time notation
664
+ if ( in_array( 'time', $formats ) ):
665
+ foreach ( $merged as $player => $stats ):
666
+ if ( ! is_array( $stats ) ) continue;
667
+
668
+ foreach ( $stats as $key => $value ):
669
+
670
+ // Continue if not time format
671
+ if ( 'time' !== sp_array_value( $formats, $key ) ) continue;
672
+
673
+ $intval = intval( $value );
674
+ $timeval = gmdate( 'i:s', $intval );
675
+ $hours = floor( $intval / 3600 );
676
+
677
+ if ( '00' != $hours )
678
+ $timeval = $hours . ':' . $timeval;
679
+
680
+ $timeval = preg_replace( '/^0/', '', $timeval );
681
+
682
+ $merged[ $player ][ $key ] = $timeval;
683
+ endforeach;
684
+ endforeach;
685
+ endif;
686
+
687
  if ( ! is_array( $this->columns ) )
688
  $this->columns = array();
689
  foreach ( $columns as $key => $label ):
725
  else:
726
 
727
  // Compare performance values
728
+ $output = floatval( sp_array_value( $a, $priority['key'], 0 ) ) - floatval( sp_array_value( $b, $priority['key'], 0 ) );
729
 
730
  endif;
731
 
739
  endforeach; endif;
740
 
741
  // Default sort by number
742
+ return floatval( sp_array_value( $a, 'number', 0 ) ) - floatval( sp_array_value( $b, 'number', 0 ) );
743
  }
744
  }
includes/class-sp-player.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
- * @version 2.1.6
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -143,7 +143,7 @@ class SP_Player extends SP_Custom_Post {
143
  $posts = get_posts( $args );
144
 
145
  if ( $manual_columns ) {
146
- $usecolumns = get_post_meta( $this->ID, 'sp_columns', true );
147
  $has_checkboxes = true;
148
  } else {
149
  $usecolumns = array();
@@ -160,6 +160,7 @@ class SP_Player extends SP_Custom_Post {
160
  }
161
 
162
  $performance_labels = array();
 
163
 
164
  foreach ( $posts as $post ):
165
  if ( -1 === $section ) {
@@ -175,6 +176,12 @@ class SP_Player extends SP_Custom_Post {
175
  $performance_labels[ $post->post_name ] = $post->post_title;
176
  }
177
  }
 
 
 
 
 
 
178
  endforeach;
179
 
180
  // Get statistic labels
@@ -189,7 +196,8 @@ class SP_Player extends SP_Custom_Post {
189
  $posts = get_posts( $args );
190
 
191
  if ( $manual_columns ) {
192
- $usecolumns += get_post_meta( $this->ID, 'sp_columns', true );
 
193
  } else {
194
  if ( is_array( $posts ) ) {
195
  foreach ( $posts as $post ) {
@@ -261,7 +269,7 @@ class SP_Player extends SP_Custom_Post {
261
  $last10[ $key ] = 0;
262
  endforeach;
263
 
264
- // Get all events involving the team in current season
265
  $args = array(
266
  'post_type' => 'sp_event',
267
  'numberposts' => -1,
@@ -283,6 +291,13 @@ class SP_Player extends SP_Custom_Post {
283
  'relation' => 'AND',
284
  ),
285
  );
 
 
 
 
 
 
 
286
 
287
  if ( $league_id ):
288
  $args['tax_query'][] = array(
@@ -308,6 +323,7 @@ class SP_Player extends SP_Custom_Post {
308
  foreach( $events as $i => $event ):
309
  $results = (array)get_post_meta( $event->ID, 'sp_results', true );
310
  $team_performance = (array)get_post_meta( $event->ID, 'sp_players', true );
 
311
  $minutes = get_post_meta( $event->ID, 'sp_minutes', true );
312
  if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
313
 
@@ -318,46 +334,8 @@ class SP_Player extends SP_Custom_Post {
318
  $player_performance = sp_array_value( $players, $this->ID, array() );
319
 
320
  foreach ( $player_performance as $key => $value ):
321
- if ( 'outcome' == $key ):
322
- // Increment events attended, played, and started
323
- $totals['eventsattended'] ++;
324
- $totals['eventsplayed'] ++;
325
- $totals['eventsstarted'] ++;
326
- $totals['eventminutes'] += $minutes;
327
-
328
- // Convert to array
329
- if ( ! is_array( $value ) ):
330
- $value = array( $value );
331
- endif;
332
-
333
- foreach ( $value as $outcome ):
334
- if ( $outcome && $outcome != '-1' ):
335
-
336
- // Increment outcome count
337
- if ( array_key_exists( $outcome, $totals ) ):
338
- $totals[ $outcome ] ++;
339
- endif;
340
-
341
- // Add to streak counter
342
- if ( $streak['fire'] && ( $streak['name'] == '' || $streak['name'] == $outcome ) ):
343
- $streak['name'] = $outcome;
344
- $streak['count'] ++;
345
- else:
346
- $streak['fire'] = 0;
347
- endif;
348
-
349
- // Add to last 5 counter if sum is less than 5
350
- if ( array_key_exists( $outcome, $last5 ) && array_sum( $last5 ) < 5 ):
351
- $last5[ $outcome ] ++;
352
- endif;
353
-
354
- // Add to last 10 counter if sum is less than 10
355
- if ( array_key_exists( $outcome, $last10 ) && array_sum( $last10 ) < 10 ):
356
- $last10[ $outcome ] ++;
357
- endif;
358
- endif;
359
- endforeach;
360
- elseif ( array_key_exists( $key, $totals ) ):
361
  $totals[ $key ] += $value;
362
  endif;
363
  endforeach;
@@ -377,6 +355,23 @@ class SP_Player extends SP_Custom_Post {
377
  $totals['eventsplayed'] ++;
378
  $totals['eventminutes'] += $minutes;
379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
381
  $totals['eventsstarted'] ++;
382
  elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
@@ -422,7 +417,7 @@ class SP_Player extends SP_Custom_Post {
422
 
423
  // Add to total
424
  $value = sp_array_value( $totals, $result_slug . 'for', 0 );
425
- $value += $team_result;
426
  $totals[ $result_slug . 'for' ] = $value;
427
 
428
  // Add subset
@@ -438,7 +433,7 @@ class SP_Player extends SP_Custom_Post {
438
 
439
  // Add to total
440
  $value = sp_array_value( $totals, $result_slug . 'against', 0 );
441
- $value += $team_result;
442
  $totals[ $result_slug . 'against' ] = $value;
443
 
444
  // Add subset
@@ -569,6 +564,63 @@ class SP_Player extends SP_Custom_Post {
569
 
570
  $columns = array_merge( $performance_labels, $stats );
571
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
  if ( $admin ):
573
  $labels = array();
574
  if ( is_array( $usecolumns ) ): foreach ( $usecolumns as $key ):
@@ -578,7 +630,7 @@ class SP_Player extends SP_Custom_Post {
578
  $labels[ $key ] = $columns[ $key ];
579
  endif;
580
  endforeach; endif;
581
- return array( $labels, $data, $placeholders, $merged, $leagues, $has_checkboxes );
582
  else:
583
  if ( is_array( $usecolumns ) ):
584
  foreach ( $columns as $key => $label ):
@@ -608,6 +660,7 @@ class SP_Player extends SP_Custom_Post {
608
  $totals = array();
609
  foreach ( $merged as $season => $stats ) {
610
  foreach ( $stats as $key => $value ) {
 
611
  $totals[ $key ] = sp_array_value( $totals, $key, 0 ) + $value;
612
  }
613
  }
@@ -624,6 +677,30 @@ class SP_Player extends SP_Custom_Post {
624
  $merged[-1] = $total;
625
  $merged[-1]['name'] = __( 'Total', 'sportspress' );
626
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
627
 
628
  $merged[0] = array_merge( $labels, $columns );
629
 
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
+ * @version 2.2.4
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
143
  $posts = get_posts( $args );
144
 
145
  if ( $manual_columns ) {
146
+ $usecolumns = (array)get_post_meta( $this->ID, 'sp_columns', true );
147
  $has_checkboxes = true;
148
  } else {
149
  $usecolumns = array();
160
  }
161
 
162
  $performance_labels = array();
163
+ $formats = array();
164
 
165
  foreach ( $posts as $post ):
166
  if ( -1 === $section ) {
176
  $performance_labels[ $post->post_name ] = $post->post_title;
177
  }
178
  }
179
+
180
+ $format = get_post_meta( $post->ID, 'sp_format', true );
181
+ if ( '' === $format ) {
182
+ $format = 'number';
183
+ }
184
+ $formats[ $post->post_name ] = $format;
185
  endforeach;
186
 
187
  // Get statistic labels
196
  $posts = get_posts( $args );
197
 
198
  if ( $manual_columns ) {
199
+ $usecolumns = array_merge( $usecolumns, (array) get_post_meta( $this->ID, 'sp_columns', true ) );
200
+ $usecolumns = array_filter( $usecolumns );
201
  } else {
202
  if ( is_array( $posts ) ) {
203
  foreach ( $posts as $post ) {
269
  $last10[ $key ] = 0;
270
  endforeach;
271
 
272
+ // Get all events involving the player in current season
273
  $args = array(
274
  'post_type' => 'sp_event',
275
  'numberposts' => -1,
291
  'relation' => 'AND',
292
  ),
293
  );
294
+
295
+ if ( -1 !== $section ):
296
+ $args['meta_query'][] = array(
297
+ 'key' => ( 1 === $section ? 'sp_defense' : 'sp_offense' ),
298
+ 'value' => $this->ID
299
+ );
300
+ endif;
301
 
302
  if ( $league_id ):
303
  $args['tax_query'][] = array(
323
  foreach( $events as $i => $event ):
324
  $results = (array)get_post_meta( $event->ID, 'sp_results', true );
325
  $team_performance = (array)get_post_meta( $event->ID, 'sp_players', true );
326
+ $timeline = (array)get_post_meta( $event->ID, 'sp_timeline', true );
327
  $minutes = get_post_meta( $event->ID, 'sp_minutes', true );
328
  if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
329
 
334
  $player_performance = sp_array_value( $players, $this->ID, array() );
335
 
336
  foreach ( $player_performance as $key => $value ):
337
+ if ( array_key_exists( $key, $totals ) ):
338
+ $value = floatval( $value );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  $totals[ $key ] += $value;
340
  endif;
341
  endforeach;
355
  $totals['eventsplayed'] ++;
356
  $totals['eventminutes'] += $minutes;
357
 
358
+ // Adjust for substitution time
359
+ if ( sp_array_value( $player_performance, 'status' ) === 'sub' ):
360
+ $totals['eventminutes'] -= sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), 'sub' ), 0, 0 );
361
+ else:
362
+ foreach ( $timeline as $timeline_team => $timeline_players ):
363
+ if ( ! is_array( $timeline_players ) ) continue;
364
+ foreach ( $timeline_players as $timeline_player => $timeline_performance ):
365
+ if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $this->ID === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
366
+ $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
367
+ if ( $substitution_time ):
368
+ $totals['eventminutes'] += $substitution_time - $minutes;
369
+ endif;
370
+ endif;
371
+ endforeach;
372
+ endforeach;
373
+ endif;
374
+
375
  if ( sp_array_value( $player_performance, 'status' ) == 'lineup' ):
376
  $totals['eventsstarted'] ++;
377
  elseif ( sp_array_value( $player_performance, 'status' ) == 'sub' && sp_array_value( $player_performance, 'sub', 0 ) ):
417
 
418
  // Add to total
419
  $value = sp_array_value( $totals, $result_slug . 'for', 0 );
420
+ $value += floatval( $team_result );
421
  $totals[ $result_slug . 'for' ] = $value;
422
 
423
  // Add subset
433
 
434
  // Add to total
435
  $value = sp_array_value( $totals, $result_slug . 'against', 0 );
436
+ $value += floatval( $team_result );
437
  $totals[ $result_slug . 'against' ] = $value;
438
 
439
  // Add subset
564
 
565
  $columns = array_merge( $performance_labels, $stats );
566
 
567
+ $formats = array();
568
+
569
+ $args = array(
570
+ 'post_type' => array( 'sp_performance', 'sp_statistic' ),
571
+ 'numberposts' => 100,
572
+ 'posts_per_page' => 100,
573
+ 'orderby' => 'menu_order',
574
+ 'order' => 'ASC',
575
+ );
576
+
577
+ $posts = get_posts( $args );
578
+
579
+ if ( $posts ) {
580
+ $column_order = array();
581
+ $usecolumn_order = array();
582
+ foreach ( $posts as $post ) {
583
+ if ( array_key_exists( $post->post_name, $columns ) ) {
584
+ $column_order[ $post->post_name ] = $columns[ $post->post_name ];
585
+ }
586
+ if ( in_array( $post->post_name, $usecolumns ) ) {
587
+ $usecolumn_order[] = $post->post_name;
588
+ }
589
+
590
+ $format = get_post_meta( $post->ID, 'sp_format', true );
591
+ if ( '' === $format ) {
592
+ $format = 'number';
593
+ }
594
+ $formats[ $post->post_name ] = $format;
595
+ }
596
+ $columns = array_merge( $column_order, $columns );
597
+ $usecolumns = array_merge( $usecolumn_order, $usecolumns );
598
+ }
599
+
600
+ // Convert to time notation
601
+ if ( in_array( 'time', $formats ) ):
602
+ foreach ( $placeholders as $season => $stats ):
603
+ if ( ! is_array( $stats ) ) continue;
604
+
605
+ foreach ( $stats as $key => $value ):
606
+
607
+ // Continue if not time format
608
+ if ( 'time' !== sp_array_value( $formats, $key ) ) continue;
609
+
610
+ $intval = intval( $value );
611
+ $timeval = gmdate( 'i:s', $intval );
612
+ $hours = floor( $intval / 3600 );
613
+
614
+ if ( '00' != $hours )
615
+ $timeval = $hours . ':' . $timeval;
616
+
617
+ $timeval = preg_replace( '/^0/', '', $timeval );
618
+
619
+ $placeholders[ $season ][ $key ] = $timeval;
620
+ endforeach;
621
+ endforeach;
622
+ endif;
623
+
624
  if ( $admin ):
625
  $labels = array();
626
  if ( is_array( $usecolumns ) ): foreach ( $usecolumns as $key ):
630
  $labels[ $key ] = $columns[ $key ];
631
  endif;
632
  endforeach; endif;
633
+ return array( $labels, $data, $placeholders, $merged, $leagues, $has_checkboxes, $formats );
634
  else:
635
  if ( is_array( $usecolumns ) ):
636
  foreach ( $columns as $key => $label ):
660
  $totals = array();
661
  foreach ( $merged as $season => $stats ) {
662
  foreach ( $stats as $key => $value ) {
663
+ $value = floatval( $value );
664
  $totals[ $key ] = sp_array_value( $totals, $key, 0 ) + $value;
665
  }
666
  }
677
  $merged[-1] = $total;
678
  $merged[-1]['name'] = __( 'Total', 'sportspress' );
679
  }
680
+
681
+ // Convert to time notation
682
+ if ( in_array( 'time', $formats ) ):
683
+ foreach ( $merged as $season => $season_performance ):
684
+ if ( $season <= 0 ) continue;
685
+
686
+ foreach ( $season_performance as $performance_key => $performance_value ):
687
+
688
+ // Continue if not time format
689
+ if ( 'time' !== sp_array_value( $formats, $performance_key ) ) continue;
690
+
691
+ $intval = intval( $performance_value );
692
+ $timeval = gmdate( 'i:s', $intval );
693
+ $hours = floor( $intval / 3600 );
694
+
695
+ if ( '00' != $hours )
696
+ $timeval = $hours . ':' . $timeval;
697
+
698
+ $timeval = preg_replace( '/^0/', '', $timeval );
699
+
700
+ $merged[ $season ][ $performance_key ] = $timeval;
701
+ endforeach;
702
+ endforeach;
703
+ endif;
704
 
705
  $merged[0] = array_merge( $labels, $columns );
706
 
includes/class-sp-post-types.php CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
9
  * Registers post types and taxonomies
10
  *
11
  * @class SP_Post_types
12
- * @version 2.1
13
  * @package SportsPress/Classes
14
  * @category Class
15
  * @author ThemeBoy
@@ -60,7 +60,7 @@ class SP_Post_types {
60
  'hierarchical' => true,
61
  'rewrite' => array( 'slug' => get_option( 'sportspress_league_slug', 'league' ) ),
62
  'show_in_rest' => true,
63
- 'rest_controller_class' => 'SP_REST_Posts_Controller',
64
  'rest_base' => 'leagues',
65
  ) );
66
  $object_types = apply_filters( 'sportspress_league_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );
@@ -96,7 +96,7 @@ class SP_Post_types {
96
  'hierarchical' => true,
97
  'rewrite' => array( 'slug' => get_option( 'sportspress_season_slug', 'season' ) ),
98
  'show_in_rest' => true,
99
- 'rest_controller_class' => 'SP_REST_Posts_Controller',
100
  'rest_base' => 'seasons',
101
  ) );
102
  $object_types = apply_filters( 'sportspress_season_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );
@@ -132,7 +132,7 @@ class SP_Post_types {
132
  'hierarchical' => true,
133
  'rewrite' => array( 'slug' => get_option( 'sportspress_venue_slug', 'venue' ) ),
134
  'show_in_rest' => true,
135
- 'rest_controller_class' => 'SP_REST_Posts_Controller',
136
  'rest_base' => 'venues',
137
  ) );
138
  $object_types = apply_filters( 'sportspress_event_object_types', array( 'sp_event', 'sp_calendar', 'sp_team' ) );
@@ -168,7 +168,7 @@ class SP_Post_types {
168
  'hierarchical' => true,
169
  'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ),
170
  'show_in_rest' => true,
171
- 'rest_controller_class' => 'SP_REST_Posts_Controller',
172
  'rest_base' => 'positions',
173
  ) );
174
  $object_types = apply_filters( 'sportspress_position_object_types', array( 'sp_player', 'sp_list' ) );
@@ -204,7 +204,7 @@ class SP_Post_types {
204
  'hierarchical' => true,
205
  'rewrite' => array( 'slug' => get_option( 'sportspress_role_slug', 'role' ) ),
206
  'show_in_rest' => true,
207
- 'rest_controller_class' => 'SP_REST_Posts_Controller',
208
  'rest_base' => 'roles',
209
  ) );
210
  $object_types = apply_filters( 'sportspress_role_object_types', array( 'sp_staff' ) );
9
  * Registers post types and taxonomies
10
  *
11
  * @class SP_Post_types
12
+ * @version 2.2
13
  * @package SportsPress/Classes
14
  * @category Class
15
  * @author ThemeBoy
60
  'hierarchical' => true,
61
  'rewrite' => array( 'slug' => get_option( 'sportspress_league_slug', 'league' ) ),
62
  'show_in_rest' => true,
63
+ 'rest_controller_class' => 'SP_REST_Terms_Controller',
64
  'rest_base' => 'leagues',
65
  ) );
66
  $object_types = apply_filters( 'sportspress_league_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );
96
  'hierarchical' => true,
97
  'rewrite' => array( 'slug' => get_option( 'sportspress_season_slug', 'season' ) ),
98
  'show_in_rest' => true,
99
+ 'rest_controller_class' => 'SP_REST_Terms_Controller',
100
  'rest_base' => 'seasons',
101
  ) );
102
  $object_types = apply_filters( 'sportspress_season_object_types', array( 'sp_event', 'sp_calendar', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) );
132
  'hierarchical' => true,
133
  'rewrite' => array( 'slug' => get_option( 'sportspress_venue_slug', 'venue' ) ),
134
  'show_in_rest' => true,
135
+ 'rest_controller_class' => 'SP_REST_Terms_Controller',
136
  'rest_base' => 'venues',
137
  ) );
138
  $object_types = apply_filters( 'sportspress_event_object_types', array( 'sp_event', 'sp_calendar', 'sp_team' ) );
168
  'hierarchical' => true,
169
  'rewrite' => array( 'slug' => get_option( 'sportspress_position_slug', 'position' ) ),
170
  'show_in_rest' => true,
171
+ 'rest_controller_class' => 'SP_REST_Terms_Controller',
172
  'rest_base' => 'positions',
173
  ) );
174
  $object_types = apply_filters( 'sportspress_position_object_types', array( 'sp_player', 'sp_list' ) );
204
  'hierarchical' => true,
205
  'rewrite' => array( 'slug' => get_option( 'sportspress_role_slug', 'role' ) ),
206
  'show_in_rest' => true,
207
+ 'rest_controller_class' => 'SP_REST_Terms_Controller',
208
  'rest_base' => 'roles',
209
  ) );
210
  $object_types = apply_filters( 'sportspress_role_object_types', array( 'sp_staff' ) );
includes/class-sp-team.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress team class handles individual team data.
6
  *
7
  * @class SP_Team
8
- * @version 2.1.3
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -259,6 +259,9 @@ class SP_Team extends SP_Custom_Post {
259
  endforeach;
260
 
261
  else:
 
 
 
262
  if ( array_key_exists( $key . 'for', $totals ) ):
263
  $totals[ $key . 'for' ] += $value;
264
  $totals[ $key . 'for' . ( $e + 1 ) ] = $value;
@@ -278,6 +281,9 @@ class SP_Team extends SP_Custom_Post {
278
  endif;
279
  else:
280
  if ( $key != 'outcome' ):
 
 
 
281
  if ( array_key_exists( $key . 'against', $totals ) ):
282
  $totals[ $key . 'against' ] += $value;
283
  $totals[ $key . 'against' . ( $e + 1 ) ] = $value;
5
  * The SportsPress team class handles individual team data.
6
  *
7
  * @class SP_Team
8
+ * @version 2.2.4
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
259
  endforeach;
260
 
261
  else:
262
+
263
+ $value = floatval( $value );
264
+
265
  if ( array_key_exists( $key . 'for', $totals ) ):
266
  $totals[ $key . 'for' ] += $value;
267
  $totals[ $key . 'for' . ( $e + 1 ) ] = $value;
281
  endif;
282
  else:
283
  if ( $key != 'outcome' ):
284
+
285
+ $value = floatval( $value );
286
+
287
  if ( array_key_exists( $key . 'against', $totals ) ):
288
  $totals[ $key . 'against' ] += $value;
289
  $totals[ $key . 'against' . ( $e + 1 ) ] = $value;
includes/class-sp-templates.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress templates class stores template layout data.
6
  *
7
  * @class SP_Templates
8
- * @version 2.1.4
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -26,7 +26,7 @@ class SP_Templates {
26
  'event' => array_merge(
27
  apply_filters( 'sportspress_before_event_template', array(
28
  'logos' => array(
29
- 'title' => __( 'Logos', 'sportspress' ),
30
  'option' => 'sportspress_event_show_logos',
31
  'action' => 'sportspress_output_event_logos',
32
  'default' => 'yes',
5
  * The SportsPress templates class stores template layout data.
6
  *
7
  * @class SP_Templates
8
+ * @version 2.2
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
26
  'event' => array_merge(
27
  apply_filters( 'sportspress_before_event_template', array(
28
  'logos' => array(
29
+ 'title' => __( 'Teams', 'sportspress' ),
30
  'option' => 'sportspress_event_show_logos',
31
  'action' => 'sportspress_output_event_logos',
32
  'default' => 'yes',
includes/libraries/class-eqeos.php CHANGED
@@ -35,7 +35,7 @@
35
  * - Add factorial support. (ie 5! = 120)
36
  *
37
  * @author Jon Lawrence <jlawrence11@gmail.com>
38
- * @copyright Copyright 2005-2013, Jon Lawrence
39
  * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License
40
  * @package EOS
41
  * @version 2.0
@@ -73,7 +73,7 @@ if(!defined('DEBUG'))
73
  * This class was created for PHP4 in 2005, updated to fully PHP5 in 2013.
74
  *
75
  * @author Jon Lawrence <jlawrence11@gmail.com>
76
- * @copyright Copyright 2005-2013, Jon Lawrence
77
  * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License
78
  * @package Math
79
  * @subpackage EOS
@@ -128,8 +128,7 @@ class eqEOS {
128
  */
129
  private function checkInfix($infix) {
130
  if(trim($infix) == "") {
131
- throw new Exception("No Equation given", EQEOS_E_NO_EQ);
132
- return false;
133
  }
134
  //Make sure we have the same number of '(' as we do ')'
135
  // and the same # of '[' as we do ']'
@@ -301,8 +300,7 @@ class eqEOS {
301
  break;
302
  case '/':
303
  if($temp[$hold-1] == 0) {
304
- throw new Exception("Division by 0 on: '{$temp[$hold-2]} / {$temp[$hold-1]}' in {$this->inFix}", EQEOS_E_DIV_ZERO);
305
- return false;
306
  }
307
  $temp[$hold-2] = $temp[$hold-2] / $temp[$hold-1];
308
  break;
@@ -311,8 +309,7 @@ class eqEOS {
311
  break;
312
  case '%':
313
  if($temp[$hold-1] == 0) {
314
- throw new Exception("Division by 0 on: '{$temp[$hold-2]} % {$temp[$hold-1]}' in {$this->inFix}", EQEOS_E_DIV_ZERO);
315
- return false;
316
  }
317
  $temp[$hold-2] = bcmod($temp[$hold-2], $temp[$hold-1]);
318
  break;
@@ -398,24 +395,21 @@ class eqEOS {
398
  case "sec":
399
  $tmp = cos($func);
400
  if($tmp == 0) {
401
- throw new Exception("Division by 0 on: 'sec({$func}) = 1/cos({$func})' in {$this->inFix}", EQEOS_E_DIV_ZERO);
402
- return false;
403
  }
404
  $ans = 1/$tmp;
405
  break;
406
  case "csc":
407
  $tmp = sin($func);
408
  if($tmp == 0) {
409
- throw new Exception("Division by 0 on: 'csc({$func}) = 1/sin({$func})' in {$this->inFix}", EQEOS_E_DIV_ZERO);
410
- return false;
411
  }
412
  $ans = 1/$tmp;
413
  break;
414
  case "cot":
415
  $tmp = tan($func);
416
  if($tmp == 0) {
417
- throw new Exception("Division by 0 on: 'cot({$func}) = 1/tan({$func})' in {$this->inFix}", EQEOS_E_DIV_ZERO);
418
- return false;
419
  }
420
  $ans = 1/$tmp;
421
  break;
35
  * - Add factorial support. (ie 5! = 120)
36
  *
37
  * @author Jon Lawrence <jlawrence11@gmail.com>
38
+ * @copyright Copyright ©2005-2013, Jon Lawrence
39
  * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License
40
  * @package EOS
41
  * @version 2.0
73
  * This class was created for PHP4 in 2005, updated to fully PHP5 in 2013.
74
  *
75
  * @author Jon Lawrence <jlawrence11@gmail.com>
76
+ * @copyright Copyright ©2005-2013, Jon Lawrence
77
  * @license http://opensource.org/licenses/LGPL-2.1 LGPL 2.1 License
78
  * @package Math
79
  * @subpackage EOS
128
  */
129
  private function checkInfix($infix) {
130
  if(trim($infix) == "") {
131
+ return 0;
 
132
  }
133
  //Make sure we have the same number of '(' as we do ')'
134
  // and the same # of '[' as we do ']'
300
  break;
301
  case '/':
302
  if($temp[$hold-1] == 0) {
303
+ return 0;
 
304
  }
305
  $temp[$hold-2] = $temp[$hold-2] / $temp[$hold-1];
306
  break;
309
  break;
310
  case '%':
311
  if($temp[$hold-1] == 0) {
312
+ return 0;
 
313
  }
314
  $temp[$hold-2] = bcmod($temp[$hold-2], $temp[$hold-1]);
315
  break;
395
  case "sec":
396
  $tmp = cos($func);
397
  if($tmp == 0) {
398
+ return 0;
 
399
  }
400
  $ans = 1/$tmp;
401
  break;
402
  case "csc":
403
  $tmp = sin($func);
404
  if($tmp == 0) {
405
+ return 0;
 
406
  }
407
  $ans = 1/$tmp;
408
  break;
409
  case "cot":
410
  $tmp = tan($func);
411
  if($tmp == 0) {
412
+ return 0;
 
413
  }
414
  $ans = 1/$tmp;
415
  break;
includes/sp-api-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.0
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -16,6 +16,10 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16
  * General functions
17
  */
18
 
 
 
 
 
19
  function sp_get_time( $post = 0, $format = null ) {
20
  if ( null == $format ) $format = get_option( 'time_format' );
21
  return get_post_time( $format, false, $post, true );
@@ -163,6 +167,15 @@ function sp_get_performance( $post = 0 ) {
163
  return $event->performance();
164
  }
165
 
 
 
 
 
 
 
 
 
 
166
  function sp_event_logos( $post = 0 ) {
167
  sp_get_template( 'event-logos.php', array( 'id' => $post ) );
168
  }
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.2.4
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16
  * General functions
17
  */
18
 
19
+ function sp_post_exists( $post = 0 ) {
20
+ return is_string( get_post_status( $post ) );
21
+ }
22
+
23
  function sp_get_time( $post = 0, $format = null ) {
24
  if ( null == $format ) $format = get_option( 'time_format' );
25
  return get_post_time( $format, false, $post, true );
167
  return $event->performance();
168
  }
169
 
170
+ function sp_get_singular_name( $post = 0 ) {
171
+ $singular = get_post_meta( $post, 'sp_singular', true );
172
+ if ( '' !== $singular ) {
173
+ return $singular;
174
+ } else {
175
+ return get_the_title( $post );
176
+ }
177
+ }
178
+
179
  function sp_event_logos( $post = 0 ) {
180
  sp_get_template( 'event-logos.php', array( 'id' => $post ) );
181
  }
includes/sp-core-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.1.6
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -465,7 +465,7 @@ if ( !function_exists( 'sp_get_post_format' ) ) {
465
  function sp_get_post_format( $post_id ) {
466
  $format = get_post_meta ( $post_id, 'sp_format', true );
467
  if ( isset( $format ) ):
468
- $options = apply_filters( 'sportspress_performance_formats', array( 'number' => __( 'Number', 'sportspress' ), 'text' => __( 'Text', 'sportspress' ), 'equation' => __( 'Equation', 'sportspress' ) ) );
469
  return sp_array_value( $options, $format, __( 'Number', 'sportspress' ) );
470
  else:
471
  return __( 'Number', 'sportspress' );
@@ -1095,9 +1095,8 @@ if ( !function_exists( 'sp_update_post_meta' ) ) {
1095
  }
1096
  }
1097
 
1098
- if ( !function_exists( 'sp_update_post_meta_recursive' ) ) {
1099
- function sp_update_post_meta_recursive( $post_id, $meta_key, $meta_value ) {
1100
- delete_post_meta( $post_id, $meta_key );
1101
  $values = new RecursiveIteratorIterator( new RecursiveArrayIterator( $meta_value ) );
1102
  foreach ( $values as $value ):
1103
  add_post_meta( $post_id, $meta_key, $value, false );
@@ -1105,6 +1104,13 @@ if ( !function_exists( 'sp_update_post_meta_recursive' ) ) {
1105
  }
1106
  }
1107
 
 
 
 
 
 
 
 
1108
  if ( !function_exists( 'sp_update_user_meta_recursive' ) ) {
1109
  function sp_update_user_meta_recursive( $user_id, $meta_key, $meta_value ) {
1110
  delete_user_meta( $user_id, $meta_key );
@@ -1140,7 +1146,7 @@ if ( !function_exists( 'sp_get_eos_safe_slug' ) ) {
1140
  }
1141
 
1142
  if ( !function_exists( 'sp_solve' ) ) {
1143
- function sp_solve( $equation, $vars, $precision = 0, $default = '-' ) {
1144
 
1145
  if ( $equation == null )
1146
  return $default;
@@ -1155,6 +1161,11 @@ if ( !function_exists( 'sp_solve' ) ) {
1155
  // Return direct value
1156
  return sp_array_value( $vars, 'streak', $default );
1157
 
 
 
 
 
 
1158
  elseif ( strpos( $equation, '$last5' ) !== false ):
1159
 
1160
  // Return imploded string
@@ -1195,9 +1206,6 @@ if ( !function_exists( 'sp_solve' ) ) {
1195
  unset( $vars['last5'] );
1196
  unset( $vars['last10'] );
1197
 
1198
- if ( sp_array_value( $vars, 'eventsplayed', 0 ) <= 0 )
1199
- return $default;
1200
-
1201
  // Equation Operating System
1202
  if ( ! class_exists( 'phpStack' ) )
1203
  include_once( SP()->plugin_path() . '/includes/libraries/class-phpstack.php' );
@@ -1304,7 +1312,7 @@ if ( !function_exists( 'sp_get_next_event' ) ) {
1304
  }
1305
 
1306
  if ( !function_exists( 'sp_taxonomy_field' ) ) {
1307
- function sp_taxonomy_field( $taxonomy = 'category', $post = null, $multiple = false, $trigger = false ) {
1308
  $obj = get_taxonomy( $taxonomy );
1309
  if ( $obj ) {
1310
  $post_type = get_post_type( $post );
@@ -1327,7 +1335,7 @@ if ( !function_exists( 'sp_taxonomy_field' ) ) {
1327
  'values' => 'term_id',
1328
  'class' => 'sp-has-dummy widefat' . ( $trigger ? ' sp-ajax-trigger' : '' ),
1329
  'chosen' => true,
1330
- 'placeholder' => __( 'All', 'sportspress' ),
1331
  );
1332
  if ( $multiple ) {
1333
  $args['property'] = 'multiple';
@@ -1363,9 +1371,9 @@ function sp_get_text_options() {
1363
  __( 'Events', 'sportspress' ),
1364
  __( 'Excerpt', 'sportspress' ),
1365
  __( 'Fixtures', 'sportspress' ),
 
1366
  __( 'Home', 'sportspress' ),
1367
  __( 'League Table', 'sportspress' ),
1368
- __( 'Logos', 'sportspress' ),
1369
  __( 'Match Day', 'sportspress' ),
1370
  __( 'Nationality', 'sportspress' ),
1371
  __( 'Offense', 'sportspress' ),
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.2.4
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
465
  function sp_get_post_format( $post_id ) {
466
  $format = get_post_meta ( $post_id, 'sp_format', true );
467
  if ( isset( $format ) ):
468
+ $options = apply_filters( 'sportspress_performance_formats', array( 'number' => __( 'Number', 'sportspress' ), 'time' => __( 'Time', 'sportspress' ), 'text' => __( 'Text', 'sportspress' ), 'equation' => __( 'Equation', 'sportspress' ) ) );
469
  return sp_array_value( $options, $format, __( 'Number', 'sportspress' ) );
470
  else:
471
  return __( 'Number', 'sportspress' );
1095
  }
1096
  }
1097
 
1098
+ if ( !function_exists( 'sp_add_post_meta_recursive' ) ) {
1099
+ function sp_add_post_meta_recursive( $post_id, $meta_key, $meta_value ) {
 
1100
  $values = new RecursiveIteratorIterator( new RecursiveArrayIterator( $meta_value ) );
1101
  foreach ( $values as $value ):
1102
  add_post_meta( $post_id, $meta_key, $value, false );
1104
  }
1105
  }
1106
 
1107
+ if ( !function_exists( 'sp_update_post_meta_recursive' ) ) {
1108
+ function sp_update_post_meta_recursive( $post_id, $meta_key, $meta_value ) {
1109
+ delete_post_meta( $post_id, $meta_key );
1110
+ sp_add_post_meta_recursive( $post_id, $meta_key, $meta_value );
1111
+ }
1112
+ }
1113
+
1114
  if ( !function_exists( 'sp_update_user_meta_recursive' ) ) {
1115
  function sp_update_user_meta_recursive( $user_id, $meta_key, $meta_value ) {
1116
  delete_user_meta( $user_id, $meta_key );
1146
  }
1147
 
1148
  if ( !function_exists( 'sp_solve' ) ) {
1149
+ function sp_solve( $equation, $vars, $precision = 0, $default = 0 ) {
1150
 
1151
  if ( $equation == null )
1152
  return $default;
1161
  // Return direct value
1162
  return sp_array_value( $vars, 'streak', $default );
1163
 
1164
+ elseif ( strpos( $equation, '$form' ) !== false ):
1165
+
1166
+ // Return direct value
1167
+ return sp_array_value( $vars, 'form', $default );
1168
+
1169
  elseif ( strpos( $equation, '$last5' ) !== false ):
1170
 
1171
  // Return imploded string
1206
  unset( $vars['last5'] );
1207
  unset( $vars['last10'] );
1208
 
 
 
 
1209
  // Equation Operating System
1210
  if ( ! class_exists( 'phpStack' ) )
1211
  include_once( SP()->plugin_path() . '/includes/libraries/class-phpstack.php' );
1312
  }
1313
 
1314
  if ( !function_exists( 'sp_taxonomy_field' ) ) {
1315
+ function sp_taxonomy_field( $taxonomy = 'category', $post = null, $multiple = false, $trigger = false, $placeholder = null ) {
1316
  $obj = get_taxonomy( $taxonomy );
1317
  if ( $obj ) {
1318
  $post_type = get_post_type( $post );
1335
  'values' => 'term_id',
1336
  'class' => 'sp-has-dummy widefat' . ( $trigger ? ' sp-ajax-trigger' : '' ),
1337
  'chosen' => true,
1338
+ 'placeholder' => $placeholder ? $placeholder : __( 'All', 'sportspress' ),
1339
  );
1340
  if ( $multiple ) {
1341
  $args['property'] = 'multiple';
1371
  __( 'Events', 'sportspress' ),
1372
  __( 'Excerpt', 'sportspress' ),
1373
  __( 'Fixtures', 'sportspress' ),
1374
+ __( 'Full Time', 'sportspress' ),
1375
  __( 'Home', 'sportspress' ),
1376
  __( 'League Table', 'sportspress' ),
 
1377
  __( 'Match Day', 'sportspress' ),
1378
  __( 'Nationality', 'sportspress' ),
1379
  __( 'Offense', 'sportspress' ),
includes/sp-template-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.1.4
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -59,6 +59,7 @@ function sp_body_class( $classes ) {
59
  $classes[] = 'sp-has-results';
60
  }
61
  }
 
62
  } elseif ( 'sp_team' == $post_type && 'yes' == get_option( 'sportspress_team_show_logo', 'yes' ) ) {
63
  $classes[] = 'sp-show-image';
64
  } elseif ( 'sp_player' == $post_type && 'yes' == get_option( 'sportspress_player_show_photo', 'yes' ) ) {
@@ -387,6 +388,19 @@ if ( ! function_exists( 'sportspress_output_player_statistics' ) ) {
387
  sp_get_template( 'player-statistics.php' );
388
  }
389
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
390
 
391
  /** Single Player List ********************************************************/
392
 
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.2
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
59
  $classes[] = 'sp-has-results';
60
  }
61
  }
62
+ $classes[] = 'sp-performance-sections-' . get_option( 'sportspress_event_performance_sections', -1 );
63
  } elseif ( 'sp_team' == $post_type && 'yes' == get_option( 'sportspress_team_show_logo', 'yes' ) ) {
64
  $classes[] = 'sp-show-image';
65
  } elseif ( 'sp_player' == $post_type && 'yes' == get_option( 'sportspress_player_show_photo', 'yes' ) ) {
388
  sp_get_template( 'player-statistics.php' );
389
  }
390
  }
391
+ if ( ! function_exists( 'sportspress_output_player_events' ) ) {
392
+
393
+ /**
394
+ * Output the player events.
395
+ *
396
+ * @access public
397
+ * @subpackage Player/Events
398
+ * @return void
399
+ */
400
+ function sportspress_output_player_events() {
401
+ sp_get_template( 'player-events.php' );
402
+ }
403
+ }
404
 
405
  /** Single Player List ********************************************************/
406
 
includes/sp-template-hooks.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.1.4
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -211,12 +211,20 @@ add_filter( 'gettext', 'sportspress_gettext', 20, 3 );
211
 
212
  function sportspress_team_permalink( $permalink, $post ) {
213
  if ( ! is_admin() && 'sp_team' == get_post_type( $post ) ):
214
- if ( empty( $post->post_content ) ):
215
- $url = get_post_meta( $post->ID, 'sp_url', true );
216
- if ( ! empty( $url ) ):
217
- return $url;
218
- endif;
219
- endif;
 
 
 
 
 
 
 
 
220
  endif;
221
  return $permalink;
222
  }
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.2
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
211
 
212
  function sportspress_team_permalink( $permalink, $post ) {
213
  if ( ! is_admin() && 'sp_team' == get_post_type( $post ) ):
214
+
215
+ $url = get_post_meta( $post->ID, 'sp_url', true );
216
+
217
+ if ( ! empty( $url ) ):
218
+ $redirect = get_post_meta( $post->ID, 'sp_redirect', true );
219
+
220
+ if ( $redirect === '' ):
221
+ $redirect = ( empty( $post->post_content ) ) ? 1 : 0;
222
+ endif;
223
+
224
+ if ( $redirect ):
225
+ return $url;
226
+ endif;
227
+ endif;
228
  endif;
229
  return $permalink;
230
  }
includes/widgets/class-sp-widget-event-list.php CHANGED
@@ -81,6 +81,8 @@ class SP_Widget_Event_List extends WP_Widget {
81
  $order = strip_tags($instance['order']);
82
  $show_all_events_link = $instance['show_all_events_link'];
83
 
 
 
84
  // Action to hook into
85
  do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-list' );
86
  ?>
@@ -155,13 +157,29 @@ class SP_Widget_Event_List extends WP_Widget {
155
 
156
  <p class="sp-prefs">
157
  <?php _e( 'Columns:', 'sportspress' ); ?><br>
158
- <?php
159
- $the_columns = array(
160
- 'event' => __( 'Event', 'sportspress' ),
161
- 'time' => __( 'Time/Results', 'sportspress' ),
162
- 'venue' => __( 'Venue', 'sportspress' ),
163
- 'article' => __( 'Article', 'sportspress' ),
164
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  $field_name = $this->get_field_name('columns') . '[]';
166
  $field_id = $this->get_field_id('columns');
167
  ?>
81
  $order = strip_tags($instance['order']);
82
  $show_all_events_link = $instance['show_all_events_link'];
83
 
84
+ $time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
85
+
86
  // Action to hook into
87
  do_action( 'sportspress_before_widget_template_form', $this, $instance, 'event-list' );
88
  ?>
157
 
158
  <p class="sp-prefs">
159
  <?php _e( 'Columns:', 'sportspress' ); ?><br>
160
+ <?php
161
+ $the_columns = array();
162
+ $the_columns['event'] = __( 'Event', 'sportspress' );
163
+
164
+ if ( 'combined' === $time_format ) {
165
+
166
+ $the_columns['time'] = __( 'Time/Results', 'sportspress' );
167
+
168
+ } else {
169
+
170
+ if ( in_array( $time_format, array( 'time', 'separate' ) ) ) {
171
+ $the_columns['time'] = __( 'Time', 'sportspress' );
172
+ }
173
+
174
+ if ( in_array( $time_format, array( 'results', 'separate' ) ) ) {
175
+ $the_columns['results'] = __( 'Results', 'sportspress' );
176
+ }
177
+ }
178
+
179
+ $the_columns['venue'] = __( 'Venue', 'sportspress' );
180
+ $the_columns['article'] = __( 'Article', 'sportspress' );
181
+ $the_columns['day'] = __( 'Match Day', 'sportspress' );
182
+
183
  $field_name = $this->get_field_name('columns') . '[]';
184
  $field_id = $this->get_field_id('columns');
185
  ?>
license.txt CHANGED
@@ -1,6 +1,6 @@
1
  SportsPress
2
 
3
- Copyright 2016 by the contributors
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
1
  SportsPress
2
 
3
+ Copyright 2017 by the contributors
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
modules/sportspress-admin-bar.php CHANGED
@@ -2,10 +2,10 @@
2
  /*
3
  Plugin Name: SportsPress Admin Bar
4
  Plugin URI: http://themeboy.com/
5
- Description: Add widgets to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 1.9.14
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Admin_Bar' ) ) :
17
  * Main SportsPress Admin Bar Class
18
  *
19
  * @class SportsPress_Admin_Bar
20
- * @version 1.9.14
21
  */
22
  class SportsPress_Admin_Bar {
23
 
@@ -36,7 +36,7 @@ class SportsPress_Admin_Bar {
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_ADMIN_BAR_VERSION' ) )
39
- define( 'SP_ADMIN_BAR_VERSION', '1.9.14' );
40
 
41
  if ( !defined( 'SP_ADMIN_BAR_URL' ) )
42
  define( 'SP_ADMIN_BAR_URL', plugin_dir_url( __FILE__ ) );
2
  /*
3
  Plugin Name: SportsPress Admin Bar
4
  Plugin URI: http://themeboy.com/
5
+ Description: Add an admin bar link to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.2
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Admin Bar Class
18
  *
19
  * @class SportsPress_Admin_Bar
20
+ * @version 2.2
21
  */
22
  class SportsPress_Admin_Bar {
23
 
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_ADMIN_BAR_VERSION' ) )
39
+ define( 'SP_ADMIN_BAR_VERSION', '2.2' );
40
 
41
  if ( !defined( 'SP_ADMIN_BAR_URL' ) )
42
  define( 'SP_ADMIN_BAR_URL', plugin_dir_url( __FILE__ ) );
modules/sportspress-birthdays.php CHANGED
@@ -181,7 +181,6 @@ class SportsPress_Birthdays {
181
  return $data;
182
  }
183
 
184
-
185
  /**
186
  * Register widgets
187
  */
181
  return $data;
182
  }
183
 
 
184
  /**
185
  * Register widgets
186
  */
modules/sportspress-bulk-actions.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: SportsPress Bulk Actions
4
+ Plugin URI: http://themeboy.com/
5
+ Description: Add bulk actions to SportsPress.
6
+ Author: ThemeBoy
7
+ Author URI: http://themeboy.com/
8
+ Version: 2.2
9
+ */
10
+
11
+ // Exit if accessed directly
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'SportsPress_Bulk_Actions' ) ) :
15
+
16
+ /**
17
+ * Main SportsPress Bulk Actions Class
18
+ *
19
+ * @class SportsPress_Bulk_Actions
20
+ * @version 2.2
21
+ */
22
+ class SportsPress_Bulk_Actions {
23
+
24
+ /**
25
+ * Constructor
26
+ */
27
+ public function __construct() {
28
+ // Define constants
29
+ $this->define_constants();
30
+
31
+ // Teams
32
+ add_filter( 'bulk_actions-edit-sp_team', array( $this, 'team_actions' ) );
33
+ add_filter( 'handle_bulk_actions-edit-sp_team', array( $this, 'team_actions_handler' ), 10, 3 );
34
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
35
+ }
36
+
37
+ /**
38
+ * Define constants.
39
+ */
40
+ private function define_constants() {
41
+ if ( !defined( 'SP_BULK_ACTIONS_VERSION' ) )
42
+ define( 'SP_BULK_ACTIONS_VERSION', '2.2' );
43
+
44
+ if ( !defined( 'SP_BULK_ACTIONS_URL' ) )
45
+ define( 'SP_BULK_ACTIONS_URL', plugin_dir_url( __FILE__ ) );
46
+
47
+ if ( !defined( 'SP_BULK_ACTIONS_DIR' ) )
48
+ define( 'SP_BULK_ACTIONS_DIR', plugin_dir_path( __FILE__ ) );
49
+ }
50
+
51
+ /**
52
+ * Add option to the team bulk actions dropdown.
53
+ */
54
+ public function team_actions( $bulk_actions ) {
55
+ $bulk_actions['sp_calendar'] = __( 'Generate Calendars', 'sportspress' );
56
+ return $bulk_actions;
57
+ }
58
+
59
+ /**
60
+ * Handle form submission for team bulk actions.
61
+ */
62
+ public function team_actions_handler( $redirect_to, $doaction, $post_ids ) {
63
+ if ( $doaction !== 'sp_calendar' ) {
64
+ return $redirect_to;
65
+ }
66
+
67
+ foreach ( $post_ids as $post_id ) {
68
+ $post = array();
69
+ $post['post_title'] = get_the_title( $post_id ) . ' ' . __( 'Calendar', 'sportspress' );
70
+ $post['post_type'] = 'sp_calendar';
71
+ $post['post_status'] = 'publish';
72
+
73
+ // Insert post
74
+ $id = wp_insert_post( $post );
75
+
76
+ // Flag as bulk
77
+ update_post_meta( $id, '_sp_bulk', 1 );
78
+
79
+ // Update meta
80
+ update_post_meta( $id, 'sp_team', $post_id );
81
+ update_post_meta( $id, 'sp_format', 'calendar' );
82
+ }
83
+
84
+ $redirect_to = add_query_arg( 'sp_bulk_generated_calendars', count( $post_ids ), $redirect_to );
85
+ return $redirect_to;
86
+ }
87
+
88
+ /**
89
+ * Display notices after form submission.
90
+ */
91
+ public function admin_notices() {
92
+ if ( ! empty( $_REQUEST['sp_bulk_generated_calendars'] ) ) {
93
+ $count = intval( $_REQUEST['sp_bulk_generated_calendars'] );
94
+
95
+ printf( '<div id="message" class="updated notice notice-success is-dismissible"><p>' .
96
+ _n( 'Generated %s calendar.',
97
+ 'Generated %s calendars.',
98
+ $count,
99
+ 'sportspress'
100
+ ) . ' <a href="' . admin_url('edit.php?post_type=sp_calendar') . '">' . __( 'View', 'sportspress' ) . '</a></p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', $count );
101
+ }
102
+ }
103
+ }
104
+
105
+ endif;
106
+
107
+ new SportsPress_Bulk_Actions();
modules/sportspress-calendars.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add event calendars to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.0.7
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Calendars' ) ) :
17
  * Main SportsPress Calendars Class
18
  *
19
  * @class SportsPress_Calendars
20
- * @version 2.0.7
21
  */
22
  class SportsPress_Calendars {
23
 
@@ -42,6 +42,8 @@ class SportsPress_Calendars {
42
  add_filter( 'sportspress_event_settings', array( $this, 'add_event_settings' ) );
43
  add_filter( 'sportspress_team_options', array( $this, 'add_team_options' ) );
44
  add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 40 );
 
 
45
  }
46
 
47
  /**
@@ -49,7 +51,7 @@ class SportsPress_Calendars {
49
  */
50
  private function define_constants() {
51
  if ( !defined( 'SP_CALENDARS_VERSION' ) )
52
- define( 'SP_CALENDARS_VERSION', '2.0.7' );
53
 
54
  if ( !defined( 'SP_CALENDARS_URL' ) )
55
  define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) );
@@ -192,6 +194,13 @@ class SportsPress_Calendars {
192
  'context' => 'side',
193
  'priority' => 'default',
194
  ),
 
 
 
 
 
 
 
195
  'details' => array(
196
  'title' => __( 'Details', 'sportspress' ),
197
  'save' => 'SP_Meta_Box_Calendar_Details::save',
@@ -389,6 +398,46 @@ class SportsPress_Calendars {
389
  'options' => array(
390
  'blocks' => __( 'Blocks', 'sportspress' ),
391
  'calendar' => __( 'Calendar', 'sportspress' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  ),
393
  ),
394
  )
5
  Description: Add event calendars to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.2
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Calendars Class
18
  *
19
  * @class SportsPress_Calendars
20
+ * @version 2.2
21
  */
22
  class SportsPress_Calendars {
23
 
42
  add_filter( 'sportspress_event_settings', array( $this, 'add_event_settings' ) );
43
  add_filter( 'sportspress_team_options', array( $this, 'add_team_options' ) );
44
  add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 40 );
45
+ add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) );
46
+ add_filter( 'sportspress_after_player_template', array( $this, 'add_player_template' ), 40 );
47
  }
48
 
49
  /**
51
  */
52
  private function define_constants() {
53
  if ( !defined( 'SP_CALENDARS_VERSION' ) )
54
+ define( 'SP_CALENDARS_VERSION', '2.2' );
55
 
56
  if ( !defined( 'SP_CALENDARS_URL' ) )
57
  define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) );
194
  'context' => 'side',
195
  'priority' => 'default',
196
  ),
197
+ 'columns' => array(
198
+ 'title' => __( 'Columns', 'sportspress' ),
199
+ 'save' => 'SP_Meta_Box_Calendar_Columns::save',
200
+ 'output' => 'SP_Meta_Box_Calendar_Columns::output',
201
+ 'context' => 'side',
202
+ 'priority' => 'default',
203
+ ),
204
  'details' => array(
205
  'title' => __( 'Details', 'sportspress' ),
206
  'save' => 'SP_Meta_Box_Calendar_Details::save',
398
  'options' => array(
399
  'blocks' => __( 'Blocks', 'sportspress' ),
400
  'calendar' => __( 'Calendar', 'sportspress' ),
401
+ 'list' => __( 'List', 'sportspress' ),
402
+ ),
403
+ ),
404
+ )
405
+ );
406
+ }
407
+
408
+ /**
409
+ * Add player template.
410
+ *
411
+ * @return array
412
+ */
413
+ public function add_player_template( $templates ) {
414
+ return array_merge( $templates, array(
415
+ 'events' => array(
416
+ 'title' => __( 'Events', 'sportspress' ),
417
+ 'option' => 'sportspress_player_show_events',
418
+ 'action' => 'sportspress_output_player_events',
419
+ 'default' => 'no',
420
+ ),
421
+ ) );
422
+ }
423
+
424
+ /**
425
+ * Add player options.
426
+ *
427
+ * @return array
428
+ */
429
+ public function add_player_options( $options ) {
430
+ return array_merge( $options,
431
+ array(
432
+ array(
433
+ 'title' => __( 'Events', 'sportspress' ),
434
+ 'id' => 'sportspress_player_events_format',
435
+ 'default' => 'title',
436
+ 'type' => 'select',
437
+ 'options' => array(
438
+ 'blocks' => __( 'Blocks', 'sportspress' ),
439
+ 'calendar' => __( 'Calendar', 'sportspress' ),
440
+ 'list' => __( 'List', 'sportspress' ),
441
  ),
442
  ),
443
  )
modules/sportspress-icons.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add vector performance icons to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.1
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Icons' ) ) :
17
  * Main SportsPress Icons Class
18
  *
19
  * @class SportsPress_Icons
20
- * @version 2.1
21
  */
22
  class SportsPress_Icons {
23
 
@@ -48,7 +48,7 @@ class SportsPress_Icons {
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_ICONS_VERSION' ) )
51
- define( 'SP_ICONS_VERSION', '2.1' );
52
 
53
  if ( !defined( 'SP_ICONS_URL' ) )
54
  define( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) );
@@ -92,7 +92,7 @@ class SportsPress_Icons {
92
  $meta = get_post_meta( $id, 'sp_icon', true );
93
  if ( null !== $meta && in_array( $meta, $this->icons ) ) {
94
  $color = get_post_meta( $id, 'sp_color', true );
95
- $icon = '<i class="sp-icon-' . $meta . '" style="color:' . $color . '"></i>';
96
  }
97
  return $icon;
98
  }
@@ -104,13 +104,13 @@ class SportsPress_Icons {
104
  if ( ! $id || ! $value ) return $icons;
105
  $icon = get_post_meta( $id, 'sp_icon', true );
106
  if ( null !== $icon && in_array( $icon, $this->icons ) ) {
107
- $title = get_the_title( $id );
108
  $color = get_post_meta( $id, 'sp_color', true );
109
  preg_match( '#\((.*?)\)#', $value, $match );
110
  if ( ! empty( $match ) && isset( $match[1] ) ) {
111
- $icons = '<i class="sp-icon-' . $icon . '" title="' . $title . '" style="color:' . $color . '"></i> ' . $match[1] . '<br>';
112
  } else {
113
- $icons = str_repeat( '<i class="sp-icon-' . $icon . '" title="' . $title . '" style="color:' . $color . '"></i> ', intval( $value ) );
114
  }
115
  }
116
  return $icons;
5
  Description: Add vector performance icons to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.2
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Icons Class
18
  *
19
  * @class SportsPress_Icons
20
+ * @version 2.2
21
  */
22
  class SportsPress_Icons {
23
 
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_ICONS_VERSION' ) )
51
+ define( 'SP_ICONS_VERSION', '2.2' );
52
 
53
  if ( !defined( 'SP_ICONS_URL' ) )
54
  define( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) );
92
  $meta = get_post_meta( $id, 'sp_icon', true );
93
  if ( null !== $meta && in_array( $meta, $this->icons ) ) {
94
  $color = get_post_meta( $id, 'sp_color', true );
95
+ $icon = '<i class="sp-icon-' . $meta . '" style="color:' . $color . ' !important"></i>';
96
  }
97
  return $icon;
98
  }
104
  if ( ! $id || ! $value ) return $icons;
105
  $icon = get_post_meta( $id, 'sp_icon', true );
106
  if ( null !== $icon && in_array( $icon, $this->icons ) ) {
107
+ $title = sp_get_singular_name( $id );
108
  $color = get_post_meta( $id, 'sp_color', true );
109
  preg_match( '#\((.*?)\)#', $value, $match );
110
  if ( ! empty( $match ) && isset( $match[1] ) ) {
111
+ $icons = '<i class="sp-icon-' . $icon . '" title="' . $title . '" style="color:' . $color . ' !important"></i> ' . $match[1] . '<br>';
112
  } else {
113
+ $icons = str_repeat( '<i class="sp-icon-' . $icon . '" title="' . $title . '" style="color:' . $color . ' !important"></i> ', intval( $value ) );
114
  }
115
  }
116
  return $icons;
modules/sportspress-league-tables.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add league tables to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.1.4
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_League_Tables' ) ) :
17
  * Main SportsPress League Tables Class
18
  *
19
  * @class SportsPress_League_Tables
20
- * @version 2.1.4
21
  */
22
  class SportsPress_League_Tables {
23
 
@@ -40,7 +40,6 @@ class SportsPress_League_Tables {
40
  add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );
41
  add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );
42
  add_filter( 'sportspress_team_settings', array( $this, 'add_settings' ) );
43
- add_filter( 'sportspress_team_options', array( $this, 'add_options' ) );
44
  add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 30 );
45
  }
46
 
@@ -49,7 +48,7 @@ class SportsPress_League_Tables {
49
  */
50
  private function define_constants() {
51
  if ( !defined( 'SP_LEAGUE_TABLES_VERSION' ) )
52
- define( 'SP_LEAGUE_TABLES_VERSION', '2.1.4' );
53
 
54
  if ( !defined( 'SP_LEAGUE_TABLES_URL' ) )
55
  define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );
@@ -255,6 +254,19 @@ class SportsPress_League_Tables {
255
  'step' => 1
256
  ),
257
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
  array(
260
  'title' => __( 'Pos', 'sportspress' ),
@@ -263,6 +275,17 @@ class SportsPress_League_Tables {
263
  'default' => 'no',
264
  'type' => 'checkbox',
265
  ),
 
 
 
 
 
 
 
 
 
 
 
266
  ) ),
267
 
268
  array(
@@ -271,25 +294,6 @@ class SportsPress_League_Tables {
271
  );
272
  }
273
 
274
- /**
275
- * Add options.
276
- *
277
- * @return array
278
- */
279
- public function add_options( $options ) {
280
- return array_merge( $options,
281
- array(
282
- array(
283
- 'title' => __( 'Table Columns', 'sportspress' ),
284
- 'desc' => __( 'Enable column editing', 'sportspress' ),
285
- 'id' => 'sportspress_team_column_editing',
286
- 'default' => 'no',
287
- 'type' => 'checkbox',
288
- ),
289
- )
290
- );
291
- }
292
-
293
  /**
294
  * Add team template.
295
  *
5
  Description: Add league tables to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.2
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress League Tables Class
18
  *
19
  * @class SportsPress_League_Tables
20
+ * @version 2.2
21
  */
22
  class SportsPress_League_Tables {
23
 
40
  add_filter( 'sportspress_meta_boxes', array( $this, 'add_meta_boxes' ) );
41
  add_filter( 'sportspress_shortcodes', array( $this, 'add_shortcodes' ) );
42
  add_filter( 'sportspress_team_settings', array( $this, 'add_settings' ) );
 
43
  add_filter( 'sportspress_after_team_template', array( $this, 'add_team_template' ), 30 );
44
  }
45
 
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_LEAGUE_TABLES_VERSION' ) )
51
+ define( 'SP_LEAGUE_TABLES_VERSION', '2.2' );
52
 
53
  if ( !defined( 'SP_LEAGUE_TABLES_URL' ) )
54
  define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );
254
  'step' => 1
255
  ),
256
  ),
257
+
258
+ array(
259
+ 'title' => __( 'Form', 'sportspress' ),
260
+ 'id' => 'sportspress_form_limit',
261
+ 'class' => 'small-text',
262
+ 'default' => '5',
263
+ 'desc' => __( 'events', 'sportspress' ),
264
+ 'type' => 'number',
265
+ 'custom_attributes' => array(
266
+ 'min' => 1,
267
+ 'step' => 1
268
+ ),
269
+ ),
270
 
271
  array(
272
  'title' => __( 'Pos', 'sportspress' ),
275
  'default' => 'no',
276
  'type' => 'checkbox',
277
  ),
278
+
279
+ array(
280
+ 'title' => __( 'Tiebreaker', 'sportspress' ),
281
+ 'id' => 'sportspress_table_tiebreaker',
282
+ 'default' => 'none',
283
+ 'type' => 'select',
284
+ 'options' => array(
285
+ 'none' => __( 'None', 'sportspress' ),
286
+ 'h2h' => __( 'Head to head', 'sportspress' ),
287
+ ),
288
+ ),
289
  ) ),
290
 
291
  array(
294
  );
295
  }
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  /**
298
  * Add team template.
299
  *
modules/sportspress-style.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: SportsPress Style
4
+ Plugin URI: http://themeboy.com/
5
+ Description: Add frontend styles to SportsPress.
6
+ Author: ThemeBoy
7
+ Author URI: http://themeboy.com/
8
+ Version: 2.2.4
9
+ */
10
+
11
+ // Exit if accessed directly
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'SportsPress_Style' ) ) :
15
+
16
+ /**
17
+ * Main SportsPress Style Class
18
+ *
19
+ * @class SportsPress_Style
20
+ * @version 2.2.4
21
+ */
22
+ class SportsPress_Style {
23
+
24
+ /**
25
+ * Constructor
26
+ */
27
+ public function __construct() {
28
+ // Define constants
29
+ $this->define_constants();
30
+
31
+ // Add option
32
+ add_filter( 'sportspress_script_styling_options', array( $this, 'add_option' ) );
33
+
34
+ // Add stylesheet
35
+ add_filter( 'sportspress_enqueue_styles', array( $this, 'add_styles' ), 20 );
36
+
37
+ // Output custom CSS
38
+ add_action( 'sportspress_frontend_css', array( $this, 'custom_css' ), 40 );
39
+ }
40
+
41
+ /**
42
+ * Define constants.
43
+ */
44
+ private function define_constants() {
45
+ if ( !defined( 'SP_STYLE_VERSION' ) )
46
+ define( 'SP_STYLE_VERSION', '2.2.4' );
47
+
48
+ if ( !defined( 'SP_STYLE_URL' ) )
49
+ define( 'SP_STYLE_URL', plugin_dir_url( __FILE__ ) );
50
+
51
+ if ( !defined( 'SP_STYLE_DIR' ) )
52
+ define( 'SP_STYLE_DIR', plugin_dir_path( __FILE__ ) );
53
+ }
54
+
55
+ /**
56
+ * Add option.
57
+ */
58
+ public static function add_option( $options = array() ) {
59
+ if ( ! current_theme_supports( 'sportspress' ) ):
60
+ array_unshift( $options, array(
61
+ 'title' => __( 'Frontend Styles', 'sportspress' ),
62
+ 'desc' => __( 'Enable', 'sportspress' ),
63
+ 'id' => 'sportspress_styles',
64
+ 'default' => 'yes',
65
+ 'type' => 'checkbox',
66
+ ) );
67
+ endif;
68
+ return $options;
69
+ }
70
+
71
+ /**
72
+ * Add stylesheet.
73
+ */
74
+ public static function add_styles( $styles = array() ) {
75
+ if ( current_theme_supports( 'sportspress' ) ) return $styles;
76
+ if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) return $styles;
77
+
78
+ $styles['sportspress-roboto'] = array(
79
+ 'src' => '//fonts.googleapis.com/css?family=Roboto:400,500&amp;subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese',
80
+ 'deps' => '',
81
+ 'version' => SP_STYLE_VERSION,
82
+ 'media' => 'all'
83
+ );
84
+
85
+ $styles['sportspress-style'] = array(
86
+ 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style.css',
87
+ 'deps' => '',
88
+ 'version' => SP_STYLE_VERSION,
89
+ 'media' => 'all'
90
+ );
91
+
92
+ if ( is_rtl() ) {
93
+ $styles['sportspress-style-rtl'] = array(
94
+ 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-rtl.css',
95
+ 'deps' => 'sportspress-style',
96
+ 'version' => SP_STYLE_VERSION,
97
+ 'media' => 'all'
98
+ );
99
+ } else {
100
+ $styles['sportspress-style-ltr'] = array(
101
+ 'src' => str_replace( array( 'http:', 'https:' ), '', SP()->plugin_url() ) . '/assets/css/sportspress-style-ltr.css',
102
+ 'deps' => 'sportspress-style',
103
+ 'version' => SP_STYLE_VERSION,
104
+ 'media' => 'all'
105
+ );
106
+ }
107
+
108
+ return $styles;
109
+ }
110
+
111
+ /**
112
+ * Output custom CSS.
113
+ */
114
+ public function custom_css( $colors = array() ) {
115
+ if ( current_theme_supports( 'sportspress' ) ) return $styles;
116
+ if ( 'no' === get_option( 'sportspress_styles', 'yes' ) ) return $styles;
117
+
118
+ // Defaults
119
+ if ( empty( $colors['primary'] ) ) $colors['primary'] = '#2b353e';
120
+ if ( empty( $colors['background'] ) ) $colors['background'] = '#f4f4f4';
121
+ if ( empty( $colors['text'] ) ) $colors['text'] = '#222222';
122
+ if ( empty( $colors['heading'] ) ) $colors['heading'] = '#ffffff';
123
+ if ( empty( $colors['link'] ) ) $colors['link'] = '#00a69c';
124
+
125
+ // Calculate primary variations
126
+ $colors['primary_border'] = sp_hex_darker( $colors['primary'], 26, true );
127
+
128
+ // Calculate background variations
129
+ $colors['background_highlight'] = sp_hex_darker( $colors['background'], 6, true );
130
+ $colors['background_border'] = sp_hex_darker( $colors['background'], 26, true );
131
+
132
+ // Calculate text variations
133
+ $rgb = sp_rgb_from_hex( $colors['text'] );
134
+ $colors['text_muted'] = 'rgba(' . implode( ',', $rgb ) . ',0.5)';
135
+
136
+ // Primary
137
+ echo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-caption{background:' . $colors['primary'] . ' !important}';
138
+ echo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-caption{border-color:' . $colors['primary_border'] . ' !important}';
139
+
140
+ // Background
141
+ echo '.sp-table-caption,.sp-data-table,.sp-data-table tfoot,.sp-template .sp-view-all-link,.sp-template-gallery .sp-gallery-group-name,.sp-template-gallery .sp-gallery-wrapper,.sp-template-countdown .sp-event-name,.sp-countdown time,.sp-template-details dl,.sp-event-statistics .sp-statistic-bar,.sp-tournament-bracket .sp-team-name,.sp-profile-selector{background:' . $colors['background'] . ' !important}';
142
+ echo '.sp-table-caption,.sp-data-table,.sp-data-table td,.sp-template .sp-view-all-link,.sp-template-gallery .sp-gallery-group-name,.sp-template-gallery .sp-gallery-wrapper,.sp-template-countdown .sp-event-name,.sp-countdown time,.sp-countdown span,.sp-template-details dl,.sp-event-statistics .sp-statistic-bar,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-team-name,.sp-tournament-bracket .sp-event,.sp-profile-selector{border-color:' . $colors['background_border'] . ' !important}';
143
+ echo '.sp-tournament-bracket .sp-team .sp-team-name:before{border-left-color:' . $colors['background_border'] . ' !important;border-right-color:' . $colors['background_border'] . ' !important}';
144
+ echo '.sp-data-table .sp-highlight,.sp-data-table .highlighted td,.sp-template-scoreboard td:hover{background:' . $colors['background_highlight'] . ' !important}';
145
+
146
+ // Text
147
+ echo '.sp-template *,.sp-data-table *,.sp-table-caption,.sp-data-table tfoot a:hover,.sp-template .sp-view-all-link a:hover,.sp-template-gallery .sp-gallery-group-name,.sp-template-details dd,.sp-template-event-logos .sp-team-name,.sp-template-event-logos .sp-team-result,.sp-template-event-blocks .sp-event-results,.sp-template-scoreboard a,.sp-template-scoreboard a:hover,.sp-tournament-bracket,.sp-tournament-bracket .sp-event .sp-event-title:hover,.sp-tournament-bracket .sp-event .sp-event-title:hover *{color:' . $colors['text'] . ' !important}';
148
+ echo '.sp-template .sp-view-all-link a,.sp-countdown span small,.sp-template-event-calendar tfoot a,.sp-template-event-blocks .sp-event-date,.sp-template-details dt,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket th,.sp-tournament-bracket .sp-event .sp-event-title,.sp-template-scoreboard .sp-scoreboard-date,.sp-tournament-bracket .sp-event .sp-event-title *{color:' . $colors['text_muted'] . ' !important}';
149
+
150
+ // Heading
151
+ echo '.sp-data-table th,.sp-template-countdown .sp-event-venue,.sp-template-countdown .sp-event-league,.sp-template-gallery .gallery-item a,.sp-template-gallery .gallery-caption,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket thead th,.sp-tournament-bracket .sp-heading{color:' . $colors['heading'] . ' !important}';
152
+
153
+ // Link
154
+ echo '.sp-template a,.sp-data-table a,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover{color:' . $colors['link'] . ' !important}';
155
+ echo '.sp-template-gallery .gallery-caption strong,.sp-tournament-bracket .sp-team-name:hover,.sp-template-scoreboard .sp-scoreboard-nav,.sp-tournament-bracket .sp-heading{background:' . $colors['link'] . ' !important}';
156
+ echo '.sp-tournament-bracket .sp-team-name:hover,.sp-tournament-bracket .sp-heading,.sp-tab-menu-item-active a, .sp-tab-menu-item-active a:hover{border-color:' . $colors['link'] . ' !important}';
157
+ }
158
+ }
159
+
160
+ endif;
161
+
162
+ new SportsPress_Style();
presets/team-sports/soccer.json CHANGED
@@ -17,10 +17,10 @@
17
  { "name" : "Goals", "description" : "Total goals", "primary" : 1 }
18
  ],
19
  "performance": [
20
- { "name" : "Goals", "description" : "Goals", "icon" : "soccerball", "color" : "#222222" },
21
- { "name" : "Assists", "description" : "Assists", "icon" : "shoe", "color" : "#222222" },
22
- { "name" : "Yellow Cards", "description" : "Yellow cards", "icon" : "card", "color" : "#f4d014" },
23
- { "name" : "Red Cards", "description" : "Red cards", "icon" : "card", "color" : "#d4000f" }
24
  ],
25
  "columns": [
26
  { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" },
@@ -46,10 +46,11 @@
46
  "event_teams" : "2",
47
  "event_show_players" : "yes",
48
  "event_show_total" : "no",
49
- "sportspress_event_performance_mode" : "icons",
50
  "event_show_player_numbers" : "yes",
 
51
  "event_split_players_by_team" : "yes",
52
  "event_split_players_by_position" : "no",
53
- "sportspress_event_total_performance" : "all"
54
  }
55
  }
17
  { "name" : "Goals", "description" : "Total goals", "primary" : 1 }
18
  ],
19
  "performance": [
20
+ { "name" : "Goals", "description" : "Goals", "singular" : "Goal", "icon" : "soccerball", "color" : "#222222" },
21
+ { "name" : "Assists", "description" : "Assists", "singular" : "Assist", "icon" : "shoe", "color" : "#222222", "timed" : 0 },
22
+ { "name" : "Yellow Cards", "description" : "Yellow cards", "singular" : "Yellow Card", "icon" : "card", "color" : "#f4d014" },
23
+ { "name" : "Red Cards", "description" : "Red cards", "singular" : "Red Card", "icon" : "card", "color" : "#d4000f" }
24
  ],
25
  "columns": [
26
  { "name" : "P", "equation" : "$eventsplayed", "description" : "Matches played" },
46
  "event_teams" : "2",
47
  "event_show_players" : "yes",
48
  "event_show_total" : "no",
49
+ "event_performance_mode" : "icons",
50
  "event_show_player_numbers" : "yes",
51
+ "event_performance_show_minutes": "yes",
52
  "event_split_players_by_team" : "yes",
53
  "event_split_players_by_position" : "no",
54
+ "event_total_performance" : "all"
55
  }
56
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: calendars, club, club management, esports, events, fixtures, leagues, leag
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 4.7
7
- Stable tag: 2.1.7
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -50,6 +50,7 @@ More details about each feature are available on the [SportsPress Website](http:
50
 
51
  = Free Extensions =
52
  * [SportsPress for Baseball](https://wordpress.org/plugins/sportspress-for-baseball/)
 
53
  * [SportsPress for Cricket](https://wordpress.org/plugins/sportspress-for-cricket/)
54
  * [SportsPress for Football (Soccer)](https://wordpress.org/plugins/sportspress-for-soccer/)
55
  * [SportsPress for Golf](https://wordpress.org/plugins/sportspress-for-golf/)
@@ -121,18 +122,11 @@ Looking for more advanced sports functionality? Upgrade to [SportsPress Pro](htt
121
  * League of Legends
122
 
123
  = SportsPress Themes for Clubs =
124
- * [Football Club](http://tboy.co/fc)
125
- * [Premier](http://tboy.co/premier)
126
  * [Emblem](http://tboy.co/emblem)
 
127
  * [Marquee](http://tboy.co/marquee)
128
-
129
- = Documentation =
130
- * [Getting Started](http://tboy.co/installation)
131
- * [User Roles](http://tboy.co/roles)
132
- * [Integration Guide](http://tboy.co/integration)
133
- * [Actions](http://tboy.co/actionref)
134
- * [Filters](http://tboy.co/filterref)
135
- * [Shortcodes](http://tboy.co/shortcoderef)
136
 
137
  = Get Involved =
138
 
@@ -183,12 +177,16 @@ If on the off-chance you do encounter issues with the event/team/player/staff pa
183
 
184
  == Screenshots ==
185
 
186
- 1. Select your sport to automatically install presets and sample data.
187
- 2. Each team has a unique logo and website URL. Optionally link teams from your blog to their official websites.
188
- 3. The overview page provides a birds-eye view of your entire sports network.
189
- 4. Configure variables used throughout the plugin to fit your sport. Presets are provided for some sports, and will automatically populate these options.
190
- 5. Design your own points system using the custom drag-and-drop equation builder.
191
- 6. Twenty Fourteen theme showcasing the dynamic league table and some of the included widgets.
 
 
 
 
192
 
193
  == Frequently Asked Questions ==
194
 
@@ -223,6 +221,7 @@ Limitations? Don't worry, there are no limitations to the number of events, play
223
  The current modules that are available exclusively to SportsPress Pro are:
224
 
225
  * Tournaments: Create and display tournaments in a bracket/knockout cup format.
 
226
  * Scoreboard: Display multiple event results in a horizontal scoreboard.
227
  * Sponsors: Add your sponsors on your website and track each of their clicks and impressions.
228
  * Staff Directories: Show contact information of your key personnel so people know who to get in touch with.
@@ -239,6 +238,112 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
239
 
240
  == Changelog ==
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  = 2.1.7 =
243
  * Fix - Activation error on older versions of PHP.
244
 
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 4.7
7
+ Stable tag: 2.2.11
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
50
 
51
  = Free Extensions =
52
  * [SportsPress for Baseball](https://wordpress.org/plugins/sportspress-for-baseball/)
53
+ * [SportsPress for Basketball](https://wordpress.org/plugins/sportspress-for-basketball/)
54
  * [SportsPress for Cricket](https://wordpress.org/plugins/sportspress-for-cricket/)
55
  * [SportsPress for Football (Soccer)](https://wordpress.org/plugins/sportspress-for-soccer/)
56
  * [SportsPress for Golf](https://wordpress.org/plugins/sportspress-for-golf/)
122
  * League of Legends
123
 
124
  = SportsPress Themes for Clubs =
125
+ * [Courtside](http://tboy.co/courtside)
 
126
  * [Emblem](http://tboy.co/emblem)
127
+ * [Football Club](http://tboy.co/fc)
128
  * [Marquee](http://tboy.co/marquee)
129
+ * [Premier](http://tboy.co/premier)
 
 
 
 
 
 
 
130
 
131
  = Get Involved =
132
 
177
 
178
  == Screenshots ==
179
 
180
+ 1. Add a suite of widgets to your site to display your own sports data.
181
+ 2. Generate automated standings that update whenever results are published.
182
+ 3. Schedule matches and display details, results, box scores, and a map to the venue.
183
+ 4. Register teams and players on your site and create lineups for each team.
184
+ 5. Display player profiles with configurable details and career stats.
185
+ 6. Select your sport to automatically install presets and sample data.
186
+ 7. Each team has a unique logo and website URL. Optionally link teams from your blog to their official websites.
187
+ 8. The overview page provides a birds-eye view of your entire sports network.
188
+ 9. Configure variables used throughout the plugin to fit your sport. Presets are provided for some sports, and will automatically populate these options.
189
+ 10. Design your own points system using the custom drag-and-drop equation builder.
190
 
191
  == Frequently Asked Questions ==
192
 
221
  The current modules that are available exclusively to SportsPress Pro are:
222
 
223
  * Tournaments: Create and display tournaments in a bracket/knockout cup format.
224
+ * Timelines: Display a visual timeline of player performance in events.
225
  * Scoreboard: Display multiple event results in a horizontal scoreboard.
226
  * Sponsors: Add your sponsors on your website and track each of their clicks and impressions.
227
  * Staff Directories: Show contact information of your key personnel so people know who to get in touch with.
238
 
239
  == Changelog ==
240
 
241
+ = 2.2.11 =
242
+ * Fix - Timeout issue when tiebreaker checks for head-to-head standings.
243
+ * Fix - Check for REST API controllers to prevent errors when using Jetpack.
244
+
245
+ = 2.2.10 =
246
+ * Tweak - Update modules page.
247
+ * Fix - League table discrepancy due to change in number of teams setting.
248
+ * Fix - JavaScript error caused by box score displaying icons without players.
249
+
250
+ = 2.2.9 =
251
+ * Fix - Warning message above player list template.
252
+
253
+ = 2.2.8 =
254
+ * Fix - Hidden box score header in values mode.
255
+ * Fix - Welcome page displaying after upgrade if preset was saved from settings.
256
+ * Fix - Decimal places being dropped from player list statistics.
257
+
258
+ = 2.2.7 =
259
+ * Tweak - Adjust frontend styles to allow some overrides.
260
+ * Tweak - Update modules page with new module options.
261
+ * Fix - Javascript error in icon mode box scores.
262
+ * Fix - Player list default sorting issue.
263
+ * Fix - Empty team checkboxes in player quick edit.
264
+
265
+ = 2.2.6 =
266
+ * Tweak - Hide box score table header row in icon mode.
267
+ * Tweak - Adjust frontend stylesheet.
268
+ * Fix - Empty league tables when no columns are selected.
269
+ * Fix - Empty player lists when no columns are selected.
270
+ * Fix - Link events setting not applied to box score time.
271
+ * Fix - Player list sorting error with non-numeric values.
272
+ * Fix - Home and away records being combined when opponent not in league table.
273
+
274
+ = 2.2.5 =
275
+ * Feature - Enable positions to be displayed in icons mode box score.
276
+ * Tweak - Reflect mixed column order in player list admin.
277
+ * Tweak - Remove table row border in frontend stylesheet.
278
+ * Tweak - Automatically apply table adjustments on admin page load.
279
+ * Tweak - Simplify box score icon totals.
280
+ * Fix - Adjustments not applying to player list values.
281
+ * Fix - Minutes not displaying in box score.
282
+ * Fix - Player positions displaying not displaying in box score.
283
+ * Fix - Total time displaying as 0:00.
284
+
285
+ = 2.2.4 =
286
+ * Feature - Option to show or hide career totals in player profiles.
287
+ * Tweak - Icons not rendering when frontend stylesheet is active.
288
+ * Tweak - Remove underline from icon links in frontend stylesheet.
289
+ * Tweak - Change competition and season placeholders in events to "None".
290
+ * Tweak - Enable horizontal scrolling on large tables in admin.
291
+ * Fix - Equations returning zero when no events played.
292
+ * Fix - Player lists and player profiles showing different statistics when filtered by competition or season.
293
+ * Fix - Substitution icon not rendering for starting lineup players.
294
+ * Fix - Manual player performance errors in profile.
295
+ * Fix - Error in event results if team was deleted.
296
+ * Fix - Remove deprecated function in PHP 7.0.
297
+ * Fix - Non-numeric errors in PHP 7.1.
298
+
299
+ = 2.2.3 =
300
+ * Fix - Placeholders for non-numeric values in player list displaying as zero.
301
+
302
+ = 2.2.2 =
303
+ * Tweak - Center align form events.
304
+ * Fix - Reverse form array to display events in chronological order.
305
+ * Fix - Error in player lists when querying legacy events.
306
+ * Fix - Manual values in player lists when no events have been played.
307
+
308
+ = 2.2.1 =
309
+ * Fix - Empty timeline error when calculating substitution time.
310
+
311
+ = 2.2 =
312
+ * Feature - New frontend stylesheet for third-party themes.
313
+ * Feature - New chronological streak format in league tables.
314
+ * Feature - Head to head tiebreaker option in league tables.
315
+ * Feature - Add option to select number of players in player lists.
316
+ * Feature - Quick edit player's team and squad number.
317
+ * Feature - Bulk edit players' past and current teams.
318
+ * Feature - Taxonomies added to REST API.
319
+ * Feature - Ability to display event history in player profiles.
320
+ * Feature - Event list format option added to player and team events.
321
+ * Feature - Option to record minutes for specific statistics.
322
+ * Feature - Time format added for racing and timed sports.
323
+ * Feature - Dedicated option to redirect team pages to site URL.
324
+ * Feature - Bulk action to generate team calendars.
325
+ * Feature - Automatically adjust played minutes based on substitution times.
326
+ * Feature - Match day column option added to event lists.
327
+ * Tweak - Remove event limit in calendars.
328
+ * Tweak - Allow player squad number to be zero.
329
+ * Tweak - Enable mixing performance and statistic column order.
330
+ * Tweak - Filter player statistic equations by offense and defense.
331
+ * Tweak - System status hidden unless in debug mode.
332
+ * Tweak - Move event list column options to sidebar.
333
+ * Tweak - Return zero instead of error if dividing by zero.
334
+ * Tweak - Always display performance icons in admin.
335
+ * Tweak - Add preview notation in event blocks by default.
336
+ * Tweak - Single player performance name option added for hover text in icons mode.
337
+ * Fix - Player list precision number format error.
338
+ * Fix - Player list adjustments for existing values.
339
+ * Fix - Hide empty positions in player lists and galleries.
340
+ * Fix - Import button selectors disappeared in WordPress 4.7.
341
+ * Fix - Substitution time missing parentheses.
342
+ * Fix - Staff for home team not being displayed in events.
343
+ * Fix - Enable output of time and results without team names in home/away mode.
344
+ * Fix - Prevent totals override in box scores.
345
+ * Localization - Add Gibraltar nationality option and flag.
346
+
347
  = 2.1.7 =
348
  * Fix - Activation error on older versions of PHP.
349
 
sportspress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
- * Version: 2.1.7
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
- * @version 2.1.7
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.1.7';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
@@ -125,7 +125,7 @@ final class SportsPress {
125
  add_action( 'init', array( $this, 'init' ), 0 );
126
  add_action( 'init', array( 'SP_Shortcodes', 'init' ) );
127
  add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );
128
- add_action( 'tgmpa_register', array( $this, 'edition' ) );
129
 
130
  // Include core modules
131
  $this->include_modules();
@@ -333,9 +333,9 @@ final class SportsPress {
333
  }
334
 
335
  /**
336
- * Recommend SportsPress edition for available sports.
337
  */
338
- public static function edition() {
339
  $sport = sp_array_value( $_POST, 'sportspress_sport', get_option( 'sportspress_sport', null ) );
340
  if ( ! $sport ) return;
341
 
@@ -350,12 +350,20 @@ final class SportsPress {
350
  'version' => '0.9.1',
351
  );
352
  break;
 
 
 
 
 
 
 
 
353
  case 'cricket':
354
  $plugins[] = array(
355
  'name' => 'SportsPress for Cricket',
356
  'slug' => 'sportspress-for-cricket',
357
  'required' => false,
358
- 'version' => '1.0',
359
  );
360
  break;
361
  case 'golf':
@@ -363,6 +371,7 @@ final class SportsPress {
363
  'name' => 'SportsPress for Golf',
364
  'slug' => 'sportspress-for-golf',
365
  'required' => false,
 
366
  );
367
  break;
368
  case 'soccer':
@@ -370,6 +379,7 @@ final class SportsPress {
370
  'name' => 'SportsPress for Football (Soccer)',
371
  'slug' => 'sportspress-for-soccer',
372
  'required' => false,
 
373
  );
374
  break;
375
  endswitch;
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
+ * Version: 2.2.11
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
+ * @version 2.2.11
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.2.11';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
125
  add_action( 'init', array( $this, 'init' ), 0 );
126
  add_action( 'init', array( 'SP_Shortcodes', 'init' ) );
127
  add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );
128
+ add_action( 'tgmpa_register', array( $this, 'extension' ) );
129
 
130
  // Include core modules
131
  $this->include_modules();
333
  }
334
 
335
  /**
336
+ * Recommend SportsPress extension for available sports.
337
  */
338
+ public static function extension() {
339
  $sport = sp_array_value( $_POST, 'sportspress_sport', get_option( 'sportspress_sport', null ) );
340
  if ( ! $sport ) return;
341
 
350
  'version' => '0.9.1',
351
  );
352
  break;
353
+ case 'basketball':
354
+ $plugins[] = array(
355
+ 'name' => 'SportsPress for Basketball',
356
+ 'slug' => 'sportspress-for-basketball',
357
+ 'required' => false,
358
+ 'version' => '0.9',
359
+ );
360
+ break;
361
  case 'cricket':
362
  $plugins[] = array(
363
  'name' => 'SportsPress for Cricket',
364
  'slug' => 'sportspress-for-cricket',
365
  'required' => false,
366
+ 'version' => '1.1',
367
  );
368
  break;
369
  case 'golf':
371
  'name' => 'SportsPress for Golf',
372
  'slug' => 'sportspress-for-golf',
373
  'required' => false,
374
+ 'version' => '0.9',
375
  );
376
  break;
377
  case 'soccer':
379
  'name' => 'SportsPress for Football (Soccer)',
380
  'slug' => 'sportspress-for-soccer',
381
  'required' => false,
382
+ 'version' => '0.9.5',
383
  );
384
  break;
385
  endswitch;
templates/countdown.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.13
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -66,7 +66,7 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
66
  ?>
67
  <div class="sp-template sp-template-countdown">
68
  <div class="sp-countdown-wrapper">
69
- <h3 class="event-name">
70
  <?php
71
  if ( $show_logos ) {
72
  $teams = array_unique( (array) get_post_meta( $post->ID, 'sp_team' ) );
@@ -93,7 +93,7 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
93
  $venues = get_the_terms( $post->ID, 'sp_venue' );
94
  if ( $venues ):
95
  ?>
96
- <h5 class="event-venue">
97
  <?php
98
  if ( $link_venues ) {
99
  the_terms( $post->ID, 'sp_venue' );
@@ -116,7 +116,7 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
116
  foreach( $leagues as $league ):
117
  $term = get_term( $league->term_id, 'sp_league' );
118
  ?>
119
- <h5 class="event-league"><?php echo $term->name; ?></h5>
120
  <?php
121
  endforeach;
122
  endif;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
66
  ?>
67
  <div class="sp-template sp-template-countdown">
68
  <div class="sp-countdown-wrapper">
69
+ <h3 class="event-name sp-event-name">
70
  <?php
71
  if ( $show_logos ) {
72
  $teams = array_unique( (array) get_post_meta( $post->ID, 'sp_team' ) );
93
  $venues = get_the_terms( $post->ID, 'sp_venue' );
94
  if ( $venues ):
95
  ?>
96
+ <h5 class="event-venue sp-event-venue">
97
  <?php
98
  if ( $link_venues ) {
99
  the_terms( $post->ID, 'sp_venue' );
116
  foreach( $leagues as $league ):
117
  $term = get_term( $league->term_id, 'sp_league' );
118
  ?>
119
+ <h5 class="event-league sp-event-league"><?php echo $term->name; ?></h5>
120
  <?php
121
  endforeach;
122
  endif;
templates/event-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -67,7 +67,7 @@ if ( $day != 'default' )
67
  $calendar->day = $day;
68
  $data = $calendar->data();
69
 
70
- if ( $hide_if_empty && empty( $data ) ) return;
71
 
72
  if ( $show_title && false === $title && $id ):
73
  $caption = $calendar->caption;
@@ -131,7 +131,7 @@ if ( $title )
131
  <?php echo sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ); ?>
132
  </time>
133
  <h5 class="sp-event-results">
134
- <?php echo sp_add_link( '<span class="sp-result">' . implode( '</span> - <span class="sp-result">', apply_filters( 'sportspress_event_blocks_team_result_or_time', sp_get_main_results_or_time( $event ), $event->ID ) ), $permalink, $link_events . '</span>' ); ?>
135
  </h5>
136
  <?php if ( $show_league ): $leagues = get_the_terms( $event, 'sp_league' ); if ( $leagues ): $league = array_shift( $leagues ); ?>
137
  <div class="sp-event-league"><?php echo $league->name; ?></div>
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
67
  $calendar->day = $day;
68
  $data = $calendar->data();
69
 
70
+ if ( $hide_if_empty && empty( $data ) ) return false;
71
 
72
  if ( $show_title && false === $title && $id ):
73
  $caption = $calendar->caption;
131
  <?php echo sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ); ?>
132
  </time>
133
  <h5 class="sp-event-results">
134
+ <?php echo sp_add_link( '<span class="sp-result">' . implode( '</span> - <span class="sp-result">', apply_filters( 'sportspress_event_blocks_team_result_or_time', sp_get_main_results_or_time( $event ), $event->ID ) ) . '</span>', $permalink, $link_events ); ?>
135
  </h5>
136
  <?php if ( $show_league ): $leagues = get_the_terms( $event, 'sp_league' ); if ( $leagues ): $league = array_shift( $leagues ); ?>
137
  <div class="sp-event-league"><?php echo $league->name; ?></div>
templates/event-calendar.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -24,7 +24,7 @@ $defaults = array(
24
  'team' => null,
25
  'player' => null,
26
  'initial' => true,
27
- 'caption_tag' => 'h4',
28
  'show_all_events_link' => false,
29
  'override_global_date' => false,
30
  );
@@ -115,7 +115,7 @@ $next = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS yea
115
  $calendar_caption = _x('%1$s %2$s', 'calendar caption', 'sportspress');
116
  $calendar_output = '
117
  <div class="sp-calendar-wrapper">
118
- <table id="wp-calendar" class="sp-calendar sp-event-calendar">
119
  <caption class="sp-table-caption">' . ( $caption_tag == 'caption' ? '' : '<' . $caption_tag . '>' ) . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . ( $caption_tag == 'caption' ? '' : '</' . $caption_tag . '>' ) . '</caption>
120
  <thead>
121
  <tr>';
@@ -140,7 +140,7 @@ $calendar_output .= '
140
  <tr>';
141
 
142
  if ( $previous ) {
143
- $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a data-tooltip data-options="disable_for_touch:true" class="has-tooltip tip-right" href="' . add_query_arg( array( 'sp_year' => $previous->year, 'sp_month' => $previous->month ) ) . '" title="' . esc_attr( sprintf(_x('%1$s %2$s', 'calendar caption', 'sportspress'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year)))) . '">&laquo; ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
144
  } else {
145
  $calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
146
  }
@@ -148,7 +148,7 @@ if ( $previous ) {
148
  $calendar_output .= "\n\t\t".'<td class="pad">&nbsp;</td>';
149
 
150
  if ( $next ) {
151
- $calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a data-tooltip data-options="disable_for_touch:true" class="has-tooltip tip-left" href="' . add_query_arg( array( 'sp_year' => $next->year, 'sp_month' => $next->month ) ) . '" title="' . esc_attr( sprintf(_x('%1$s %2$s', 'calendar caption', 'sportspress'), $wp_locale->get_month($next->month), date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) ) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' &raquo;</a></td>';
152
  } else {
153
  $calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
154
  }
@@ -214,7 +214,7 @@ for ( $day = 1; $day <= $daysinmonth; ++$day ) {
214
  $newrow = false;
215
 
216
  if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) )
217
- $calendar_output .= '<td id="today">';
218
  else
219
  $calendar_output .= '<td>';
220
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
24
  'team' => null,
25
  'player' => null,
26
  'initial' => true,
27
+ 'caption_tag' => 'caption',
28
  'show_all_events_link' => false,
29
  'override_global_date' => false,
30
  );
115
  $calendar_caption = _x('%1$s %2$s', 'calendar caption', 'sportspress');
116
  $calendar_output = '
117
  <div class="sp-calendar-wrapper">
118
+ <table id="wp-calendar" class="sp-calendar sp-event-calendar sp-data-table">
119
  <caption class="sp-table-caption">' . ( $caption_tag == 'caption' ? '' : '<' . $caption_tag . '>' ) . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . ( $caption_tag == 'caption' ? '' : '</' . $caption_tag . '>' ) . '</caption>
120
  <thead>
121
  <tr>';
140
  <tr>';
141
 
142
  if ( $previous ) {
143
+ $calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="sp-previous-month"><a data-tooltip data-options="disable_for_touch:true" class="has-tooltip tip-right" href="' . add_query_arg( array( 'sp_year' => $previous->year, 'sp_month' => $previous->month ) ) . '" title="' . esc_attr( sprintf(_x('%1$s %2$s', 'calendar caption', 'sportspress'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year)))) . '">&laquo; ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
144
  } else {
145
  $calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
146
  }
148
  $calendar_output .= "\n\t\t".'<td class="pad">&nbsp;</td>';
149
 
150
  if ( $next ) {
151
+ $calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="sp-next-month"><a data-tooltip data-options="disable_for_touch:true" class="has-tooltip tip-left" href="' . add_query_arg( array( 'sp_year' => $next->year, 'sp_month' => $next->month ) ) . '" title="' . esc_attr( sprintf(_x('%1$s %2$s', 'calendar caption', 'sportspress'), $wp_locale->get_month($next->month), date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) ) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' &raquo;</a></td>';
152
  } else {
153
  $calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
154
  }
214
  $newrow = false;
215
 
216
  if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) )
217
+ $calendar_output .= '<td id="today" class="sp-highlight">';
218
  else
219
  $calendar_output .= '<td>';
220
 
templates/event-fixtures-results.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -17,6 +17,7 @@ $defaults = array(
17
  'league' => null,
18
  'season' => null,
19
  'team' => null,
 
20
  'number' => -1,
21
  'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
22
  'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,
@@ -42,6 +43,8 @@ if ( $season )
42
  $calendar->season = $season;
43
  if ( $team )
44
  $calendar->team = $team;
 
 
45
 
46
  $args = array(
47
  'id' => $id,
@@ -53,6 +56,7 @@ $args = array(
53
  'league' => $league,
54
  'season' => $season,
55
  'team' => $team,
 
56
  'number' => $number,
57
  'link_teams' => $link_teams,
58
  'link_events' => $link_events,
@@ -69,16 +73,32 @@ $args = array(
69
 
70
  echo '<div class="sp-fixtures-results">';
71
 
72
- echo '<div class="sp-widget-align-left">';
73
  sp_get_template( 'event-blocks.php', $args );
74
- echo '</div>';
75
 
76
  $args['title'] = __( 'Results', 'sportspress' );
77
  $args['status'] = 'publish';
78
  $args['order'] = 'DESC';
79
 
80
- echo '<div class="sp-widget-align-right">';
81
  sp_get_template( 'event-blocks.php', $args );
82
- echo '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  echo '</div>';
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
  'league' => null,
18
  'season' => null,
19
  'team' => null,
20
+ 'player' => null,
21
  'number' => -1,
22
  'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
23
  'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,
43
  $calendar->season = $season;
44
  if ( $team )
45
  $calendar->team = $team;
46
+ if ( $player )
47
+ $calendar->player = $player;
48
 
49
  $args = array(
50
  'id' => $id,
56
  'league' => $league,
57
  'season' => $season,
58
  'team' => $team,
59
+ 'player' => $player,
60
  'number' => $number,
61
  'link_teams' => $link_teams,
62
  'link_events' => $link_events,
73
 
74
  echo '<div class="sp-fixtures-results">';
75
 
76
+ ob_start();
77
  sp_get_template( 'event-blocks.php', $args );
78
+ $fixtures = ob_get_clean();
79
 
80
  $args['title'] = __( 'Results', 'sportspress' );
81
  $args['status'] = 'publish';
82
  $args['order'] = 'DESC';
83
 
84
+ ob_start();
85
  sp_get_template( 'event-blocks.php', $args );
86
+ $results = ob_get_clean();
87
+
88
+ if ( false == $fixtures || false == $results ) {
89
+
90
+ echo $fixtures;
91
+ echo $results;
92
+
93
+ } else {
94
+
95
+ echo '<div class="sp-widget-align-left">';
96
+ echo $fixtures;
97
+ echo '</div>';
98
+
99
+ echo '<div class="sp-widget-align-right">';
100
+ echo $results;
101
+ echo '</div>';
102
+ }
103
 
104
  echo '</div>';
templates/event-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -36,6 +36,8 @@ $defaults = array(
36
  'columns' => null,
37
  'show_all_events_link' => false,
38
  'show_title' => get_option( 'sportspress_event_list_show_title', 'yes' ) == 'yes' ? true : false,
 
 
39
  );
40
 
41
  extract( $defaults, EXTR_SKIP );
@@ -65,8 +67,6 @@ if ( $day != 'default' )
65
  $calendar->day = $day;
66
  $data = $calendar->data();
67
  $usecolumns = $calendar->columns;
68
- $title_format = get_option( 'sportspress_event_list_title_format', 'title' );
69
- $time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
70
 
71
  if ( isset( $columns ) ):
72
  if ( is_array( $columns ) )
@@ -98,18 +98,20 @@ endif;
98
  case 'homeaway':
99
  if ( sp_column_active( $usecolumns, 'event' ) ) {
100
  echo '<th class="data-home">' . __( 'Home', 'sportspress' ) . '</th>';
 
101
 
102
- if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
103
- echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
104
- } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
105
- echo '<th class="data-results">' . __( 'Results', 'sportspress' ) . '</th>';
106
- }
107
 
 
108
  echo '<th class="data-away">' . __( 'Away', 'sportspress' ) . '</th>';
 
109
 
110
- if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
111
- echo '<th class="data-time">' . __( 'Time', 'sportspress' ) . '</th>';
112
- }
113
  }
114
  break;
115
  default:
@@ -152,6 +154,9 @@ endif;
152
 
153
  if ( sp_column_active( $usecolumns, 'article' ) )
154
  echo '<th class="data-article">' . __( 'Article', 'sportspress' ) . '</th>';
 
 
 
155
  ?>
156
  </tr>
157
  </thead>
@@ -171,17 +176,27 @@ endif;
171
  $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );
172
 
173
  $teams_output = '';
 
174
  $teams_array = array();
175
  $team_logos = array();
176
 
177
  if ( $teams ):
178
- foreach ( $teams as $team ):
179
  $name = sp_get_team_name( $team, $abbreviate_teams );
180
  if ( $name ):
181
 
182
  if ( $show_team_logo ):
183
- $name = sp_get_logo( $team, 'mini' ) . ' ' . $name;
184
- $team_logos[] = sp_get_logo( $team, 'mini' );
 
 
 
 
 
 
 
 
 
185
  endif;
186
 
187
  if ( $link_teams ):
@@ -219,40 +234,42 @@ endif;
219
  case 'homeaway':
220
  if ( sp_column_active( $usecolumns, 'event' ) ) {
221
  $team = array_shift( $teams_array );
222
- echo '<td class="data-home">' . $team . '</td>';
 
223
 
224
- if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
225
- echo '<td class="data-time">';
226
- if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
227
- if ( ! empty( $main_results ) ):
228
- echo implode( ' - ', $main_results );
229
- else:
230
- echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
231
- endif;
232
- if ( $link_events ) echo '</a>';
233
- echo '</td>';
234
- } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
235
- echo '<td class="data-results">';
236
- if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
237
- if ( ! empty( $main_results ) ):
238
- echo implode( ' - ', $main_results );
239
- else:
240
- echo '-';
241
- endif;
242
- if ( $link_events ) echo '</a>';
243
- echo '</td>';
244
- }
245
 
 
246
  $team = array_shift( $teams_array );
247
- echo '<td class="data-away">' . $team . '</td>';
 
248
 
249
- if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
250
- echo '<td class="data-time">';
251
- if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
252
- echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
253
- if ( $link_events ) echo '</a>';
254
- echo '</td>';
255
- }
256
  }
257
  break;
258
  default:
@@ -376,6 +393,17 @@ endif;
376
  echo '</td>';
377
  endif;
378
 
 
 
 
 
 
 
 
 
 
 
 
379
  echo '</tr>';
380
 
381
  $i++;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
36
  'columns' => null,
37
  'show_all_events_link' => false,
38
  'show_title' => get_option( 'sportspress_event_list_show_title', 'yes' ) == 'yes' ? true : false,
39
+ 'title_format' => get_option( 'sportspress_event_list_title_format', 'title' ),
40
+ 'time_format' => get_option( 'sportspress_event_list_time_format', 'combined' ),
41
  );
42
 
43
  extract( $defaults, EXTR_SKIP );
67
  $calendar->day = $day;
68
  $data = $calendar->data();
69
  $usecolumns = $calendar->columns;
 
 
70
 
71
  if ( isset( $columns ) ):
72
  if ( is_array( $columns ) )
98
  case 'homeaway':
99
  if ( sp_column_active( $usecolumns, 'event' ) ) {
100
  echo '<th class="data-home">' . __( 'Home', 'sportspress' ) . '</th>';
101
+ }
102
 
103
+ if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
104
+ echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
105
+ } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
106
+ echo '<th class="data-results">' . __( 'Results', 'sportspress' ) . '</th>';
107
+ }
108
 
109
+ if ( sp_column_active( $usecolumns, 'event' ) ) {
110
  echo '<th class="data-away">' . __( 'Away', 'sportspress' ) . '</th>';
111
+ }
112
 
113
+ if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
114
+ echo '<th class="data-time">' . __( 'Time', 'sportspress' ) . '</th>';
 
115
  }
116
  break;
117
  default:
154
 
155
  if ( sp_column_active( $usecolumns, 'article' ) )
156
  echo '<th class="data-article">' . __( 'Article', 'sportspress' ) . '</th>';
157
+
158
+ if ( sp_column_active( $usecolumns, 'day' ) )
159
+ echo '<th class="data-day">' . __( 'Match Day', 'sportspress' ) . '</th>';
160
  ?>
161
  </tr>
162
  </thead>
176
  $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );
177
 
178
  $teams_output = '';
179
+ $team_class = '';
180
  $teams_array = array();
181
  $team_logos = array();
182
 
183
  if ( $teams ):
184
+ foreach ( $teams as $t => $team ):
185
  $name = sp_get_team_name( $team, $abbreviate_teams );
186
  if ( $name ):
187
 
188
  if ( $show_team_logo ):
189
+ if ( has_post_thumbnail( $team ) ):
190
+ $logo = '<span class="team-logo">' . sp_get_logo( $team, 'mini' ) . '</span>';
191
+ $team_logos[] = $logo;
192
+ $team_class .= ' has-logo';
193
+
194
+ if ( $t ):
195
+ $name = $logo . ' ' . $name;
196
+ else:
197
+ $name .= ' ' . $logo;
198
+ endif;
199
+ endif;
200
  endif;
201
 
202
  if ( $link_teams ):
234
  case 'homeaway':
235
  if ( sp_column_active( $usecolumns, 'event' ) ) {
236
  $team = array_shift( $teams_array );
237
+ echo '<td class="data-home' . $team_class . '">' . $team . '</td>';
238
+ }
239
 
240
+ if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
241
+ echo '<td class="data-time">';
242
+ if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
243
+ if ( ! empty( $main_results ) ):
244
+ echo implode( ' - ', $main_results );
245
+ else:
246
+ echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
247
+ endif;
248
+ if ( $link_events ) echo '</a>';
249
+ echo '</td>';
250
+ } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
251
+ echo '<td class="data-results">';
252
+ if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
253
+ if ( ! empty( $main_results ) ):
254
+ echo implode( ' - ', $main_results );
255
+ else:
256
+ echo '-';
257
+ endif;
258
+ if ( $link_events ) echo '</a>';
259
+ echo '</td>';
260
+ }
261
 
262
+ if ( sp_column_active( $usecolumns, 'event' ) ) {
263
  $team = array_shift( $teams_array );
264
+ echo '<td class="data-away' . $team_class . '">' . $team . '</td>';
265
+ }
266
 
267
+ if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
268
+ echo '<td class="data-time">';
269
+ if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
270
+ echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
271
+ if ( $link_events ) echo '</a>';
272
+ echo '</td>';
 
273
  }
274
  break;
275
  default:
393
  echo '</td>';
394
  endif;
395
 
396
+ if ( sp_column_active( $usecolumns, 'day' ) ):
397
+ echo '<td class="data-day">';
398
+ $day = get_post_meta( $event->ID, 'sp_day', true );
399
+ if ( '' == $day ) {
400
+ echo '-';
401
+ } else {
402
+ echo $day;
403
+ }
404
+ echo '</td>';
405
+ endif;
406
+
407
  echo '</tr>';
408
 
409
  $i++;
templates/event-logos-block.php CHANGED
@@ -4,10 +4,10 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1.3
8
  */
9
  ?>
10
- <div class="sp-template sp-template-event-blocks sp-template-event-logos-block">
11
  <div class="sp-table-wrapper">
12
  <table class="sp-event-blocks sp-data-table" data-sp-rows="1">
13
  <thead><tr><th></th></tr></thead> <?php # Required for DataTables ?>
@@ -46,6 +46,8 @@
46
  <?php echo get_the_time( get_option( 'date_format' ) ); ?>
47
  </time>
48
  <?php
 
 
49
 
50
  if ( $show_time ) {
51
  ?>
@@ -53,7 +55,6 @@
53
  <?php echo '<span class="sp-result">' . apply_filters( 'sportspress_event_time', sp_get_time( $id ), $id ) . '</span>'; ?>
54
  </h5>
55
  <?php
56
- $status = __( 'Preview', 'sportspress' );
57
  }
58
 
59
  if ( $show_results && ! empty( $results ) ) {
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
  ?>
10
+ <div class="sp-template sp-template-event-logos sp-template-event-blocks sp-template-event-logos-block">
11
  <div class="sp-table-wrapper">
12
  <table class="sp-event-blocks sp-data-table" data-sp-rows="1">
13
  <thead><tr><th></th></tr></thead> <?php # Required for DataTables ?>
46
  <?php echo get_the_time( get_option( 'date_format' ) ); ?>
47
  </time>
48
  <?php
49
+
50
+ $status = __( 'Preview', 'sportspress' );
51
 
52
  if ( $show_time ) {
53
  ?>
55
  <?php echo '<span class="sp-result">' . apply_filters( 'sportspress_event_time', sp_get_time( $id ), $id ) . '</span>'; ?>
56
  </h5>
57
  <?php
 
58
  }
59
 
60
  if ( $show_results && ! empty( $results ) ) {
templates/event-logos-inline.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1
8
  */
9
 
10
  $team_logos = array();
@@ -49,7 +49,7 @@ foreach ( $teams as $team ):
49
  endforeach;
50
  $team_logos = array_filter( $team_logos );
51
  if ( ! empty( $team_logos ) ):
52
- echo '<div class="sp-template sp-template-event-logos"><div class="sp-event-logos sp-event-logos-' . sizeof( $teams ) . '">';
53
 
54
  // Assign delimiter
55
  if ( $show_time && sizeof( $teams ) <= 2 ) {
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  $team_logos = array();
49
  endforeach;
50
  $team_logos = array_filter( $team_logos );
51
  if ( ! empty( $team_logos ) ):
52
+ echo '<div class="sp-template sp-template-event-logos sp-template-event-logos-inline"><div class="sp-event-logos sp-event-logos-' . sizeof( $teams ) . '">';
53
 
54
  // Assign delimiter
55
  if ( $show_time && sizeof( $teams ) <= 2 ) {
templates/event-logos.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -13,14 +13,14 @@ if ( get_option( 'sportspress_event_show_logos', 'yes' ) === 'no' ) return;
13
  if ( ! isset( $id ) )
14
  $id = get_the_ID();
15
 
16
- $teams = get_post_meta( $id, 'sp_team' );
17
  $teams = array_filter( $teams, 'sp_filter_positive' );
18
 
19
  if ( ! $teams ) return;
20
 
21
  $layout = get_option( 'sportspress_event_logos_format', 'inline' );
22
 
23
- $show_team_names = get_option( 'sportspress_event_logos_show_team_names', 'no' ) === 'yes' ? true : false;
24
  $show_time = get_option( 'sportspress_event_logos_show_time', 'no' ) === 'yes' ? true : false;
25
  $show_results = get_option( 'sportspress_event_logos_show_results', 'no' ) === 'yes' ? true : false;
26
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
  if ( ! isset( $id ) )
14
  $id = get_the_ID();
15
 
16
+ $teams = (array) get_post_meta( $id, 'sp_team' );
17
  $teams = array_filter( $teams, 'sp_filter_positive' );
18
 
19
  if ( ! $teams ) return;
20
 
21
  $layout = get_option( 'sportspress_event_logos_format', 'inline' );
22
 
23
+ $show_team_names = get_option( 'sportspress_event_logos_show_team_names', 'yes' ) === 'yes' ? true : false;
24
  $show_time = get_option( 'sportspress_event_logos_show_time', 'no' ) === 'yes' ? true : false;
25
  $show_results = get_option( 'sportspress_event_logos_show_results', 'no' ) === 'yes' ? true : false;
26
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
templates/event-performance-table-combined.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -100,8 +100,9 @@ if ( ! isset( $class ) ) $class = null;
100
  $totals[ $key ] = $placeholder;
101
  endif;
102
 
103
- if ( 'text' !== $format ) {
104
- $totals[ $key ] += $value;
 
105
  }
106
 
107
  if ( $mode == 'values' ):
@@ -110,7 +111,7 @@ if ( ! isset( $class ) ) $class = null;
110
  $performance_id = sp_array_value( $performance_ids, $key, null );
111
  $icons = '';
112
  if ( $performance_id && has_post_thumbnail( $performance_id ) ):
113
- $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
114
  endif;
115
  echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
116
  endif;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
100
  $totals[ $key ] = $placeholder;
101
  endif;
102
 
103
+ if ( 'number' === $format ) {
104
+ $add = floatval( $value );
105
+ $totals[ $key ] += $add;
106
  }
107
 
108
  if ( $mode == 'values' ):
111
  $performance_id = sp_array_value( $performance_ids, $key, null );
112
  $icons = '';
113
  if ( $performance_id && has_post_thumbnail( $performance_id ) ):
114
+ $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', $value );
115
  endif;
116
  echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
117
  endif;
templates/event-performance-table.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -26,25 +26,25 @@ if ( ! isset( $subs ) ) $subs = array();
26
  <h4 class="sp-table-caption"><?php echo $caption; ?></h4>
27
  <?php endif; ?>
28
  <div class="sp-table-wrapper">
29
- <table class="sp-event-performance sp-data-table<?php if ( $scrollable ) { ?> sp-scrollable-table<?php } ?><?php if ( $sortable ) { ?> sp-sortable-table<?php } ?>">
30
  <thead>
31
  <tr>
32
- <?php if ( $show_players ): ?>
33
- <?php if ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) { ?>
34
- <th class="data-number">#</th>
35
- <?php } ?>
36
- <th class="data-name">
37
- <?php if ( isset( $section_label ) ) { ?>
38
- <?php echo $section_label; ?>
39
- <?php } else { ?>
40
- <?php _e( 'Player', 'sportspress' ); ?>
41
  <?php } ?>
42
- </th>
43
- <?php endif; ?>
44
- <?php if ( $mode == 'values' ): foreach ( $labels as $key => $label ): ?>
45
- <th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
46
- <?php endforeach; else: ?>
47
- <th class="sp-performance-icons">&nbsp;</th>
 
 
 
 
 
48
  <?php endif; ?>
49
  </tr>
50
  </thead>
@@ -60,7 +60,6 @@ if ( ! isset( $subs ) ) $subs = array();
60
  if ( ! $sub_id )
61
  continue;
62
  $index = sp_array_value( $sub, 'sub', 0 );
63
- $index = substr( $index, 0, strpos( $index, ' ' ) );
64
  $lineup_sub_relation[ $index ] = $sub_id;
65
  endforeach;
66
 
@@ -93,26 +92,13 @@ if ( ! isset( $subs ) ) $subs = array();
93
 
94
  if ( array_key_exists( $player_id, $lineup_sub_relation ) ):
95
  $name .= ' <span class="sub-in" title="' . get_the_title( $lineup_sub_relation[ $player_id ] ) . '">' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . '</span>';
96
- $sub = sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'sub', null );
97
- if ( $show_minutes && ! empty( $sub ) ):
98
- preg_match( '#\((.*?)\)#', $data[ $lineup_sub_relation[ $player_id ] ]['sub'], $match );
99
- if ( ! empty( $match ) && isset( $match[1] ) ):
100
- $name .= $match[1];
101
- endif;
102
- endif;
103
  elseif ( isset( $row['sub'] ) && $row['sub'] ):
104
- $name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . '</span>';
105
- if ( $show_minutes && ! empty( $row['sub'] ) ):
106
- preg_match( '#\((.*?)\)#', $row['sub'], $match );
107
- if ( ! empty( $match ) && isset( $match[1] ) ):
108
- $name .= $match[1];
109
- endif;
110
- endif;
111
  endif;
112
 
113
- echo '<td class="data-name">' . $name . '</td>';
114
-
115
- if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
116
 
117
  foreach ( $labels as $key => $label ):
118
  if ( 'name' == $key )
@@ -120,6 +106,14 @@ if ( ! isset( $subs ) ) $subs = array();
120
 
121
  $format = sp_array_value( $formats, $key, 'number' );
122
  $placeholder = sp_get_format_placeholder( $format );
 
 
 
 
 
 
 
 
123
 
124
  $value = '-';
125
  if ( $key == 'position' ):
@@ -138,7 +132,7 @@ if ( ! isset( $subs ) ) $subs = array();
138
  $positions = array_unique( $positions );
139
 
140
  if ( sizeof( $positions ) ):
141
- $value = implode( ', ', $positions );
142
  endif;
143
  else:
144
  if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
@@ -146,28 +140,36 @@ if ( ! isset( $subs ) ) $subs = array();
146
  else:
147
  $value = $placeholder;
148
  endif;
 
 
 
 
 
149
  endif;
150
- if ( ! array_key_exists( $key, $totals ) ):
151
- $totals[ $key ] = $placeholder;
152
- endif;
153
-
154
- if ( 'number' === $format ) {
155
- $totals[ $key ] += $value;
156
- }
157
 
158
  if ( $mode == 'values' ):
159
- echo '<td class="data-' . $key . '">' . $value . '</td>';
160
  elseif ( intval( $value ) && $mode == 'icons' ):
161
  $performance_id = sp_array_value( $performance_ids, $key, null );
162
  $icons = '';
163
  if ( $performance_id && has_post_thumbnail( $performance_id ) ):
164
- $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
165
  endif;
166
- echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
167
  endif;
168
  endforeach;
169
-
170
- if ( $mode == 'icons' ) echo '</td>';
 
 
 
 
 
 
 
 
 
 
171
 
172
  echo '</tr>';
173
 
@@ -189,12 +191,14 @@ if ( ! isset( $subs ) ) $subs = array();
189
  if ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) {
190
  echo '<td class="data-number">&nbsp;</td>';
191
  }
192
- echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
 
 
193
  endif;
194
 
195
  $row = sp_array_value( $data, 0, array() );
196
 
197
- if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
198
 
199
  foreach ( $labels as $key => $label ):
200
  if ( 'name' == $key )
@@ -217,9 +221,9 @@ if ( ! isset( $subs ) ) $subs = array();
217
  $performance_id = sp_array_value( $performance_ids, $key, null );
218
  $icons = '';
219
  if ( $performance_id && has_post_thumbnail( $performance_id ) ):
220
- $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
221
  endif;
222
- echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
223
  endif;
224
  endforeach;
225
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2.10
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
26
  <h4 class="sp-table-caption"><?php echo $caption; ?></h4>
27
  <?php endif; ?>
28
  <div class="sp-table-wrapper">
29
+ <table class="sp-event-performance sp-data-table<?php if ( $mode == 'values' ) { ?><?php if ( $scrollable ) { ?> sp-scrollable-table<?php } ?><?php if ( $sortable ) { ?> sp-sortable-table<?php } ?><?php } ?>">
30
  <thead>
31
  <tr>
32
+ <?php if ( $mode == 'values' ): ?>
33
+ <?php if ( $show_players ): ?>
34
+ <?php if ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) { ?>
35
+ <th class="data-number">#</th>
 
 
 
 
 
36
  <?php } ?>
37
+ <th class="data-name">
38
+ <?php if ( isset( $section_label ) ) { ?>
39
+ <?php echo $section_label; ?>
40
+ <?php } else { ?>
41
+ <?php _e( 'Player', 'sportspress' ); ?>
42
+ <?php } ?>
43
+ </th>
44
+ <?php endif; ?>
45
+ <?php foreach ( $labels as $key => $label ): ?>
46
+ <th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
47
+ <?php endforeach; ?>
48
  <?php endif; ?>
49
  </tr>
50
  </thead>
60
  if ( ! $sub_id )
61
  continue;
62
  $index = sp_array_value( $sub, 'sub', 0 );
 
63
  $lineup_sub_relation[ $index ] = $sub_id;
64
  endforeach;
65
 
92
 
93
  if ( array_key_exists( $player_id, $lineup_sub_relation ) ):
94
  $name .= ' <span class="sub-in" title="' . get_the_title( $lineup_sub_relation[ $player_id ] ) . '">' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . '</span>';
 
 
 
 
 
 
 
95
  elseif ( isset( $row['sub'] ) && $row['sub'] ):
96
+ $subbed = (int) $row['sub'];
97
+ $name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $subbed, array() ), 'number', null ) . '</span>';
 
 
 
 
 
98
  endif;
99
 
100
+ $content = '';
101
+ $position = null;
 
102
 
103
  foreach ( $labels as $key => $label ):
104
  if ( 'name' == $key )
106
 
107
  $format = sp_array_value( $formats, $key, 'number' );
108
  $placeholder = sp_get_format_placeholder( $format );
109
+
110
+ if ( ! array_key_exists( $key, $totals ) ):
111
+ $totals[ $key ] = $placeholder;
112
+ endif;
113
+
114
+ if ( 'time' === $format ):
115
+ $totals[ $key ] = '&nbsp;';
116
+ endif;
117
 
118
  $value = '-';
119
  if ( $key == 'position' ):
132
  $positions = array_unique( $positions );
133
 
134
  if ( sizeof( $positions ) ):
135
+ $value = $position = implode( ', ', $positions );
136
  endif;
137
  else:
138
  if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
140
  else:
141
  $value = $placeholder;
142
  endif;
143
+
144
+ if ( 'number' === $format ):
145
+ $add = floatval( $value );
146
+ $totals[ $key ] += $add;
147
+ endif;
148
  endif;
 
 
 
 
 
 
 
149
 
150
  if ( $mode == 'values' ):
151
+ $content .= '<td class="data-' . $key . '">' . $value . '</td>';
152
  elseif ( intval( $value ) && $mode == 'icons' ):
153
  $performance_id = sp_array_value( $performance_ids, $key, null );
154
  $icons = '';
155
  if ( $performance_id && has_post_thumbnail( $performance_id ) ):
156
+ $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', $value );
157
  endif;
158
+ $content .= apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value );
159
  endif;
160
  endforeach;
161
+
162
+ if ( isset( $position ) && $mode == 'icons' ):
163
+ $name .= ' <small class="sp-player-position">' . $position . '</small>';
164
+ endif;
165
+
166
+ echo '<td class="data-name">' . $name . '</td>';
167
+
168
+ if ( $mode == 'icons' ):
169
+ echo '<td class="sp-performance-icons">' . $content . '</td>';
170
+ else:
171
+ echo $content;
172
+ endif;
173
 
174
  echo '</tr>';
175
 
191
  if ( apply_filters( 'sportspress_event_performance_show_numbers', $show_numbers, $section ) ) {
192
  echo '<td class="data-number">&nbsp;</td>';
193
  }
194
+ if ( $mode == 'values' ):
195
+ echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
196
+ endif;
197
  endif;
198
 
199
  $row = sp_array_value( $data, 0, array() );
200
 
201
+ if ( $mode == 'icons' ) echo '<td class="sp-performance-icons" colspan="2">';
202
 
203
  foreach ( $labels as $key => $label ):
204
  if ( 'name' == $key )
221
  $performance_id = sp_array_value( $performance_ids, $key, null );
222
  $icons = '';
223
  if ( $performance_id && has_post_thumbnail( $performance_id ) ):
224
+ $icons = get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) );
225
  endif;
226
+ echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, 1 ) . $value . ' ';
227
  endif;
228
  endforeach;
229
 
templates/event-performance.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -14,7 +14,8 @@ $show_players = get_option( 'sportspress_event_show_players', 'yes' ) === 'yes'
14
  $show_staff = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;
15
  $show_total = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;
16
  $show_numbers = get_option( 'sportspress_event_show_player_numbers', 'yes' ) === 'yes' ? true : false;
17
- $show_minutes = get_option( 'sportspress_event_performance_show_minutes', 'yes' ) === 'yes' ? true : false;
 
18
  $sections = get_option( 'sportspress_event_performance_sections', -1 );
19
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
20
  $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
@@ -42,6 +43,11 @@ if ( is_array( $teams ) ):
42
  // The first row should be column labels
43
  $labels = apply_filters( 'sportspress_event_box_score_labels', $performance[0], $event, $mode );
44
 
 
 
 
 
 
45
  // Remove the first row to leave us with the actual data
46
  unset( $performance[0] );
47
 
@@ -88,6 +94,8 @@ if ( is_array( $teams ) ):
88
  }
89
  $formats[ $column->post_name ] = $format;
90
  }
 
 
91
 
92
  if ( $is_individual ) {
93
  // Combined table
@@ -133,7 +141,7 @@ if ( is_array( $teams ) ):
133
  $labels = array( array(), array() );
134
 
135
  // Add positions if applicable
136
- if ( 'yes' == get_option( 'sportspress_event_show_position', 'yes' ) ) {
137
  $labels[0]['position'] = $labels[1]['position'] = __( 'Position', 'sportspress' );
138
  }
139
 
@@ -225,7 +233,7 @@ if ( is_array( $teams ) ):
225
  'link_posts' => $link_posts,
226
  'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
227
  'primary' => 'primary' == $total ? $primary : null,
228
- 'class' => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id,
229
  ) );
230
  }
231
 
@@ -265,11 +273,11 @@ if ( is_array( $teams ) ):
265
  ) );
266
  }
267
  }
268
- }
269
 
270
- if ( $show_staff ):
271
- sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
272
- endif;
 
273
  ?>
274
  <?php
275
  }
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
  $show_staff = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;
15
  $show_total = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;
16
  $show_numbers = get_option( 'sportspress_event_show_player_numbers', 'yes' ) === 'yes' ? true : false;
17
+ $show_position = get_option( 'sportspress_event_show_position', 'yes' ) === 'yes' ? true : false;
18
+ $show_minutes = get_option( 'sportspress_event_performance_show_minutes', 'no' ) === 'yes' ? true : false;
19
  $sections = get_option( 'sportspress_event_performance_sections', -1 );
20
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
21
  $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
43
  // The first row should be column labels
44
  $labels = apply_filters( 'sportspress_event_box_score_labels', $performance[0], $event, $mode );
45
 
46
+ // Add position to labels if selected
47
+ if ( $show_position ) {
48
+ $labels = array_merge( array( 'position' => __( 'Position', 'sportspress' ) ), $labels );
49
+ }
50
+
51
  // Remove the first row to leave us with the actual data
52
  unset( $performance[0] );
53
 
94
  }
95
  $formats[ $column->post_name ] = $format;
96
  }
97
+
98
+ do_action( 'sportspress_before_event_performance' );
99
 
100
  if ( $is_individual ) {
101
  // Combined table
141
  $labels = array( array(), array() );
142
 
143
  // Add positions if applicable
144
+ if ( $show_position ) {
145
  $labels[0]['position'] = $labels[1]['position'] = __( 'Position', 'sportspress' );
146
  }
147
 
233
  'link_posts' => $link_posts,
234
  'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
235
  'primary' => 'primary' == $total ? $primary : null,
236
+ 'class' => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id,
237
  ) );
238
  }
239
 
273
  ) );
274
  }
275
  }
 
276
 
277
+ if ( $show_staff ):
278
+ sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
279
+ endif;
280
+ }
281
  ?>
282
  <?php
283
  }
templates/event-results.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -66,7 +66,7 @@ foreach( $data as $team_id => $result ):
66
 
67
  $team_name = sp_get_team_name( $team_id, $abbreviate_teams );
68
 
69
- if ( $link_teams ):
70
  $team_name = '<a href="' . get_post_permalink( $team_id ) . '">' . $team_name . '</a>';
71
  endif;
72
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2.4
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
66
 
67
  $team_name = sp_get_team_name( $team_id, $abbreviate_teams );
68
 
69
+ if ( $link_teams && sp_post_exists( $team_id ) ):
70
  $team_name = '<a href="' . get_post_permalink( $team_id ) . '">' . $team_name . '</a>';
71
  endif;
72
 
templates/player-events.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Player Events
4
+ *
5
+ * @author ThemeBoy
6
+ * @package SportsPress/Templates
7
+ * @version 2.2
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
+
12
+ if ( ! isset( $id ) )
13
+ $id = get_the_ID();
14
+
15
+ $format = get_option( 'sportspress_player_events_format', 'blocks' );
16
+ if ( 'calendar' === $format )
17
+ sp_get_template( 'event-calendar.php', array( 'player' => $id ) );
18
+ elseif ( 'list' === $format )
19
+ sp_get_template( 'event-list.php', array( 'player' => $id, 'order' => 'DESC', 'title_format' => 'homeaway', 'time_format' => 'separate', 'columns' => array( 'event', 'time', 'results' ) ) );
20
+ else
21
+ sp_get_template( 'event-fixtures-results.php', array( 'player' => $id ) );
templates/player-gallery-thumbnail.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 1.9.13
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -22,12 +22,12 @@ extract( $defaults, EXTR_SKIP );
22
 
23
  // Add player number to caption if available
24
  $player_number = get_post_meta( $id, 'sp_number', true );
25
- if ( $player_number )
26
  $caption = '<strong>' . $player_number . '</strong> ' . $caption;
27
 
28
  // Add caption tag if has caption
29
  if ( $captiontag && $caption )
30
- $caption = '<' . $captiontag . ' class="wp-caption-text gallery-caption small-3 columns' . ( $player_number ? ' has-number' : '' ) . '">' . wptexturize( $caption ) . '</' . $captiontag . '>';
31
 
32
  if ( $link_posts )
33
  $caption = '<a href="' . get_permalink( $id ) . '">' . $caption . '</a>';
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
22
 
23
  // Add player number to caption if available
24
  $player_number = get_post_meta( $id, 'sp_number', true );
25
+ if ( '' !== $player_number )
26
  $caption = '<strong>' . $player_number . '</strong> ' . $caption;
27
 
28
  // Add caption tag if has caption
29
  if ( $captiontag && $caption )
30
+ $caption = '<' . $captiontag . ' class="wp-caption-text gallery-caption small-3 columns' . ( '' !== $player_number ? ' has-number' : '' ) . '">' . wptexturize( $caption ) . '</' . $captiontag . '>';
31
 
32
  if ( $link_posts )
33
  $caption = '<a href="' . get_permalink( $id ) . '">' . $caption . '</a>';
templates/player-gallery.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 1.9.13
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -29,6 +29,12 @@ $defaults = array(
29
 
30
  extract( $defaults, EXTR_SKIP );
31
 
 
 
 
 
 
 
32
  $itemtag = tag_escape( $itemtag );
33
  $captiontag = tag_escape( $captiontag );
34
  $icontag = tag_escape( $icontag );
@@ -120,13 +126,11 @@ echo apply_filters( 'gallery_style', $gallery_style . "\n\t\t" );
120
  foreach ( $groups as $group ):
121
  $i = 0;
122
 
123
- echo '<div class="sp-template sp-template-player-gallery sp-template-gallery">';
124
-
125
- echo '<div class="sp-player-gallery-wrapper">';
126
 
127
  if ( ! empty( $group->name ) ):
128
- echo '<a name="group-' . $group->slug . '" id="group-' . $group->slug . '"></a>';
129
- echo '<' . $grouptag . ' class="player-group-name player-gallery-group-name">' . $group->name . '</' . $grouptag . '>';
130
  endif;
131
 
132
  foreach( $data as $player_id => $performance ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
@@ -136,6 +140,8 @@ echo apply_filters( 'gallery_style', $gallery_style . "\n\t\t" );
136
  $caption = get_the_title( $player_id );
137
  $caption = trim( $caption );
138
 
 
 
139
  sp_get_template( 'player-gallery-thumbnail.php', array(
140
  'id' => $player_id,
141
  'itemtag' => $itemtag,
@@ -146,11 +152,21 @@ echo apply_filters( 'gallery_style', $gallery_style . "\n\t\t" );
146
  'link_posts' => $link_posts,
147
  ) );
148
 
 
 
149
  $i++;
150
 
151
  endif; endforeach;
152
 
153
  $j++;
 
 
 
 
 
 
 
 
154
 
155
  if ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {
156
  echo '<br style="clear: both" />';
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
29
 
30
  extract( $defaults, EXTR_SKIP );
31
 
32
+ // Determine number of players to display
33
+ if ( -1 === $number ):
34
+ $number = (int) get_post_meta( $id, 'sp_number', true );
35
+ if ( $number <= 0 ) $number = -1;
36
+ endif;
37
+
38
  $itemtag = tag_escape( $itemtag );
39
  $captiontag = tag_escape( $captiontag );
40
  $icontag = tag_escape( $icontag );
126
  foreach ( $groups as $group ):
127
  $i = 0;
128
 
129
+ $gallery = '';
 
 
130
 
131
  if ( ! empty( $group->name ) ):
132
+ $gallery .= '<a name="group-' . $group->slug . '" id="group-' . $group->slug . '"></a>';
133
+ $gallery .= '<' . $grouptag . ' class="sp-gallery-group-name player-group-name player-gallery-group-name">' . $group->name . '</' . $grouptag . '>';
134
  endif;
135
 
136
  foreach( $data as $player_id => $performance ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
140
  $caption = get_the_title( $player_id );
141
  $caption = trim( $caption );
142
 
143
+ ob_start();
144
+
145
  sp_get_template( 'player-gallery-thumbnail.php', array(
146
  'id' => $player_id,
147
  'itemtag' => $itemtag,
152
  'link_posts' => $link_posts,
153
  ) );
154
 
155
+ $gallery .= ob_get_clean();
156
+
157
  $i++;
158
 
159
  endif; endforeach;
160
 
161
  $j++;
162
+
163
+ if ( $i === 0 ) continue;
164
+
165
+ echo '<div class="sp-template sp-template-player-gallery sp-template-gallery">';
166
+
167
+ echo '<div class="sp-player-gallery-wrapper sp-gallery-wrapper">';
168
+
169
+ echo $gallery;
170
 
171
  if ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {
172
  echo '<br style="clear: both" />';
templates/player-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.1.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -37,6 +37,12 @@ extract( $defaults, EXTR_SKIP );
37
  if ( isset( $performance ) )
38
  $columns = $performance;
39
 
 
 
 
 
 
 
40
  // Explode into array
41
  if ( null !== $columns && ! is_array( $columns ) )
42
  $columns = explode( ',', $columns );
@@ -92,36 +98,12 @@ else:
92
  endif;
93
 
94
  foreach ( $groups as $group ):
95
-
96
- $output .= '<div class="sp-template sp-template-player-list">';
97
-
98
- if ( ! empty( $group->name ) ):
99
- $output .= '<a name="group-' . $group->slug . '" id="group-' . $group->slug . '"></a>';
100
- $output .= '<' . $grouptag . ' class="sp-table-caption player-group-name player-list-group-name">' . $group->name . '</' . $grouptag . '>';
101
- endif;
102
-
103
- $output .= '<div class="sp-table-wrapper">' .
104
- '<table class="sp-player-list sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
105
-
106
- if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ):
107
- if ( in_array( $orderby, array( 'number', 'name' ) ) ):
108
- $output .= '<th class="data-number">#</th>';
109
- else:
110
- $output .= '<th class="data-rank">' . __( 'Rank', 'sportspress' ) . '</th>';
111
- endif;
112
- endif;
113
-
114
- foreach( $labels as $key => $label ):
115
- if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) )
116
- $output .= '<th class="data-' . $key . '">'. $label . '</th>';
117
- endforeach;
118
-
119
- $output .= '</tr>' . '</thead>' . '<tbody>';
120
-
121
  $i = 0;
122
 
123
  if ( intval( $number ) > 0 )
124
  $limit = $number;
 
 
125
 
126
  foreach( $data as $player_id => $row ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
127
 
@@ -130,14 +112,14 @@ foreach ( $groups as $group ):
130
  $name = sp_array_value( $row, 'name', null );
131
  if ( ! $name ) continue;
132
 
133
- $output .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
134
 
135
  // Rank or number
136
  if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ):
137
  if ( isset( $orderby ) && $orderby != 'number' ):
138
- $output .= '<td class="data-rank">' . ( $i + 1 ) . '</td>';
139
  else:
140
- $output .= '<td class="data-number">' . sp_array_value( $row, 'number', '&nbsp;' ) . '</td>';
141
  endif;
142
  endif;
143
 
@@ -167,7 +149,7 @@ foreach ( $groups as $group ):
167
  $name = '<a href="' . $permalink . '">' . $name . '</a>';
168
  endif;
169
 
170
- $output .= '<td class="data-name' . $name_class . '">' . $name . '</td>';
171
 
172
  if ( array_key_exists( 'team', $labels ) ):
173
  $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_team', true ) );
@@ -175,7 +157,7 @@ foreach ( $groups as $group ):
175
  if ( $link_teams && false !== get_post_status( $team ) ):
176
  $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
177
  endif;
178
- $output .= '<td class="data-team">' . $team_name . '</td>';
179
  endif;
180
 
181
  if ( array_key_exists( 'position', $labels ) ):
@@ -186,21 +168,50 @@ foreach ( $groups as $group ):
186
  $position_term = get_term_by( 'id', $position, 'sp_position', ARRAY_A );
187
  $positions = sp_array_value( $position_term, 'name', '&mdash;' );
188
  endif;
189
- $output .= '<td class="data-position">' . $positions . '</td>';
190
  endif;
191
 
192
  foreach( $labels as $key => $value ):
193
  if ( in_array( $key, array( 'number', 'name', 'team', 'position' ) ) )
194
  continue;
195
  if ( ! is_array( $columns ) || in_array( $key, $columns ) )
196
- $output .= '<td class="data-' . $key . '">' . sp_array_value( $row, $key, '&mdash;' ) . '</td>';
197
  endforeach;
198
 
199
- $output .= '</tr>';
200
 
201
  $i++;
202
 
203
  endif; endforeach;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
  $output .= '</tbody>' . '</table>' . '</div>';
206
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
37
  if ( isset( $performance ) )
38
  $columns = $performance;
39
 
40
+ // Determine number of players to display
41
+ if ( -1 === $number ):
42
+ $number = (int) get_post_meta( $id, 'sp_number', true );
43
+ if ( $number <= 0 ) $number = -1;
44
+ endif;
45
+
46
  // Explode into array
47
  if ( null !== $columns && ! is_array( $columns ) )
48
  $columns = explode( ',', $columns );
98
  endif;
99
 
100
  foreach ( $groups as $group ):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  $i = 0;
102
 
103
  if ( intval( $number ) > 0 )
104
  $limit = $number;
105
+
106
+ $tbody = '';
107
 
108
  foreach( $data as $player_id => $row ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
109
 
112
  $name = sp_array_value( $row, 'name', null );
113
  if ( ! $name ) continue;
114
 
115
+ $tbody .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
116
 
117
  // Rank or number
118
  if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ):
119
  if ( isset( $orderby ) && $orderby != 'number' ):
120
+ $tbody .= '<td class="data-rank">' . ( $i + 1 ) . '</td>';
121
  else:
122
+ $tbody .= '<td class="data-number">' . sp_array_value( $row, 'number', '&nbsp;' ) . '</td>';
123
  endif;
124
  endif;
125
 
149
  $name = '<a href="' . $permalink . '">' . $name . '</a>';
150
  endif;
151
 
152
+ $tbody .= '<td class="data-name' . $name_class . '">' . $name . '</td>';
153
 
154
  if ( array_key_exists( 'team', $labels ) ):
155
  $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_team', true ) );
157
  if ( $link_teams && false !== get_post_status( $team ) ):
158
  $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
159
  endif;
160
+ $tbody .= '<td class="data-team">' . $team_name . '</td>';
161
  endif;
162
 
163
  if ( array_key_exists( 'position', $labels ) ):
168
  $position_term = get_term_by( 'id', $position, 'sp_position', ARRAY_A );
169
  $positions = sp_array_value( $position_term, 'name', '&mdash;' );
170
  endif;
171
+ $tbody .= '<td class="data-position">' . $positions . '</td>';
172
  endif;
173
 
174
  foreach( $labels as $key => $value ):
175
  if ( in_array( $key, array( 'number', 'name', 'team', 'position' ) ) )
176
  continue;
177
  if ( ! is_array( $columns ) || in_array( $key, $columns ) )
178
+ $tbody .= '<td class="data-' . $key . '">' . sp_array_value( $row, $key, '&mdash;' ) . '</td>';
179
  endforeach;
180
 
181
+ $tbody .= '</tr>';
182
 
183
  $i++;
184
 
185
  endif; endforeach;
186
+
187
+ if ( $i === 0 ) continue;
188
+
189
+ $output .= '<div class="sp-template sp-template-player-list">';
190
+
191
+ if ( ! empty( $group->name ) ):
192
+ $output .= '<a name="group-' . $group->slug . '" id="group-' . $group->slug . '"></a>';
193
+ $output .= '<' . $grouptag . ' class="sp-table-caption player-group-name player-list-group-name">' . $group->name . '</' . $grouptag . '>';
194
+ endif;
195
+
196
+ $output .= '<div class="sp-table-wrapper">' .
197
+ '<table class="sp-player-list sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
198
+
199
+ if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ):
200
+ if ( in_array( $orderby, array( 'number', 'name' ) ) ):
201
+ $output .= '<th class="data-number">#</th>';
202
+ else:
203
+ $output .= '<th class="data-rank">' . __( 'Rank', 'sportspress' ) . '</th>';
204
+ endif;
205
+ endif;
206
+
207
+ foreach( $labels as $key => $label ):
208
+ if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) )
209
+ $output .= '<th class="data-' . $key . '">'. $label . '</th>';
210
+ endforeach;
211
+
212
+ $output .= '</tr>' . '</thead>' . '<tbody>';
213
+
214
+ $output .= $tbody;
215
 
216
  $output .= '</tbody>' . '</table>' . '</div>';
217
 
templates/player-statistics.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -16,6 +16,7 @@ if ( ! isset( $id ) )
16
  $player = new SP_Player( $id );
17
 
18
  $scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
 
19
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
20
  $show_teams = apply_filters( 'sportspress_player_team_statistics', true );
21
  $leagues = get_the_terms( $id, 'sp_league' );
@@ -65,11 +66,13 @@ if ( is_array( $leagues ) ):
65
  sp_get_template( 'player-statistics-league.php', $args );
66
  endforeach;
67
 
68
- sp_get_template( 'player-statistics-league.php', array(
69
- 'data' => $player->data( 0, false, $section_id ),
70
- 'caption' => __( 'Career Total', 'sportspress' ),
71
- 'scrollable' => $scrollable,
72
- 'hide_teams' => true,
73
- ) );
 
 
74
  }
75
  endif;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2.4
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16
  $player = new SP_Player( $id );
17
 
18
  $scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
19
+ $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
20
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
21
  $show_teams = apply_filters( 'sportspress_player_team_statistics', true );
22
  $leagues = get_the_terms( $id, 'sp_league' );
66
  sp_get_template( 'player-statistics-league.php', $args );
67
  endforeach;
68
 
69
+ if ( $show_career_totals ) {
70
+ sp_get_template( 'player-statistics-league.php', array(
71
+ 'data' => $player->data( 0, false, $section_id ),
72
+ 'caption' => __( 'Career Total', 'sportspress' ),
73
+ 'scrollable' => $scrollable,
74
+ 'hide_teams' => true,
75
+ ) );
76
+ }
77
  }
78
  endif;
templates/team-events.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -15,5 +15,7 @@ if ( ! isset( $id ) )
15
  $format = get_option( 'sportspress_team_events_format', 'blocks' );
16
  if ( 'calendar' === $format )
17
  sp_get_template( 'event-calendar.php', array( 'team' => $id ) );
 
 
18
  else
19
  sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
  $format = get_option( 'sportspress_team_events_format', 'blocks' );
16
  if ( 'calendar' === $format )
17
  sp_get_template( 'event-calendar.php', array( 'team' => $id ) );
18
+ elseif ( 'list' === $format )
19
+ sp_get_template( 'event-list.php', array( 'team' => $id, 'order' => 'DESC', 'title_format' => 'homeaway', 'time_format' => 'separate', 'columns' => array( 'event', 'time', 'results' ) ) );
20
  else
21
  sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );
wpml-config.xml CHANGED
@@ -16,6 +16,7 @@
16
  <key name="Event Results"/>
17
  <key name="Excerpt"/>
18
  <key name="Fixtures"/>
 
19
  <key name="League Tables"/>
20
  <key name="Logos"/>
21
  <key name="Match Day"/>
16
  <key name="Event Results"/>
17
  <key name="Excerpt"/>
18
  <key name="Fixtures"/>
19
+ <key name="Full Time"/>
20
  <key name="League Tables"/>
21
  <key name="Logos"/>
22
  <key name="Match Day"/>