SportsPress – Sports Club & League Manager - Version 2.1.7

Version Description

  • Fix - Activation error on older versions of PHP.
Download this release

Release Info

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

Code changes from version 2.0.16 to 2.1.7

Files changed (85) hide show
  1. assets/css/admin.css +51 -3
  2. assets/css/menu.css +1 -1
  3. assets/css/sportspress-rtl.css +21 -0
  4. assets/css/sportspress.css +119 -1
  5. assets/js/admin/sportspress-admin.js +54 -7
  6. assets/js/sportspress.js +13 -0
  7. changelog.txt +1135 -0
  8. dummy-data/fixtures-sample.csv +6 -0
  9. includes/admin/class-sp-admin-assets.php +4 -4
  10. includes/admin/class-sp-admin-importers.php +19 -1
  11. includes/admin/class-sp-admin-notices.php +2 -2
  12. includes/admin/class-sp-admin-settings.php +8 -1
  13. includes/admin/class-sp-admin-sports.php +3 -1
  14. includes/admin/class-sp-admin-welcome.php +42 -16
  15. includes/admin/class-sp-admin.php +24 -10
  16. includes/admin/importers/class-sp-event-importer.php +2 -1
  17. includes/admin/importers/class-sp-fixture-importer.php +344 -0
  18. includes/admin/importers/class-sp-importer.php +3 -2
  19. includes/admin/post-types/class-sp-admin-cpt-event.php +8 -2
  20. includes/admin/post-types/class-sp-admin-meta-boxes.php +8 -1
  21. includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php +3 -3
  22. includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php +19 -2
  23. includes/admin/post-types/meta-boxes/class-sp-meta-box-equation.php +14 -1
  24. includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php +9 -1
  25. includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +104 -14
  26. includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php +3 -3
  27. includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php +5 -5
  28. includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php +9 -2
  29. includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-details.php +8 -2
  30. includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-equation.php +29 -0
  31. includes/admin/post-types/meta-boxes/class-sp-meta-box-player-columns.php +3 -3
  32. includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php +2 -2
  33. includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php +3 -3
  34. includes/admin/settings/class-sp-settings-events.php +127 -84
  35. includes/admin/settings/class-sp-settings-licenses.php +214 -0
  36. includes/admin/settings/class-sp-settings-modules.php +14 -5
  37. includes/admin/settings/class-sp-settings-page.php +80 -6
  38. includes/admin/settings/class-sp-settings-players.php +21 -4
  39. includes/admin/settings/class-sp-settings-staff.php +4 -3
  40. includes/admin/settings/class-sp-settings-teams.php +4 -3
  41. includes/api/class-sp-rest-api.php +71 -1
  42. includes/class-sp-ajax.php +36 -1
  43. includes/class-sp-calendar.php +40 -18
  44. includes/class-sp-event.php +75 -1
  45. includes/class-sp-install.php +17 -3
  46. includes/class-sp-player-list.php +26 -3
  47. includes/class-sp-player.php +14 -1
  48. includes/class-sp-post-types.php +29 -1
  49. includes/class-sp-team.php +1 -1
  50. includes/class-sp-template-loader.php +84 -15
  51. includes/class-sp-templates.php +16 -1
  52. includes/sp-core-functions.php +40 -6
  53. includes/sp-template-functions.php +27 -1
  54. includes/sp-template-hooks.php +23 -56
  55. includes/widgets/class-sp-widget-event-blocks.php +8 -2
  56. includes/widgets/class-sp-widget-event-calendar.php +8 -2
  57. includes/widgets/class-sp-widget-event-list.php +8 -2
  58. modules/sportspress-birthdays.php +5 -5
  59. modules/sportspress-event-status.php +125 -0
  60. modules/sportspress-icons.php +9 -4
  61. modules/sportspress-lazy-loading.php +3 -3
  62. modules/sportspress-league-tables.php +4 -3
  63. modules/sportspress-player-lists.php +4 -3
  64. modules/sportspress-tutorials.php +18 -4
  65. presets/team-sports/basketball.json +24 -21
  66. presets/team-sports/cricket.json +1 -1
  67. presets/team-sports/soccer.json +1 -1
  68. readme.txt +81 -1022
  69. sportspress.php +4 -4
  70. templates/event-blocks.php +15 -1
  71. templates/event-calendar.php +5 -2
  72. templates/event-details.php +17 -2
  73. templates/event-list.php +11 -8
  74. templates/event-logos-block.php +76 -0
  75. templates/event-logos-inline.php +63 -0
  76. templates/event-logos.php +26 -62
  77. templates/event-performance-table-combined.php +2 -2
  78. templates/event-performance-table.php +19 -4
  79. templates/event-performance.php +20 -7
  80. templates/player-details.php +71 -48
  81. templates/player-list.php +2 -2
  82. templates/player-selector.php +80 -0
  83. templates/staff-selector.php +74 -0
  84. templates/venue-map.php +3 -1
  85. wpml-config.xml +13 -0
assets/css/admin.css CHANGED
@@ -53,6 +53,27 @@
53
  content: "\f453";
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  .sp-link:before {
57
  font: normal 20px/1 dashicons;
58
  speak: none;
@@ -111,12 +132,14 @@
111
  width: 6%;
112
  }
113
 
 
114
  .post-type-sp_event .fixed .column-sp_league,
115
  .post-type-sp_calendar .fixed .column-sp_league,
116
  .post-type-sp_event .fixed .column-sp_season,
117
  .post-type-sp_calendar .fixed .column-sp_season,
118
  .post-type-sp_event .fixed .column-sp_venue,
119
  .post-type-sp_calendar .fixed .column-sp_venue,
 
120
  .post-type-sp_player .fixed .column-sp_position {
121
  width: 10%;
122
  }
@@ -639,7 +662,19 @@ table.widefat.sp-sortable-table tbody tr .icon {
639
  background-color: #00b9eb;
640
  }
641
 
 
 
 
 
 
642
  /* Sortable lists */
 
 
 
 
 
 
 
643
  .sp-sortable-list li {
644
  float: left;
645
  clear: both;
@@ -709,9 +744,7 @@ table.widefat.sp-sortable-table tbody tr .icon {
709
  }
710
 
711
  /* Modules */
712
-
713
  .sp-modules-wrapper {
714
- margin-top: 20px;
715
  margin-right: 300px;
716
  max-width: 750px;
717
  }
@@ -789,7 +822,7 @@ table.widefat.sp-sortable-table tbody tr .icon {
789
  }
790
 
791
  .sp-modules-wrapper table {
792
- margin-bottom: 20px;
793
  }
794
 
795
  table.sp-modules-table th {
@@ -848,6 +881,17 @@ table.sp-modules-table .sp-module-unavailable span .dashicons {
848
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
849
  }
850
 
 
 
 
 
 
 
 
 
 
 
 
851
  #debug-report {
852
  display: none;
853
  margin: 10px 0;
@@ -1069,6 +1113,10 @@ table.sp-status-table td mark.yes {
1069
  margin-right: 0;
1070
  width: 100%;
1071
  }
 
 
 
 
1072
  }
1073
 
1074
  @media only screen and (max-width: 782px) {
53
  content: "\f453";
54
  }
55
 
56
+ .post-type-sp_event .sp-event-status:before {
57
+ color: #82878c;
58
+ font: 400 20px/1 dashicons;
59
+ speak: none;
60
+ display: inline-block;
61
+ padding: 0 2px 0 0;
62
+ top: 0;
63
+ left: -1px;
64
+ position: relative;
65
+ vertical-align: top;
66
+ -webkit-font-smoothing: antialiased;
67
+ -moz-osx-font-smoothing: grayscale;
68
+ text-decoration: none!important;
69
+ content: "\f469";
70
+ }
71
+
72
+ .post-type-sp_event .sp-event-status-select {
73
+ line-height: 1.5em;
74
+ margin-top: 3px;
75
+ }
76
+
77
  .sp-link:before {
78
  font: normal 20px/1 dashicons;
79
  speak: none;
132
  width: 6%;
133
  }
134
 
135
+ .post-type-sp_event .fixed .column-sp_time,
136
  .post-type-sp_event .fixed .column-sp_league,
137
  .post-type-sp_calendar .fixed .column-sp_league,
138
  .post-type-sp_event .fixed .column-sp_season,
139
  .post-type-sp_calendar .fixed .column-sp_season,
140
  .post-type-sp_event .fixed .column-sp_venue,
141
  .post-type-sp_calendar .fixed .column-sp_venue,
142
+ .post-type-sp_event .fixed .column-sp_day,
143
  .post-type-sp_player .fixed .column-sp_position {
144
  width: 10%;
145
  }
662
  background-color: #00b9eb;
663
  }
664
 
665
+ /* Tab panels */
666
+ .sp-tab-panel {
667
+ max-height: 500px;
668
+ }
669
+
670
  /* Sortable lists */
671
+ .sp-sortable-list {
672
+ margin: 0;
673
+ overflow: hidden;
674
+ padding-top: 5px;
675
+ min-height: 50px;
676
+ }
677
+
678
  .sp-sortable-list li {
679
  float: left;
680
  clear: both;
744
  }
745
 
746
  /* Modules */
 
747
  .sp-modules-wrapper {
 
748
  margin-right: 300px;
749
  max-width: 750px;
750
  }
822
  }
823
 
824
  .sp-modules-wrapper table {
825
+ margin-top: 20px;
826
  }
827
 
828
  table.sp-modules-table th {
881
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
882
  }
883
 
884
+ /* Licenses */
885
+
886
+ .sp-licenses-wrapper {
887
+ max-width: 750px;
888
+ }
889
+
890
+ .sp-licenses-table th,
891
+ .sp-licenses-table input {
892
+ vertical-align: middle;
893
+ }
894
+
895
  #debug-report {
896
  display: none;
897
  margin: 10px 0;
1113
  margin-right: 0;
1114
  width: 100%;
1115
  }
1116
+
1117
+ .sp-tab-panel {
1118
+ max-height: 200px;
1119
+ }
1120
  }
1121
 
1122
  @media only screen and (max-width: 782px) {
assets/css/menu.css CHANGED
@@ -124,7 +124,7 @@
124
  .sp-icon-statistics:before {
125
  content: "\f489";
126
  }
127
- .sp-icon-stopwatch:before {
128
  content: "\f469";
129
  }
130
  .sp-icon-ticket:before {
124
  .sp-icon-statistics:before {
125
  content: "\f489";
126
  }
127
+ .sp-icon-time:before {
128
  content: "\f469";
129
  }
130
  .sp-icon-ticket:before {
assets/css/sportspress-rtl.css CHANGED
@@ -8,6 +8,11 @@
8
  margin-left: 2em;
9
  }
10
 
 
 
 
 
 
11
  /* Data Tables */
12
  .sp-data-table .data-name {
13
  text-align: right;
@@ -47,6 +52,22 @@
47
  padding-right: 0;
48
  padding-left: 3px;
49
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  /* Event Blocks */
52
  .sp-event-blocks .logo-odd {
8
  margin-left: 2em;
9
  }
10
 
11
+ /* Profile selector */
12
+ .sp-template-profile-selector {
13
+ text-align: left;
14
+ }
15
+
16
  /* Data Tables */
17
  .sp-data-table .data-name {
18
  text-align: right;
52
  padding-right: 0;
53
  padding-left: 3px;
54
  }
55
+ .sp-event-list .data-home {
56
+ text-align: left;
57
+ }
58
+ .sp-event-list .data-away {
59
+ text-align: right;
60
+ }
61
+ .sp-event-list .data-home img {
62
+ float: left;
63
+ margin-left: 0;
64
+ margin-right: 8px;
65
+ }
66
+ .sp-event-list .data-away img {
67
+ float: right;
68
+ margin-right: 0;
69
+ margin-left: 8px;
70
+ }
71
 
72
  /* Event Blocks */
73
  .sp-event-blocks .logo-odd {
assets/css/sportspress.css CHANGED
@@ -23,6 +23,10 @@
23
  .sp-template {
24
  margin-bottom: 1.5em;
25
  }
 
 
 
 
26
  .sp-template-logo,
27
  .sp-template-photo {
28
  float: left;
@@ -40,6 +44,43 @@
40
  overflow: hidden;
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  /* Data Tables */
44
  .sp-scrollable-table-wrapper {
45
  width: 100%;
@@ -180,6 +221,7 @@
180
  /* Event Logos */
181
  .sp-event-logos a {
182
  text-decoration: none;
 
183
  }
184
 
185
  .sp-event-logos img {
@@ -278,12 +320,30 @@
278
  .sp-event-list .data-results {
279
  white-space: nowrap;
280
  }
281
- .sp-event-list .data-teams img,
 
 
 
 
 
282
  .sp-event-list .data-home img,
283
  .sp-event-list .data-away img {
284
  display: inline-block;
285
  vertical-align: middle;
286
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
287
 
288
  /* Event Blocks */
289
  .sp-event-blocks thead {
@@ -333,6 +393,30 @@
333
  clear: both;
334
  }
335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  /* Countdowns */
337
  .sp-template-countdown .event-name {
338
  clear: both;
@@ -456,4 +540,38 @@
456
  .sp-template-photo + .sp-post-content {
457
  clear: none;
458
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
  }
23
  .sp-template {
24
  margin-bottom: 1.5em;
25
  }
26
+ .sp-template-profile-selector {
27
+ clear: both;
28
+ overflow: hidden;
29
+ }
30
  .sp-template-logo,
31
  .sp-template-photo {
32
  float: left;
44
  overflow: hidden;
45
  }
46
 
47
+ /* Tabs */
48
+ .sp-tab-menu {
49
+ display: block;
50
+ clear: both;
51
+ padding: 0 5px;
52
+ margin: 0 0 1.5em;
53
+ list-style: none;
54
+ }
55
+ .sp-tab-menu-item {
56
+ display: inline-block;
57
+ margin: 0;
58
+ }
59
+ .sp-tab-menu-item a {
60
+ display: block;
61
+ margin: 0 10px;
62
+ color: inherit;
63
+ opacity: 0.5;
64
+ transition: all .3s;
65
+ }
66
+ .sp-tab-menu-item a:focus {
67
+ outline: none;
68
+ }
69
+ .sp-tab-menu-item-active a,
70
+ .sp-tab-menu-item a:hover {
71
+ color: inherit;
72
+ opacity: 1;
73
+ }
74
+ .sp-tab-content {
75
+ display: none;
76
+ }
77
+
78
+ /* Profile selector */
79
+ .sp-template-profile-selector {
80
+ text-align: right;
81
+ margin-bottom: 0.5em;
82
+ }
83
+
84
  /* Data Tables */
85
  .sp-scrollable-table-wrapper {
86
  width: 100%;
221
  /* Event Logos */
222
  .sp-event-logos a {
223
  text-decoration: none;
224
+ color: inherit;
225
  }
226
 
227
  .sp-event-logos img {
320
  .sp-event-list .data-results {
321
  white-space: nowrap;
322
  }
323
+ .sp-event-list .data-home {
324
+ text-align: right;
325
+ }
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 {
343
+ text-align: center;
344
+ padding-left: 1em;
345
+ padding-right: 1em;
346
+ }
347
 
348
  /* Event Blocks */
349
  .sp-event-blocks thead {
393
  clear: both;
394
  }
395
 
396
+ /* Event Logos Block */
397
+ .sp-template-event-logos-block .team-logo {
398
+ float: none;
399
+ max-width: none;
400
+ width: 100%;
401
+ height: auto;
402
+ color: inherit;
403
+ }
404
+
405
+ .sp-template-event-logos-block .team-logo img {
406
+ vertical-align: middle;
407
+ }
408
+
409
+ .sp-template-event-logos-block .sp-team-name {
410
+ display: block;
411
+ clear: both;
412
+ vertical-align: middle;
413
+ font-size: 28px;
414
+ }
415
+
416
+ .sp-template-event-logos-block .sp-event-results {
417
+ font-size: 36px;
418
+ }
419
+
420
  /* Countdowns */
421
  .sp-template-countdown .event-name {
422
  clear: both;
540
  .sp-template-photo + .sp-post-content {
541
  clear: none;
542
  }
543
+
544
+ .sp-template-event-logos-block .team-logo {
545
+ width: 33%;
546
+ white-space: nowrap;
547
+ overflow: hidden;
548
+ text-overflow: ellipsis;
549
+ }
550
+
551
+ .sp-template-event-logos-block .team-logo img {
552
+ height: 100px;
553
+ }
554
+
555
+ .sp-template-event-logos-block .logo-odd {
556
+ text-align: left;
557
+ float: left;
558
+ }
559
+
560
+ .sp-template-event-logos-block .logo-even {
561
+ text-align: right;
562
+ float: right;
563
+ }
564
+
565
+ .sp-template-event-logos-block .logo-odd img {
566
+ margin-right: 10px;
567
+ }
568
+
569
+ .sp-template-event-logos-block .logo-even img {
570
+ margin-left: 10px;
571
+ }
572
+
573
+ .sp-template-event-logos-block .sp-team-name {
574
+ display: inline;
575
+ clear: none;
576
+ }
577
  }
assets/js/admin/sportspress-admin.js CHANGED
@@ -50,7 +50,7 @@ jQuery(document).ready(function($){
50
 
51
  // Tab switcher
52
  $(".sp-tab-panel").siblings(".sp-tab-bar").find("a").click(function() {
53
- $(this).closest("li").removeClass("wp-tab").addClass("wp-tab-active").siblings().removeClass("wp-tab-active").addClass("wp-tab").closest(".wp-tab-bar").siblings($(this).attr("href")).show().trigger('checkCheck').siblings(".wp-tab-panel").hide();
54
  return false;
55
  });
56
 
@@ -220,7 +220,7 @@ jQuery(document).ready(function($){
220
  if(event.keyCode == 40){
221
  row += 1;
222
  }
223
- $el.closest("tbody").find("tr:nth-child("+row+") td:nth-child("+col+") input:text").focus();
224
  }
225
  });
226
 
@@ -315,7 +315,8 @@ jQuery(document).ready(function($){
315
  // Sortable lists
316
  $( ".sp-sortable-list" ).sortable({
317
  handle: ".sp-item-handle",
318
- placeholder: "sp-item-placeholder"
 
319
  });
320
 
321
  // Autosave
@@ -364,7 +365,7 @@ jQuery(document).ready(function($){
364
  $(".sp-format-selector select:first").change(function() {
365
 
366
  $precisionselector = $(".sp-precision-selector input:first");
367
- $equationselector = $(".sp-equation-selector select");
368
 
369
  // Precision settings
370
  if($(this).val() == "decimal" || $(this).val() == "time") {
@@ -374,10 +375,10 @@ jQuery(document).ready(function($){
374
  }
375
 
376
  // Equation settings
377
- if($(this).val() == "custom") {
378
- $equationselector.prop( "disabled", true );
379
  } else {
380
- $equationselector.prop( "disabled", false );
381
  }
382
 
383
  });
@@ -385,6 +386,23 @@ jQuery(document).ready(function($){
385
  // Trigger format selector
386
  $(".sp-format-selector select:first").change();
387
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  // Status selector
389
  $(".sp-status-selector select:first-child").change(function() {
390
 
@@ -774,4 +792,33 @@ jQuery(document).ready(function($){
774
  }
775
  });
776
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
  });
50
 
51
  // Tab switcher
52
  $(".sp-tab-panel").siblings(".sp-tab-bar").find("a").click(function() {
53
+ $(this).closest("li").addClass("tabs").siblings().removeClass("tabs").closest(".sp-tab-bar").siblings($(this).attr("href")).show().trigger('checkCheck').siblings(".sp-tab-panel").hide();
54
  return false;
55
  });
56
 
220
  if(event.keyCode == 40){
221
  row += 1;
222
  }
223
+ $el.closest("tbody").find("tr:nth-child("+row+") td:nth-child("+col+") input:text").first().focus();
224
  }
225
  });
226
 
315
  // Sortable lists
316
  $( ".sp-sortable-list" ).sortable({
317
  handle: ".sp-item-handle",
318
+ placeholder: "sp-item-placeholder",
319
+ connectWith: ".sp-connected-list"
320
  });
321
 
322
  // Autosave
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") {
375
  }
376
 
377
  // Equation settings
378
+ if($(this).val() == "equation") {
379
+ $equationdiv.show();
380
  } else {
381
+ $equationdiv.hide();
382
  }
383
 
384
  });
386
  // Trigger format selector
387
  $(".sp-format-selector select:first").change();
388
 
389
+ // Team era selector
390
+ $(".sp-team-era-selector select:first-child").change(function() {
391
+
392
+ $subselector = $(this).siblings();
393
+
394
+ // Sub settings
395
+ if($(this).val() == 0) {
396
+ $subselector.hide();
397
+ } else {
398
+ $subselector.show();
399
+ }
400
+
401
+ });
402
+
403
+ // Trigger team era selector
404
+ $(".sp-team-era-selector select:first-child").change();
405
+
406
  // Status selector
407
  $(".sp-status-selector select:first-child").change(function() {
408
 
792
  }
793
  });
794
  });
795
+
796
+ // Event status selector
797
+ $('.sp-edit-event-status').click(function(e) {
798
+ e.preventDefault();
799
+ $select = $(this).siblings('.sp-event-status-select');
800
+ if ( $select.is(':hidden') ) {
801
+ $select.slideDown( 'fast', function() {
802
+ $select.find( 'input[type="radio"]' ).first().focus();
803
+ } );
804
+ $(this).hide();
805
+ }
806
+ });
807
+
808
+ $('.sp-save-event-status').click(function(e) {
809
+ e.preventDefault();
810
+ $select = $(this).closest('.sp-event-status-select');
811
+ $input = $select.find('input[name=sp_status]:checked');
812
+ val = $input.val();
813
+ label = $input.data('sp-event-status');
814
+ $select.slideUp('fast').siblings('.sp-edit-event-status').show().siblings('.sp-event-status').find('.sp-event-status-display').data('sp-event-status', val).html(label);
815
+ });
816
+
817
+ $('.sp-cancel-event-status').click(function(e) {
818
+ e.preventDefault();
819
+ $select = $(this).closest('.sp-event-status-select');
820
+ val = $select.siblings('.sp-event-status').find('.sp-event-status-display').data('sp-event-status');
821
+ $select.find('input[value='+val+']').attr('checked', true);
822
+ $select.slideUp('fast').siblings('.sp-edit-event-status').show();
823
+ });
824
  });
assets/js/sportspress.js CHANGED
@@ -78,5 +78,18 @@ function sp_viewport() {
78
 
79
  /* Scrollable Tables */
80
  $(".sp-scrollable-table").wrap("<div class=\"sp-scrollable-table-wrapper\"></div>");
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  })(jQuery);
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);
changelog.txt ADDED
@@ -0,0 +1,1135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.
6
+ * Tweak - Automatically align home and away columns in event lists.
7
+ * Fix - Box score minutes display issue.
8
+
9
+ = 2.1 =
10
+ * Feature - New simplified fixtures importer compatible with [LeagueLobster](http://tboy.co/leaguelobster).
11
+ * Feature - Add match day field to events.
12
+ * Feature - Add box score minutes to events.
13
+ * Feature - Add option to display full time in event details.
14
+ * Feature - Add inline and block option to event logos.
15
+ * Feature - Add squad number and name option to player details.
16
+ * Feature - Add tab options to layout designer.
17
+ * Feature - Add option to display player and staff dropdowns in profiles.
18
+ * Feature - Add option to select TBA, postponed, and cancelled event status.
19
+ * Feature - Licenses tab for third-party extensions.
20
+ * Tweak - Get player data only when needed.
21
+ * Tweak - Add capabilities to taxonomies.
22
+ * Tweak - Display tutorials in main menu if user role is not admin or league manager.
23
+ * Tweak - Use contextual strings for featured images.
24
+ * Tweak - Enable meta query vars in REST API.
25
+ * Tweak - Adopt new tab class names in admin.
26
+ * Tweak - Inherit text color for event logo team text.
27
+ * Tweak - New developers section on modules page with link to join [Slack community](http://tboy.co/slack).
28
+ * Fix - Taxonomy links appearing in admin for users that can't edit events.
29
+ * Fix - Debug error on non-standard admin pages.
30
+ * Fix - REST API notice in Jetpack.
31
+
32
+ = 2.0.16 =
33
+ * Tweak - Add shortcode parameter to override global date in event calendar.
34
+
35
+ = 2.0.15 =
36
+ * Fix - Subversion issues.
37
+
38
+ = 2.0.14 =
39
+ * Fix - Use search mode in maps to prevent invalid parameter error.
40
+
41
+ = 2.0.13 =
42
+ * Fix - Google Maps embed code to reflect selected map type.
43
+ * Fix - Countdown error when teams are not selected.
44
+
45
+ = 2.0.12 =
46
+ * Tweak - Add API key to Google Maps in admin.
47
+
48
+ = 2.0.11 =
49
+ * Tweak - Embed code to reflect change in Google Maps API.
50
+
51
+ = 2.0.10 =
52
+ * Tweak - Enable sortable tables on all devices.
53
+
54
+ = 2.0.9 =
55
+ * Feature - Display admin notice when user is not allowed to edit an item.
56
+
57
+ = 2.0.8 =
58
+ * Feature - Add shortcode parameter to filter event calendars by player.
59
+ * Feature - Add text options to change age and birthday labels.
60
+
61
+ = 2.0.7 =
62
+ * Feature - Add option to show or hide logos or photos in event blocks.
63
+ * Tweak - Combine reverse teams option for results and box score.
64
+ * Fix - Add filter to template output for extensions.
65
+
66
+ = 2.0.6 =
67
+ * Tweak - Display squad numbers in defense section.
68
+ * Tweak - Display shared values in both offense and defense sections and sync when editing event.
69
+
70
+ = 2.0.5 =
71
+ * Fix - Hide team column in player statistics for player-vs-player sports.
72
+
73
+ = 2.0.4 =
74
+ * Fix - Title generator in event importer.
75
+
76
+ = 2.0.3 =
77
+ * Tweak - Restore career total tables in player profiles.
78
+ * Fix - Display sport and timezone selector after first installation.
79
+
80
+ = 2.0.2 =
81
+ * Fix - New events not saving with automatic titles when title is empty.
82
+ * Fix - Event importer not importing new events.
83
+
84
+ = 2.0.1 =
85
+ * Fix - Some player statistics calculating as zero.
86
+
87
+ = 2.0 =
88
+ * Feature - Integration with [WP REST API](https://wordpress.org/plugins/rest-api/) by adding endpoints for viewing, creating, editing, and deleting SportsPress data.
89
+ * Feature - New drag-and-drop layout designer for customizing events, teams, players, and staff pages.
90
+ * Feature - Allow player biography to float next to photo in profile.
91
+ * Feature - Add option to display separate offensive and defensive statistics in player profiles.
92
+ * Feature - Add option to display career totals as a footer row in player statistics tables.
93
+ * Feature - Add option to display event calendar or fixtures & results on team pages.
94
+ * Feature - Add option to display time in event logos section when results are not ready.
95
+ * Feature - Add global visibility settings to player statistic columns.
96
+ * Feature - Add team, competition, league, and venue filter to event calendar, event list, and event blocks shortcodes.
97
+ * Feature - Automatically re-order competitions, seasons, venues, positions, and jobs by slug.
98
+ * Feature - New welcome page outlining notable changes to major plugin version.
99
+ * Refactor - Change parameter for sp_get_next_event function to allow custom templating.
100
+ * Tweak - Reverse team order also applies to admin.
101
+ * Tweak - Hide squad number from defense box score.
102
+ * Tweak - Use more compact labeling in player columns admin meta box.
103
+ * Tweak - Update modules page to reflect new premium scoreboard module.
104
+ * Tweak - Remove hardcoded protocol for calls to Google Maps scripts.
105
+ * Tweak - Limit venue archives to events.
106
+ * Tweak - Float team profile next to logo on team pages.
107
+ * Tweak - Display league table and player list option in teams only when modules are active.
108
+ * Tweak - Load profile and description meta boxes as native editors instead of custom methods.
109
+ * Tweak - Load team abbreviations independent of post title filter.
110
+ * Tweak - Add z-index to make header float above other elements.
111
+ * Fix - Error when league table column has no equation.
112
+ * Fix - Error when displaying checkboxes for manual event statistics.
113
+ * Fix - Venues linking automatically in countdown widgets.
114
+ * Fix - Styling issue where countdown widgets were pushed off-screen in some themes.
115
+ * Fix - Avoid loading countdown widget if no events are available.
116
+ * Preset - Update baseball, cricket, floorball, handball, ice hockey, and softball presets.
117
+
118
+ = 1.9.20 =
119
+ * Tweak - Expand event title section for team logos in countdown widget.
120
+ * Tweak - Center align team logo images in event.
121
+ * Tweak - Add iCal feed venue name and description.
122
+ * Fix - Escape address, summary, and description in iCal feed.
123
+ * Preset - Add ties and defense/offense definition to baseball preset.
124
+ * Localization - Add West Indies to nationality options.
125
+ * Localization - Update strings.
126
+
127
+ = 1.9.19 =
128
+ * Feature - Add Birthdays module.
129
+ * Feature - Add Lazy Loading module.
130
+ * Feature - Add separate offense and defense categories to player performance and box score.
131
+ * Feature - Add format setting to player performance with the options Number and Text.
132
+ * Feature - Add option to show and hide date and time in events.
133
+ * Tweak - Improve compatibility between custom color settings and theme options.
134
+ * Tweak - Add light shade to substitute rows in box score.
135
+ * Tweak - Prevent box score section from appearing when event is set in the future.
136
+ * Fix - Display icon setting in editor.
137
+ * Fix - Empty variable button appearing in equation builder when equation is empty.
138
+ * Preset - Update cricket preset with batting and bowling categories.
139
+
140
+ = 1.9.15 =
141
+ * Tweak - Add medium crop image size to ensure gallery images are square.
142
+ * Tweak - Add shortcut icon to admin bar.
143
+ * Fix - Mobile admin table cell width.
144
+ * Fix - Tutorial tab styling.
145
+ * Localization - Update Norwegian Bokmål and Turkish translations.
146
+
147
+ = 1.9.14 =
148
+ * Fix - Error appearing on team page in some cases when there are no competitions or seasons.
149
+ * Localization - Update source language file.
150
+
151
+ = 1.9.13 =
152
+ * Feature - Add option to display positions in player lists.
153
+ * Feature - Add option to show or hide player squad number and rank column.
154
+ * Feature - Add ability to display staff members in team page.
155
+ * Feature - Unique widget option added to hide widget when same as content.
156
+ * Tweak - Get auto and manual league tables in team page.
157
+ * Tweak - Add row numbers to league table and event list.
158
+ * Tweak - Allow searching from middle of sport preset names.
159
+ * Tweak - Remove deprecated settings from admin.
160
+ * Tweak - Prevent unnecessary scrollbar from appearing under scrollable tables.
161
+ * Tweak - Add spaces between results in event blocks widget.
162
+ * Tweak - Default template positions adjusted to render main content first.
163
+ * Tweak - Adjust checkbox column padding in admin.
164
+ * Tweak - Prevent positions and jobs from automatically linking to archives.
165
+ * Tweak - Adjust capabilities to allow team managers to edit venues.
166
+ * Fix - Player gallery thumbnail size too small in some cases.
167
+ * Fix - Competitive event icon in edit screen.
168
+ * Fix - SportsPress widget icons not appearing in 4.4 admin.
169
+ * Localization - Add demoyer to translation team.
170
+ * Localization - Update Dutch translations.
171
+
172
+ = 1.9.12 =
173
+ * Tweak - Display team names and score template without logos.
174
+ * Tweak - Validate hex color input.
175
+ * Tweak - Add sp prefix to TGMPA notice to avoid conflict with other plugins.
176
+ * Fix - Empty seasons displaying in player profiles.
177
+ * Fix - Error on pages with no screen objects.
178
+ * Localization - Add Tandor, muhahmetkara, elarequi, diego.battistella, and tkausch to translation team.
179
+ * Localization - Update Polish, Tamil, German, Turkish, Spanish, Dutch, and Portuguese translations.
180
+
181
+ = 1.9.10 =
182
+ * Fix - Automatic event results calculating without player performance.
183
+ * Localization - Update Turkish translation.
184
+
185
+ = 1.9.9 =
186
+ * Feature - Enable presets to define result equations.
187
+ * Tweak - Move event logo settings to new section in admin.
188
+ * Tweak - Disable custom colors by default.
189
+ * Tweak - Display league tables and player lists as auto when not manual.
190
+ * Fix - Prevent teams containing quotes to duplicate during import.
191
+ * Fix - Enable importing with special characters in team and player names.
192
+ * Fix - Check for zero in equation denominator contained within parenthesis.
193
+ * Fix - Placeholder in admin indicating automatic result.
194
+ * Preset - Update cricket preset.
195
+ * Localization - Update Tamil translation.
196
+
197
+ = 1.9.8 =
198
+ * Feature - Option to add custom table headings to calendars, league tables, and player lists.
199
+ * Tweak - Revert automatically hiding featured images when viewing teams, players, and staff.
200
+ * Fix - Team site URL escaping links in admin.
201
+
202
+ = 1.9.7 =
203
+ * Fix - Escape text inputs in admin.
204
+ * Localization - Update German translation.
205
+
206
+ = 1.9.6 =
207
+ * Feature - Venue subset to reflect statistics from a team's home venue.
208
+ * Tweak - Use team order instead of venue to get home and away subset.
209
+ * Tweak - Allow special HTML characters in player list fields.
210
+ * Tweak - Relabel box score to scorecard.
211
+ * Fix - Player list sorting by ascending squad number.
212
+ * Localization - Add Ales70, Elmister, and chinnz25 to translation team.
213
+ * Localization - Add Tamil (India) translations.
214
+ * Localization - Update Persian, Finnish, Italian, Czech, Greek, Slovenian, and Polish translations.
215
+
216
+ = 1.9.5 =
217
+ * Fix - Streaks calculation in league tables.
218
+
219
+ = 1.9.4 =
220
+ * Feature - Add Home and Away subset options to table column equation builder.
221
+ * Tweak - Display player and team checklists in admin only when Manual mode is enabled to improve performance.
222
+ * Localization - Add mahdi12 to translation team.
223
+ * Localization - Update Persian and Polish translation.
224
+
225
+ = 1.9.3 =
226
+ * Fix - Event results skipping some players in player list.
227
+
228
+ = 1.9.2 =
229
+ * Fix - Dynamic stats not being reflected in player lists.
230
+
231
+ = 1.9.1 =
232
+ * Fix - Add up statistics from multiple competitions and seasons in player list.
233
+ * Fix - Use player metrics as default in player list.
234
+ * Localization - Update Spanish translation.
235
+
236
+ = 1.9 =
237
+ * Feature - New Icons module containing vector icon options for player performance.
238
+ * Feature - Add event results to equation builder.
239
+ * Feature - Allow different page templates to be selected for each post type.
240
+ * Feature - Add equation builder to automate event results based on player performance.
241
+ * Feature - Allow Event Managers to edit venues.
242
+ * Feature - Display post excerpts in templates.
243
+ * Feature - Hide featured image if photo or logo is displayed.
244
+ * Feature - Add default outcome condition for events with more than 2 teams.
245
+ * Feature - Add option to display competition and season in player details.
246
+ * Feature - Add Google map zoom option.
247
+ * Feature - Add national flag option to player list.
248
+ * Feature - Add competition and season filter to manually inserted calendar shortcodes.
249
+ * Refactor - Move cricket functionality to free extension.
250
+ * Tweak - Improve individual mode admin screens and functionality.
251
+ * Tweak - Add styling to default event teams template.
252
+ * Tweak - Add cell padding to admin edit table.
253
+ * Tweak - Display position column only if positions exist.
254
+ * Tweak - Display Performance as Box Score in all occurrences.
255
+ * Tweak - Simplify sample data team names.
256
+ * Tweak - Move League Table module to Teams section.
257
+ * Tweak - Display column labels for time and results in split team mode.
258
+ * Tweak - Lock variable names once published to prevent equations from breaking.
259
+ * Tweak - Rename featured image meta boxes to reflect image type.
260
+ * Tweak - Improve readability of equations in admin.
261
+ * Tweak - Trim delimiter example when limit is more than 3 teams.
262
+ * Tweak - Allow a team limit of 0 for unlimited teams per event.
263
+ * Fix - Sample data generator for individual mode.
264
+ * Fix - Overview hierarchy in individual mode.
265
+ * Fix - Event delimiter sample output.
266
+ * Fix - Error in league table when stats are empty.
267
+ * Fix - Check if teams exist in countdown.
268
+ * Preset - Add golf preset.
269
+ * Preset - Recommend sport-specific extensions for cricket, golf, and football (soccer).
270
+ * Localization - Update Greek and French translations.
271
+
272
+ = 1.8.9 =
273
+ * Feature - Enable multiple nationalities for players and staff.
274
+ * Feature - Enable multiple seasons and competitions for league tables.
275
+ * Feature - Enable multiple seasons, competitions, and positions for player lists.
276
+ * Feature - Add custom title field and widget alignment option to shortcodes.
277
+ * Feature - Add option to always increment league table position.
278
+ * Fix - Import button on admin pages.
279
+ * Fix - Update jQuery DataTables to version 1.10.8 props devilsaces.
280
+ * Localization - Group translation team by language and display stats.
281
+ * Localization - Add albpower, elgolden, mobking, wah826, iojvan, eifelstudio, deckerweb, denkuhn, green_big_frog, Flubber89, sododesign, webby1973, Laislebai, slappfiskene.no, AugustoNeto, lfrodines, GonerSTUDIO, cofeman.sl, i1m3a7n92, opticadeharo, and ViktoriaRuzhylo to translation team.
282
+ * Localization - Update Polish, Finnish, Armenian, German, Slovenian, Italian, Czech, Dutch, Spanish, Romanian, and French translations.
283
+
284
+ = 1.8.8 =
285
+ * Feature - Add option to hide player and staff details.
286
+ * Tweak - Ability to display multiple current teams in staff profile.
287
+
288
+ = 1.8.7 =
289
+ * Feature - Add custom table heading option to widgets.
290
+ * Feature - Add random sorting to player gallery.
291
+ * Feature - Add option to hide player list and league table titles.
292
+ * Feature - Add heading option to player positions.
293
+ * Tweak - Display Soccer (Association Football) as Football.
294
+ * Tweak - Flush permalinks automatically when saving modules.
295
+ * Tweak - Separate scrollable and responsive table options.
296
+ * Tweak - Display event performance icon tables in 2 columns.
297
+ * Fix - Duplicate league table captions in team page.
298
+ * Preset - Add softball preset.
299
+ * Localization - Add FollowCandyPanda to translation team.
300
+ * Localization - Update Polish, Spanish, German, Norwegian, Dutch, Finnish, Russian, Armenian, and Czech translations.
301
+
302
+ = 1.8.6 =
303
+ * Tweak - Update modules page to reflect a change in offered features.
304
+ * Fix - Team dropdowns disappearing when none found in the competition and season assigned to an event.
305
+ * Localization - Update Russian translations.
306
+
307
+ = 1.8.5 =
308
+ * Fix - Error merging option arrays.
309
+ * Localization - Add m4rsal to translation team.
310
+ * Localization - Update Polish, Spanish, German, Norwegian, Dutch, and Finnish translations.
311
+
312
+ = 1.8.4 =
313
+ * Fix - Installation screen notice related to default color scheme.
314
+ * Localization - Add vetsmi, ceyhunulas, pgbenini, paulcoppen, fernandori, wolforg, and chr86 to translation team.
315
+ * Localization - Update Dutch, Spanish, Portuguese (Brazil), French, and German translations.
316
+
317
+ = 1.8.3 =
318
+ * Tweak - Settings page styling updated.
319
+ * Tweak - New modules category added for admin-related dashboard modules.
320
+ * Fix - Widget floating issue in some themes.
321
+ * Fix - Timezones added to calendar feeds using blog timezone setting.
322
+ * Fix - Event filters generating redundant queries.
323
+ * Localization - Update Finnish, Norwegian, Turkish, Polish, Portuguese (Brazil), and Portuguese (Portugal) translations.
324
+
325
+ = 1.8.2 =
326
+ * Tweak - Make scrollable tables fill content width.
327
+ * Tweak - Improve widget alignment precision.
328
+ * Tweak - Remove paginate link default color.
329
+ * Fix - Future event post permalinks not found.
330
+
331
+ = 1.8.1 =
332
+ * Feature - Ability to display multiple widgets on one line by aligning left and right.
333
+ * Tweak - Increase league table row height only when logos are displayed.
334
+ * Fix - Taxonomy selection not displaying in admin after WordPress 4.2 update.
335
+ * Localization - Add nagashitw, jikji96, and edesl to translation team.
336
+ * Localization - Update Czech, German, Finnish, Portuguese, Korean, Italian, and Spanish translations.
337
+
338
+ = 1.8 =
339
+ * Feature - Games Behind calculation added to equation builder.
340
+ * Feature - Home Record and Away Record calculation added to equation builder.
341
+ * Feature - Add option to reverse team order in events.
342
+ * Tweak - Allow inline results editing only if user has permissions.
343
+ * Tweak - Allow underscore in equation variable names.
344
+ * Tweak - Update welcome page with free Rookie theme link.
345
+ * Tweak - Group sport presets into more descriptive categories.
346
+ * Tweak - Display module descriptions in admin.
347
+ * Tweak - Combine player and staff modules.
348
+ * Tweak - Move mode setting to event page.
349
+ * Tweak - Add option to show only top-level positions in events.
350
+ * Tweak - Change Rounding to Decimal Places for clarity.
351
+ * Tweak - Change Player Performance to Box Score.
352
+ * Tweak - Add proper editing capabilities to Team Manager role.
353
+ * Fix - Empty positions hidden in box score.
354
+ * Preset - Update baseball preset.
355
+ * Localization - Add Kosovo to countries list.
356
+ * Localization - Use standard localization functions to improve translatability.
357
+ * Localization - Update Spanish and Japanese translations.
358
+
359
+ = 1.7.7 =
360
+ * Tweak - Add option to filter teams in event by competition and season with no filter as default setting.
361
+
362
+ = 1.7.6 =
363
+ * Fix - Modules sidebar not displaying in admin.
364
+
365
+ = 1.7.5 =
366
+ * Fix - Calendars empty when no teams selected.
367
+
368
+ = 1.7.4 =
369
+ * Feature - Filter teams by competition and season on page load when editing event.
370
+ * Feature - Enable multiple team selection in calendars.
371
+ * Feature - Ability to install free starter theme from modules page.
372
+ * Tweak - Use YouTube for tutorials instead of Vimeo.
373
+ * Localization - Update Finnish, Dutch, Czech, Italian, and Polish translations.
374
+
375
+ = 1.7.3 =
376
+ * Tweak - Add option to hide/show player statistics.
377
+ * Tweak - Always load overview, widgets, and importers.
378
+ * Fix - Notice displaying in player statistics when no players available.
379
+ * Localization - Update Greek, Polish, Finnish, Dutch, and Icelandic translations.
380
+
381
+ = 1.7.2 =
382
+ * Fix - Player positions disappearing in event page.
383
+ * Fix - Individual mode automatically loading by default.
384
+ * Localization - Update Polish translation.
385
+
386
+ = 1.7.1 =
387
+ * Fix - Activation error related to server limitations.
388
+ * Localization - Update Greek translation.
389
+
390
+ = 1.7 =
391
+ * Feature - Enable multiple seasons and competitions to be selected for events, calendars, player lists, and league tables.
392
+ * Feature - Enable primary performance selection.
393
+ * Feature - Enable event result columns to be displayed automatically.
394
+ * Feature - Enable switching overview, widgets, and importers on and off via modules.
395
+ * Feature - New color scheme selector.
396
+ * Feature - New video tutorials module.
397
+ * Feature - Allow event performance tables to be split by team and by player position.
398
+ * Feature - Allow extras row to be displayed in event performance.
399
+ * Tweak - Display event venue address below map.
400
+ * Tweak - Display plugin and theme recommendations only to network admins.
401
+ * Tweak - Hide player details section if none available.
402
+ * Tweak - Link module request to form instead of email.
403
+ * Fix - Responsive table scrollbar causing horizontal page scrolling.
404
+ * Fix - Misplaced config meta boxes.
405
+ * Fix - Scrollbar appearing in countdown widget.
406
+ * Fix - Event blocks template not honoring link events setting.
407
+ * Fix - League table position calculations for tied teams.
408
+ * Fix - Filter out empty results when viewing events in admin list view.
409
+ * Fix - Invalid array issue when viewing league tables.
410
+ * Preset - Enable sport presets to define plugin options.
411
+ * Preset - Update cricket and ice hockey presets.
412
+ * Localization - Number changed to Squad Number.
413
+ * Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, Swedish, German, Russian, Greek, Portuguese, and Japanese translations.
414
+
415
+ = 1.6.1 =
416
+ * Feature - Countdown moved to module and now able to display team logos.
417
+ * Feature - Add option to show or hide event list titles.
418
+ * Tweak - Display latitude and longitude fields when adding venues.
419
+ * Fix - Calculating equations with nested parentheses.
420
+ * Fix - Minor meta box mislabeling.
421
+ * Preset - Add Lacrosse preset.
422
+ * Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, and Swedish translations.
423
+
424
+ = 1.6 =
425
+ * Feature - New modules page to quickly toggle additional features.
426
+ * Feature - Option to automatically populate player list and league table based on criteria.
427
+ * Feature - Display link to CSV importer at the top of admin list pages.
428
+ * Feature - Update jQuery dataTables to version 1.10.4.
429
+ * Feature - Wrap responsive tables via script.
430
+ * Feature - New API functions for team abbreviations.
431
+ * Feature - Enable searching team names in event edit screen.
432
+ * Refactor - Enable global setting to use plugin as team-vs-team or player-vs-player (beta).
433
+ * Refactor - Use 3-letter FIFA country codes with fallback for 2-letter codes.
434
+ * Refactor - Merge scrollable and responsive settings.
435
+ * Tweak - Make AJAX shortcodes hookable for extensions and modules.
436
+ * Tweak - Mode maps setting to events tab.
437
+ * Tweak - Highlight jobs link in admin menu when editing a job.
438
+ * Tweak - Hide theme notice from welcome pages.
439
+ * Tweak - Prepend prefix to frontend CSS selectors.
440
+ * Tweak - Change Team Results to Event Results.
441
+ * Tweak - Display result rows only for teams that have been selected.
442
+ * Fix - League table displaying zeroes when competition is selected and season is set to all.
443
+ * Fix - Notice when players don't exist in event.
444
+ * Fix - Career totals not displaying in player profiles.
445
+ * Fix - Player performance displaying rows when no team is selected.
446
+ * Fix - Events linking in countdown widget and event list when option is turned off.
447
+ * Fix - Option to hide event blocks title.
448
+ * Fix - Event logos displaying different images when teams are not selected.
449
+ * Preset - Add default labels for overtime in baseball and basketball presets.
450
+ * Preset - Add Counter-Strike: Global Offensive preset.
451
+ * Localization - Update list of countries for nationality selection.
452
+
453
+ = 1.5 =
454
+ * Feature - New inline quick result editing for events.
455
+ * Feature - Automatically detect event outcome based on user-defined conditions.
456
+ * Feature - Enable individual players to compete in events.
457
+ * Feature - Add new API functions for theme developers.
458
+ * Feature - Add event list time/results formatting options.
459
+ * Feature - Add option to display player career totals.
460
+ * Feature - Add option to display team logos in event lists.
461
+ * Feature - Add option to display venue in event blocks.
462
+ * Feature - Split iCal feed links for Apple Calendar, Google, and Outlook.
463
+ * Refactor - Move Staff to dedicated menu link.
464
+ * Refactor - Load sportspress.php template as a fallback only.
465
+ * Tweak - Add caption header to event blocks.
466
+ * Tweak - Add selector classes to event venue rows.
467
+ * Tweak - Remove line breaks after template output.
468
+ * Tweak - Disable responsive event performance when icons are shown.
469
+ * Tweak - Update default color scheme.
470
+ * Tweak - Update player gallery thumbnail markup.
471
+ * Tweak - Sort Player positions dropdown by slug.
472
+ * Tweak - Frontend styling to add margins and fix overflows.
473
+ * Fix - Countdown datetime format.
474
+ * Fix - Page slug conflict with SendPress.
475
+ * Fix - Missing sample event video link.
476
+ * Fix - iCal feed formatting when venue location is not set.
477
+ * Preset - Update presets to include automatic outcome conditions.
478
+ * Localization - Add Puerto Rico to countries list.
479
+ * Localization - Update Polish, German, Spanish, Russian, Finnish, Italian, Armenian, Greek, Dutch, Turkish, French, and Bengali translations.
480
+
481
+ = 1.4.7 =
482
+ * Feature - New staff shortcode and widget to display staff photo and details.
483
+ * Tweak - Display player photo in player details shortcode.
484
+ * Tweak - Sample event csv to reflect soccer preset.
485
+ * Fix - Saving a manual offset timezone.
486
+ * Preset - Add player positions to volleyball preset.
487
+ * Localization - Update Turkish, Italian, Polish, Finnish, and French translations.
488
+
489
+ = 1.4.6 =
490
+ * Tweak - Include all events that have results in league table calculations.
491
+ * Fix - Duplicate Jobs selector in Edit Staff page.
492
+ * Preset - Update basketball preset column priorities.
493
+ * Localization - Update Finnish, Polish, Italian, Greek, Dutch, Turkish, and Russian translations.
494
+
495
+ = 1.4.5 =
496
+ * Fix - Away team players not being displayed without players in home team.
497
+ * Fix - Primary team results always using default setting.
498
+ * Localization - Update Finnish and Spanish translations.
499
+
500
+ = 1.4.4 =
501
+ * Feature - Automatically select event venue based on home team.
502
+ * Fix - Featured images not displaying in some themes.
503
+ * Preset - New Floorball preset.
504
+ * Localization - Update Finnish and Armenian translations.
505
+
506
+ = 1.4.3 =
507
+ * Tweak - Update API functions for events and teams.
508
+ * Tweak - Update sample video links.
509
+ * Fix - Remove calendar link background color for more consistent styling.
510
+ * Localization - Update Finnish, Italian, Russian, and Spanish translations.
511
+
512
+ = 1.4.2 =
513
+ * Tweak - Remove solid color from base stylesheet to improve integration.
514
+
515
+ = 1.4.1 =
516
+ * Fix - League table positions not sorting by sort order.
517
+
518
+ = 1.4 =
519
+ * Feature - New welcome page with intro video and separate tabs.
520
+ * Feature - New iCal feeds for event calendars.
521
+ * Feature - Add date range selector to event calendars.
522
+ * Feature - Ability to insert sample data during installation.
523
+ * Feature - Assign teams same position in league table when all values are tied.
524
+ * Feature - Display time/results between home and away teams in event list.
525
+ * Feature - Theme-specific stylesheets to apply when third-party theme is active.
526
+ * Feature - Make event lists sortable.
527
+ * Feature - Add team and event logo templates.
528
+ * Feature - Add player and staff photo templates.
529
+ * Feature - Option to hide Rank column in player lists.
530
+ * Feature - Option to toggle frontend templates per post type.
531
+ * Feature - Option to use abbreviated team names.
532
+ * Feature - Option to enable comments in events articles.
533
+ * Refactor - Change label for League to Competition.
534
+ * Tweak - Bold and apply class to highlighted team name in league table.
535
+ * Tweak - Remove team from venue hierarchy in overview.
536
+ * Tweak - Admin editor styles to match WordPress 4.0 inline editor.
537
+ * Tweak - Display performance icons in admin.
538
+ * Tweak - Change default sport to Custom.
539
+ * Tweak - Display none when no team available for player.
540
+ * Tweak - Permanently delete config post types when sent to trash.
541
+ * Tweak - Add hooks to widgets, shortcodes, and templates for integration.
542
+ * Fix - Display team checkbox only once in player admin.
543
+ * Fix - CSV team importer not saving all fields.
544
+ * Preset - Adjust player positions in sport presets.
545
+ * Preset - Add Bats / Throws metric to Baseball preset.
546
+ * Preset - Add Bat brand metric to Cricket preset.
547
+ * Localization - Make Video and Current Teams translatable.
548
+ * Localization - Auto-load RTL stylesheet.
549
+ * Localization - Include only compiled languages to reduce overall size.
550
+ * Localization - Apply text options to translations.
551
+ * Localization - Update Dutch, French, Armenian, Russian, Croatian, German, Greek, Thai, Japanese, Bosnian, Turkish, Spanish, Arabic, Italian, and Polish translations.
552
+
553
+ = 1.3.2 =
554
+ * Integration - WPML compatibility.
555
+ * Feature - Option to set number of columns in player gallery.
556
+ * Tweak - Remove line break after templates.
557
+ * Tweak - Update plugin icon.
558
+ * Tweak - Update welcome screen badge.
559
+ * Tweak - Display admin menu label as Players & Staff.
560
+ * Fix - Typo in sample CSV import file.
561
+ * Fix - Apply default color scheme when left blank.
562
+ * Fix - Notices where taxonomies or posts not found.
563
+ * Localization - Update source strings.
564
+ * Localization - Update French and Dutch translations.
565
+
566
+ = 1.3.1 =
567
+ * Fix - Player list shortcode meta displayed on league table edit page.
568
+ * Localization - Update Dutch translation.
569
+
570
+ = 1.3 =
571
+ * Feature - New overview page with interactive sitemap.
572
+ * Feature - New and improved CSV import tools for bulk adding.
573
+ * Feature - New full time minutes setting in events for statistics calculation.
574
+ * Feature - New roles taxonomy for staff.
575
+ * Feature - Option to display home/away teams in event lists.
576
+ * Feature - Option to display league and season in event blocks.
577
+ * Feature - Option to choose all leagues and seasons in league table.
578
+ * Feature - Option to choose all leagues and seasons in player list.
579
+ * Feature - Choose between displaying values and icons in event player performance.
580
+ * Feature - Option to display photos in player list.
581
+ * Feature - Filter players by league and season in admin.
582
+ * Feature - Select a team to highlight in league tables.
583
+ * Feature - Display league tables in team pages.
584
+ * Feature - Display total statistics per player.
585
+ * Feature - Add team option to countdown widget.
586
+ * Feature - Add scrollable tables option.
587
+ * Feature - Ability to adjust overall table columns per team.
588
+ * Refactor - Remove individual mode in favor of upcoming hybrid.
589
+ * Refactor - Use global linking options per post type.
590
+ * Refactor - Display player position in profile.
591
+ * Tweak - Reorganize settings options.
592
+ * Tweak - Update SportsPress icon.
593
+ * Tweak - Rename widgets for better usability.
594
+ * Tweak - Add div wrappers to templates for easier targeting.
595
+ * Tweak - Show or hide admin checkboxes based on event format.
596
+ * Tweak - Make event list and blocks pagination independent.
597
+ * Tweak - Trim admin table padding.
598
+ * Tweak - Display all event performance columns by default.
599
+ * Fix - Event list results column not always displaying.
600
+ * Preset - New Rugby Union preset.
601
+ * Preset - New League of Legends preset.
602
+ * Preset - New DotA 2 preset.
603
+ * Preset - Group into traditional sports and esports.
604
+ * Preset - Add missing primary results and column priorities.
605
+ * Localization - Fix multilingual post linking.
606
+ * Localization - Thai translation by Xyteton.
607
+ * Localization - Add Xyteton, tyby94, & SilverXp to translation team.
608
+ * Localization - Update translations from Transifex.
609
+
610
+ = 1.2.8 =
611
+ * Preset - Add water polo preset.
612
+ * Localization - Add Macedonian translations.
613
+ * Localization - Update Armenian, Bulgarian, Finnish, German, Greek, Japanese, & Norwegian translations.
614
+
615
+ = 1.2.7 =
616
+ * Fix - Responsive table columns hidden when script active.
617
+ * Localization - Update Finnish & German translations.
618
+
619
+ = 1.2.6 =
620
+ * Fix - Number format rounding issue.
621
+
622
+ = 1.2.5 =
623
+ * Fix - Data calculations for values above 1000.
624
+ * Localization - Update French, Finnish, Dutch, Greek, & Armenian translations.
625
+
626
+ = 1.2.4 =
627
+ * Fix - Team URL and abbreviation not saving when adding new team.
628
+ * Localization - Update Armenian, Finnish, French, & German translations.
629
+
630
+ = 1.2.3 =
631
+ * Feature - Display event results in admin teams columns.
632
+ * Tweak - Ensure teams are in order in event results.
633
+ * Fix - Streaks calculator in league tables.
634
+ * Fix - Streaks calculator in team columns.
635
+ * Localization - Update German, Greek, & Norwegian translations.
636
+
637
+ = 1.2.2 =
638
+ * Tweak - Display link to docs instead of themes.
639
+ * Fix - Enable hide theme support notice.
640
+ * Fix - Typo in table caption classes.
641
+
642
+ = 1.2.1 =
643
+ * Feature - Enable option to display team's total player performance per event.
644
+ * Tweak - Order player gallery positions by slug.
645
+ * Tweak - Remove unused Played column setting from Player List widget.
646
+ * Fix - League Table widget columns setting independent from post setting.
647
+ * Fix - Event List widget columns setting not being applied.
648
+ * Fix - Row limits in League Table, Player List, & Event List shortcodes.
649
+ * Localization - Update Armenian, Finnish, & French translations.
650
+
651
+ = 1.2 =
652
+ * Feature - Shortcode dropdown menu added to page and post editor.
653
+ * Feature - New shortcodes added to individual player profiles.
654
+ * Tweak - Add timezone setting in place of base country.
655
+ * Localization - Update translations.
656
+
657
+ = 1.1.8 =
658
+ * Tweak - Order player list positions by slug.
659
+ * Tweak - Wrap templates with div for frontend styling.
660
+ * Fix - Date format in sample events CSV.
661
+ * Localization - Fix WPML duplicate posts.
662
+ * Localization - Update Armenian, Finnish, French, German, Norwegian, & Spanish translations.
663
+
664
+ = 1.1.7 =
665
+ * Fix - Inconsistent country code for Wales.
666
+ * Fix - Localize post date month names.
667
+ * Fix - Warning message when changing mode on welcome page.
668
+ * Localization - Update Armenian, French, Italian & Norwegian translations.
669
+
670
+ = 1.1.6 =
671
+ * Fix - Maps not loading in admin.
672
+
673
+ = 1.1.5 =
674
+ * Tweak - Wrap post content with div for easier templating.
675
+ * Localization - Update French translation.
676
+ * Localization - Update Spanish translation.
677
+
678
+ = 1.1.4 =
679
+ * Feature - Add home venue option in team admin.
680
+ * Tweak - Move editor meta boxes to bottom of post edit page.
681
+ * Tweak - Remove link to league and season archives.
682
+ * Fix - Previous and next post function in some themes.
683
+ * Fix - Duplicate team checkboxes in player.
684
+ * Preset - Add table tennis preset.
685
+ * Preset - Update ice hockey preset.
686
+
687
+ = 1.1.3 =
688
+ * Fix - Display all event result columns by default.
689
+
690
+ = 1.1.2 =
691
+ * Feature - Event outcome abbreviation for streak column.
692
+ * Fix - League table calculations for constants with 2 or more digits.
693
+ * Preset - Add ice hockey preset.
694
+ * Preset - Add volleyball preset.
695
+ * Localization - Update Armenian translation.
696
+ * Localization - Update Finnish translation.
697
+ * Localization - Update German translation.
698
+
699
+ = 1.1.1 =
700
+ * Tweak - Check if equation is attempting to divide by zero to prevent errors.
701
+ * Fix - Player statistics meta box message.
702
+ * Preset - Make baseball preset appear in dropdown.
703
+
704
+ = 1.1 =
705
+ * Feature - Enable individual sport mode.
706
+ * Feature - Enable displaying player lists on team pages.
707
+ * Feature - Enable player performance reordering in events.
708
+ * Feature - Enable changing player numbers and positions per event.
709
+ * Feature - Add date selector to display today's events and this week's events in calendar.
710
+ * Feature - Option to redirect team permalinks to official team website instead of team page.
711
+ * Feature - Display staff in event performance section.
712
+ * Feature - Add column selector to player profiles and player lists.
713
+ * Feature - Add option to show or hide player performance section in events.
714
+ * Feature - Add global padding option to SportsPress settings.
715
+ * Tweak - Force decimals to display when precision is set.
716
+ * Tweak - Add SportsPress post types to At a Glance section in dashboard.
717
+ * Tweak - Filter checklists by league and season.
718
+ * Tweak - Display layout type in admin.
719
+ * Tweak - Improve roles and permissions.
720
+ * Fix - Some select all checkboxes defaulted to being checked.
721
+ * Refactor - Use gettext filter to alter frontend text.
722
+ * Preset - Add American Football preset.
723
+ * Preset - Add Australian Rules Football preset.
724
+ * Preset - Add baseball preset.
725
+ * Preset - Add cricket preset.
726
+ * Preset - Add darts preset.
727
+ * Preset - Add handball preset.
728
+ * Preset - Add netball preset.
729
+ * Preset - Add Rugby League preset.
730
+ * Preset - Add squash preset.
731
+ * Preset - Add tennis preset.
732
+ * Preset - Update soccer preset.
733
+ * Localization - Armenian translation by ArtakEVN.
734
+ * Localization - Update translations.
735
+
736
+ = 1.0.4 =
737
+ * Fix - Shorthand php notation removed for better compatibility.
738
+ * Localization - Update Finnish translation.
739
+ * Localization - Update Greek translation.
740
+
741
+ = 1.0.3 =
742
+ * Tweak - Hide theme integration notice.
743
+
744
+ = 1.0.2 =
745
+ * Fix - Initialize columns array in player list class.
746
+
747
+ = 1.0.1 =
748
+ * Fix - Conditional install error relating to post types function.
749
+
750
+ = 1.0 =
751
+ * Feature - New drag and drop equation builder.
752
+ * Feature - Add team website link in admin.
753
+ * Feature - Enable searching for post user when there are more than 10.
754
+ * Feature - New event manager role that can publish and manage events only.
755
+ * Tweak - Fix league table alignment and responsive height.
756
+ * Tweak - Set maximum size of event blocks logos.
757
+ * Tweak - Add option to link venues in event list.
758
+ * Tweak - Remove margin between table and scrollbar.
759
+ * Tweak - Display delimiter between team logos under event title.
760
+ * Tweak - Hide media, comments, and tools from feature limited users.
761
+ * Tweak - Hide previous and next post links for custom post types.
762
+ * Tweak - Rounding explicitly displays all decimal places.
763
+ * Refactor - Combine players and staff in admin menu.
764
+ * Fix - Duplicate team logos in event blocks.
765
+ * Fix - Query future events for next team event.
766
+ * Fix - Live countdown in admin dashboard.
767
+ * Fix - Display all current teams in player profile.
768
+ * Localization - Norwegian Bokmål translation by sijo.
769
+ * Localization - Update translations.
770
+
771
+ = 0.9.4 =
772
+ * Tweak - Force delete preset variables when switching sports in settings.
773
+ * Fix - Apply player gallery limit.
774
+ * Fix - Display localized team results string.
775
+ * Refactor - Use more common thumbnail sizes.
776
+ * Localization - Portuguese (Portugal) translation by Andrew_Melim.
777
+
778
+ = 0.9.3 =
779
+ * Fix - Player list columns not displaying.
780
+
781
+ = 0.9.2 =
782
+ * Fix - Duplicate editor fields in team edit screen.
783
+
784
+ = 0.9.1 =
785
+ * Tweak - Add text domain to configure descriptions.
786
+ * Tweak - Change default country to US.
787
+ * Fix - Event block results display for teams without logos.
788
+
789
+ = 0.9 =
790
+ * Feature - Import tool added for importing staff from CSV file.
791
+ * Feature - Add checkboxes to select player statistics columns.
792
+ * Feature - Add option to select Google Map type.
793
+ * Feature - Add option to display team logos under event title.
794
+ * Feature - Enable player metrics and statistics selection in player list widget.
795
+ * Feature - Enable linking event blocks and event list to team pages.
796
+ * Tweak - Move leagues and seasons to SportsPress submenu.
797
+ * Tweak - Use singular post type slugs by default for consistency with WP core.
798
+ * Tweak - Remove alternate color in favor of link color setting.
799
+ * Tweak - Enable scrollable tables to prevent overflow.
800
+ * Tweak - Add helper text to venue location picker.
801
+ * Tweak - Adjust markup and remove link in league table caption.
802
+ * Tweak - Insert group name anchors to player list.
803
+ * Tweak - Display post type counts in system status.
804
+ * Fix - Event list results calculation when team column unchecked.
805
+ * Fix - Display player group names.
806
+ * Preset - Add snooker preset.
807
+ * Localization - Finnish translation by JuKi and hanro.
808
+ * Localization - Chinese translation by dic_2008.
809
+ * Localization - Dutch translation by valentijnreza.
810
+
811
+ = 0.8.6 =
812
+ * Fix - Issue adding teams to events.
813
+
814
+ = 0.8.5 =
815
+ * Fix - Issue saving new venues.
816
+
817
+ = 0.8.4 =
818
+ * Feature - Add option to limit number of teams per event.
819
+ * Feature - Show venue option in Countdown widget.
820
+ * Feature - Enable multiple current teams per player.
821
+ * Feature - Format performance data for use in templates.
822
+ * Feature - Add next event function to team for template.
823
+ * Refactor - Adjust theme template loader for venues and seasons.
824
+ * Tweak - Replace featured image text in admin.
825
+ * Tweak - Use wider map zoom setting.
826
+ * Tweak - Make SportsPress tables full width by default.
827
+ * Fix - Team filter in admin.
828
+ * Fix - Displaying 1 view as plural.
829
+
830
+ = 0.8.3 =
831
+ * Feature - Enable using events started and substituted in statistics equations.
832
+ * Tweak - Remove deprecated MySQL version function from System Status page.
833
+ * Fix - Adjust styling to display select boxes in admin.
834
+
835
+ = 0.8.2 =
836
+ * Fix - Add content in main loop only.
837
+
838
+ = 0.8.1 =
839
+ * Tweak - Output player statistics in system status.
840
+ * Tweak - Prepend templates to content instead of outputting directly.
841
+ * Fix - Enable metrics usage in individual player statistics.
842
+
843
+ = 0.8 =
844
+ * Feature - New shortcode event_results.
845
+ * Feature - New shortcode event_details.
846
+ * Feature - New shortcode event_performance.
847
+ * Feature - New blocks layout to display calendars in fixtures/results style.
848
+ * Feature - New player statistics calculate values using performance and metrics.
849
+ * Feature - New staff profiles.
850
+ * Feature - New System Status screen in admin.
851
+ * Feature - Add status selector to calendars and event widgets.
852
+ * Feature - Add ability to display statistics and metrics in player lists.
853
+ * Feature - Add time/results column to event list.
854
+ * Feature - Link WP user roles with players and staff.
855
+ * Feature - Display player substitutions in event page.
856
+ * Feature - Option to group player lists by position.
857
+ * Feature - Option to display outcomes in event results.
858
+ * Refactor - Player profiles now use statistics and performance.
859
+ * Refactor - Split admin CSS files for better performance.
860
+ * Tweak - Display player numbers in admin.
861
+ * Tweak - Move SportsPress settings to top-level page.
862
+ * Tweak - Link date to event page in event list.
863
+ * Tweak - Load Google Maps script only when needed.
864
+ * Tweak - Add descriptions to configure screen for clarity.
865
+ * Tweak - Create dedicated settings tab for text settings.
866
+ * Tweak - Remove redundant border from pagination table.
867
+ * Tweak - Display players and teams as total count in admin.
868
+ * Fix - Display player number when 0 or 00.
869
+ * Fix - Enable changing variable name or key from quick edit.
870
+ * Fix - Team data saving issue.
871
+ * Fix - Display all future events in venue archive.
872
+ * Fix - Display all metrics instead of filtering by position.
873
+ * Localization - Croatian translation by i__k.
874
+ * Localization - Greek translation by Spirossmil.
875
+ * Localization - Portuguese (Brazil) translation by rochester.
876
+ * Localization - Russian translation by Selskei.
877
+ * Localization - Slovenian translation by BOCo.
878
+ * Localization - Update translations.
879
+
880
+ = 0.7.4 =
881
+ * Feature - Shortcode added to display single event content.
882
+ * Tweak - Display default shortcode format when editing a calendar or player list.
883
+ * Tweak - Add backwards compatibility for shortcodes prior to version 0.7.
884
+ * Fix - Template hook to change display strings in admin.
885
+
886
+ = 0.7.3 =
887
+ * Feature - Enable editing Key field in Metrics and Performance.
888
+ * Tweak - Lighter default color scheme.
889
+
890
+ = 0.7.2 =
891
+ * Fix - Update missing assets.
892
+
893
+ = 0.7.1 =
894
+ * Fix - Activation error preventing new installation.
895
+
896
+ = 0.7 =
897
+ * Feature - Welcome page to display on activation.
898
+ * Feature - Frontend color scheme selection.
899
+ * Feature - Custom CSS option.
900
+ * Feature - Add venue column to event list.
901
+ * Feature - Manual point adjustments added to league tables.
902
+ * Feature - Enable table pagination.
903
+ * Feature - Enable live countdown setting.
904
+ * Refactor - Only load required classes to improve performance.
905
+ * Refactor - Change statistic to performance.
906
+ * Refactor - Soft deprecate sportspress prefixed functions in favor of sp prefix.
907
+ * Tweak - Filter players in events by current team.
908
+ * Tweak - Separate admin styles to improve load times.
909
+ * Tweak - Add margin above view all link in widgets.
910
+ * Tweak - Group text options by context.
911
+ * Tweak - Display event details in standard table markup for style consistency.
912
+ * Tweak - Display venue as a table for style consistency.
913
+ * Tweak - Hide individual player performance when players not selected.
914
+ * Fix - Responsive league table glitch.
915
+ * Fix - Warning messages when adding new team, player, or event.
916
+ * Fix - Countdown widget when event is selected.
917
+ * Fix - Multiple select box height glitch in some browsers fixed.
918
+ * Localization - Arabic translation by Abdulelah.
919
+ * Localization - German translation by Bhelpful2.
920
+ * Localization - Update Swedish translation by JensZ.
921
+
922
+ = 0.6.2 =
923
+ * Feature - Add options to make tables responsive and sortable.
924
+ * Feature - Use consistent shortcode naming with backwards compatibility.
925
+
926
+ = 0.6.1 =
927
+ * Feature - Display full event results on hover over main team result in admin.
928
+ * Feature - Add option to choose delimiter to use between team names in event titles.
929
+ * Tweak - Adjust text options to modify front-end only.
930
+ * Fix - Responsive league table output and styling.
931
+
932
+ = 0.6 =
933
+ * Feature - New events shortcodes: countdown, events-calendar, and events-list.
934
+ * Feature - New teams shortcode: league-table.
935
+ * Feature - New players shortcodes: player-list and player-gallery.
936
+ * Feature - Display available shortcodes in post edit screen.
937
+ * Feature - Add new settings page to change default text output.
938
+ * Feature - Add new section to permalinks settings to change post and term slugs.
939
+ * Tweak - Display teams as link list in admin page for league table teams columns.
940
+ * Tweak - Vertically align team logos in league table.
941
+ * Fix - Check if player belongs to leagues to avoid warnings in player profile.
942
+ * Fix - Total player statistics calculation in events.
943
+ * Fix - Responsive tables in event details and outcomes.
944
+ * Fix - Display players from all seasons or leagues when none have been created.
945
+
946
+ = 0.5 =
947
+ * Feature - Import tool added for importing events from CSV file.
948
+ * Feature - New post type Calendar added.
949
+ * Feature - League and Friendly format options added to events.
950
+ * Feature - List and Gallery format options added to player lists.
951
+ * Feature - Calendar and List format options added to calendars.
952
+ * Feature - Options added to turn on and off player list columns.
953
+ * Feature - Options added to player list widget to limit rows and display link to view all players.
954
+ * Feature - Options added to calendar widget to filter events.
955
+ * Feature - New widget Events List added.
956
+ * Feature - New widget Player Gallery added.
957
+ * Refactor - Use singular slugs for secondary post types.
958
+ * Tweak - Add tooltips to icons in admin table headings.
959
+ * Tweak - Style event results in admin events list.
960
+ * Tweak - Separate event date and time in admin events list.
961
+ * Fix - Enable custom post type sorting in admin.
962
+ * Fix - Added check before displaying deleted posts in league tables and player lists.
963
+ * Fix - Adjust Select All filter in player lists and league tables.
964
+
965
+ = 0.4.3 =
966
+ * Feature - Enable selecting multiple outcomes per team per event.
967
+ * Tweak - Use icons in dashboard column labels for teams and roster.
968
+ * Tweak - Mark current team with check icon in admin player table.
969
+ * Fix - Check that selected columns are in array to avoid warning.
970
+ * Localization - Add Czech translation.
971
+ * Localization - Add Slovak translation.
972
+ * Localization - Add Polish translation by karimjarro.
973
+
974
+ = 0.4.2 =
975
+ * Feature - Enable selecting columns to display in single league table.
976
+ * Feature - Add options to limit rows, display logos, and display full table link.
977
+ * Feature - Add option to display national flags in player profiles.
978
+ * Refactor - Group Players and Staff under Roster menu group.
979
+ * Tweak - Reorder default player profile content.
980
+ * Tweak - Display player number before page title instead of metrics section.
981
+ * Tweak - Display player metrics as definition list instead of table.
982
+ * Fix - Check if static player list is array to avoid warning message.
983
+
984
+ = 0.4.1 =
985
+ * Tweak - Activate checkbox when all players are added to player list.
986
+ * Fix - Function date_diff added for PHP < 5.3.
987
+ * Localization - Swedish translation by JensZ.
988
+
989
+ = 0.4 =
990
+ * Feature - SportsPress Status dashboard widget added to display number of events and countdown in admin.
991
+ * Feature - New dashboard menu icons.
992
+ * Feature - More intuitive player edit screen.
993
+ * Feature - Enable spreadsheet style keyboard navigation in admin data tables.
994
+ * Feature - Add hover action on league table team names to edit display name.
995
+ * Refactor - Remove min and max outcome options from column equation.
996
+ * Refactor - Change Rounding precision to default to 0.
997
+ * Tweak - Used jQuery Chosen for inputs where useful.
998
+ * Tweak - Prepend plugin name to widget titles.
999
+ * Tweak - Highlight settings in admin menu when adding new config post type.
1000
+ * Tweak - Display Events as Schedule in admin sidebar menu.
1001
+ * Tweak - Update widget descriptions.
1002
+ * Tweak - Remove unused external class eqGraph.
1003
+ * Tweak - Display sort order priority options for number of columns available.
1004
+ * Fix - Apply table column rounding when precision is set.
1005
+ * Fix - Display event results on events page when available.
1006
+ * Fix - Check that event results are available before displaying a warning under certain conditions.
1007
+ * Fix - Namespace eqEOS class to avoid conflict with other plugins.
1008
+ * Localization - Use specific strings instead of dynamic ones for more accurate translations.
1009
+ * Localization - Use generic strings where appropriate.
1010
+ * Localization - Update German translation.
1011
+ * Localization - Update Spanish translation.
1012
+ * Localization - Update French translation.
1013
+ * Localization - Update Italian translation.
1014
+ * Localization - Update Japanese translation.
1015
+
1016
+ = 0.3.3 =
1017
+ * Feature - Add default sorting options per player list.
1018
+ * Feature - Add option to sort player list alphabetically by name or by default.
1019
+
1020
+ = 0.3.2 =
1021
+ * Feature - Add England, Scotland, Northern Ireland, and Wales to countries selector.
1022
+ * Feature - Enable searching for countries in dropdown.
1023
+
1024
+ = 0.3.1 =
1025
+ * Feature - Import tool added for importing teams from CSV file.
1026
+ * Tweak - Added option to select custom sport and enter sport name.
1027
+ * Tweak - Display player number under photo in admin screen.
1028
+ * Tweak - Positions, Leagues, and Seasons columns added to player import tool.
1029
+ * Tweak - Styled SportsPress setup notice.
1030
+ * Refactor - Sum changed to Total in player statistic calculation settings.
1031
+
1032
+ = 0.3 =
1033
+ * Feature - Import tool added for importing players from CSV file.
1034
+ * Feature - Add ability to select
1035
+ * Tweak - Display current team indicator in players admin screen.
1036
+
1037
+ = 0.2.10 =
1038
+ * Fix - Team filtering in events, tables, players, and lists.
1039
+ * Tweak - Display statistics for all league/season events played in player profiles and player lists.
1040
+ * Tweak - Count events as played when in starting lineup or made substitution.
1041
+ * Tweak - Display player metrics only when value is set.
1042
+
1043
+ = 0.2.9 =
1044
+ * Feature - Ability to select players from all teams in player list.
1045
+ * Fix - Decimal sorting in league tables and player lists.
1046
+
1047
+ = 0.2.8 =
1048
+ * Feature - Add player list widget.
1049
+ * Localization - Add German translations.
1050
+ * Localization - Add Spanish translations.
1051
+ * Localization - Add Italian translations.
1052
+
1053
+ = 0.2.7 =
1054
+ * Feature - Select columns to display in league table widget.
1055
+ * Tweak - Start league table positions at 1 instead of 0.
1056
+
1057
+ = 0.2.6 =
1058
+ * Localization - Add French translations.
1059
+ * Preset - Update soccer preset.
1060
+
1061
+ = 0.2.5 =
1062
+ * Fix - Update deprecated function to prevent error in Player Lists.
1063
+
1064
+ = 0.2.4 =
1065
+ * Feature - Display venue map on event page and venue archive.
1066
+ * Fix - Add checks to prevent league table dividing by zero when no events have been played.
1067
+ * Fix - Flush rewrite rules for taxonomies on activation.
1068
+ * Tweak - Sort sports presets alphabetically by localized name.
1069
+
1070
+ = 0.2.3 =
1071
+ * Feature - Enable selecting main event result.
1072
+ * Feature - Add Last 5 counter to table columns.
1073
+ * Localization - Update Japanese translations.
1074
+ * Preset - Complete American Football preset.
1075
+
1076
+ = 0.2.2 =
1077
+ * Feature - League Table widget added.
1078
+ * Feature - Recent Events widget added.
1079
+ * Feature - Future Events widget added.
1080
+ * Feature - Countdown widget added.
1081
+ * Fix - Syntax error fixed for PHP version 5.2 and below.
1082
+ * Tweak - Editor section added to League Tables and Player Lists.
1083
+
1084
+ = 0.2.1 =
1085
+ * Feature - Events Calendar widget added.
1086
+ * Fix - Player settings table markup fixed.
1087
+ * Tweak - Refine custom post type capabilities for user roles.
1088
+
1089
+ = 0.2 =
1090
+ * Feature - Add option to select whether statistics are calculated as a sum or average.
1091
+ * Feature - Enable pageview tracking for posts and custom post types.
1092
+ * Feature - Responsive datatables.
1093
+ * Fix - Add site admin capabilities for multisite.
1094
+ * Fix - Force numerical sorting of number column.
1095
+ * Tweak - Enable SportsPress content functions to be called without explicit ID.
1096
+ * Tweak - Remove redundant admin menu links via filter.
1097
+
1098
+ = 0.1.7 =
1099
+ * Feature - Enable selecting venues to use uploaded images.
1100
+
1101
+ = 0.1.6 =
1102
+ * Tweak - Activate per post type permissions.
1103
+ * Tweak - Give admin all permissions for custom posts.
1104
+
1105
+ = 0.1.5 =
1106
+ * Tweak - Remove flag images to lighten download size.
1107
+
1108
+ = 0.1.4 =
1109
+ * Fix - All Plugin-Check warnings.
1110
+ * Tweak - Split templates into files in subdirectory.
1111
+ * Tweak - Simplify gettext filters.
1112
+
1113
+ = 0.1.3 =
1114
+ * Fix - Style conflict with Foundation framework in table columns.
1115
+ * Feature - HTML output added to custom post types with data table sorting.
1116
+ * Feature - Enable metrics and statistics per player position.
1117
+ * Feature - Save team played per season per league in player edit screen.
1118
+ * Feature - Give teams the option to show and hide past seasons.
1119
+ * Feature - Venues, Seasons, and Leagues added as taxonomies.
1120
+ * Feature - Add L10 counter to report last 10 outcomes.
1121
+ * Feature - Add STRK counter to report current outcome streak.
1122
+ * Localization - Add country names in Czech, German, Spanish, French, Italian, Japanese, Polish, Russian, and Slovak.
1123
+
1124
+ = 0.1.2 =
1125
+ * Tweak - Use custom post types for metrics and statistics configuration.
1126
+ * Feature - Display HTML tables when viewing League Table and Player List post types.
1127
+ * Feature - Link player and team names to single post pages.
1128
+ * Feature - Register default configuration for soccer.
1129
+ * Feature - Sort league table and player list by priority.
1130
+
1131
+ = 0.1.1 =
1132
+ * Tweak - Update description.
1133
+
1134
+ = 0.1 =
1135
+ * Alpha release for first look and testing.
dummy-data/fixtures-sample.csv ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ Date,Time,Venue,Home,Away
2
+ 2017/01/20,14:30:00,Little Park,Eagles,Sharks
3
+ 2017/01/24,16:00:00,Big Stadium,Kangaroos,Eagles
4
+ 2017/02/14,16:15:00,Little Park,Sharks,Eagles
5
+ 2017/03/05,13:00:00,Little Park,Eagles,Kangaroos
6
+ 2017/04/27,12:45:00,Big Stadium,Sharks,Kangaroos
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.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -55,7 +55,7 @@ class SP_Admin_Assets {
55
  wp_enqueue_style( 'sportspress-admin-customize-styles', SP()->plugin_url() . '/assets/css/customize.css', array(), SP_VERSION );
56
  }
57
 
58
- if ( in_array( $screen->id, array( 'sp_result', 'sp_column', 'sp_statistic' ) ) ) {
59
  wp_enqueue_style( 'sportspress-admin-equation-styles', SP()->plugin_url() . '/assets/css/equation.css', array(), SP_VERSION );
60
  }
61
 
@@ -64,7 +64,7 @@ class SP_Admin_Assets {
64
  wp_enqueue_style( 'sportspress-admin-datepicker-styles', SP()->plugin_url() . '/assets/css/datepicker.css', array( 'jquery-ui-style' ), SP_VERSION );
65
  }
66
 
67
- do_action( 'sportspress_admin_css' );
68
  }
69
 
70
  /**
@@ -136,7 +136,7 @@ class SP_Admin_Assets {
136
  }
137
 
138
  // Edit equation
139
- if ( in_array( $screen->id, array( 'sp_result', 'sp_column', 'sp_statistic' ) ) ) {
140
  wp_enqueue_script( 'sportspress-admin-equationbuilder' );
141
  }
142
  }
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
55
  wp_enqueue_style( 'sportspress-admin-customize-styles', SP()->plugin_url() . '/assets/css/customize.css', array(), SP_VERSION );
56
  }
57
 
58
+ if ( in_array( $screen->id, array( 'sp_result', 'sp_performance', 'sp_column', 'sp_statistic' ) ) ) {
59
  wp_enqueue_style( 'sportspress-admin-equation-styles', SP()->plugin_url() . '/assets/css/equation.css', array(), SP_VERSION );
60
  }
61
 
64
  wp_enqueue_style( 'sportspress-admin-datepicker-styles', SP()->plugin_url() . '/assets/css/datepicker.css', array( 'jquery-ui-style' ), SP_VERSION );
65
  }
66
 
67
+ do_action( 'sportspress_admin_css', $screen );
68
  }
69
 
70
  /**
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
  }
includes/admin/class-sp-admin-importers.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -34,6 +34,11 @@ class SP_Admin_Importers {
34
  'description' => __( 'Import <strong>events</strong> from a csv file.', 'sportspress'),
35
  'callback' => array( $this, 'events_importer' ),
36
  ),
 
 
 
 
 
37
  'sp_team_csv' => array(
38
  'name' => __( 'SportsPress Teams (CSV)', 'sportspress' ),
39
  'description' => __( 'Import <strong>teams</strong> from a csv file.', 'sportspress'),
@@ -69,6 +74,19 @@ class SP_Admin_Importers {
69
  $importer->dispatch();
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  /**
73
  * Add menu item
74
  */
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
34
  'description' => __( 'Import <strong>events</strong> from a csv file.', 'sportspress'),
35
  'callback' => array( $this, 'events_importer' ),
36
  ),
37
+ 'sp_fixture_csv' => array(
38
+ 'name' => __( 'SportsPress Fixtures (CSV)', 'sportspress' ),
39
+ 'description' => __( 'Import <strong>fixtures</strong> from a csv file.', 'sportspress'),
40
+ 'callback' => array( $this, 'fixtures_importer' ),
41
+ ),
42
  'sp_team_csv' => array(
43
  'name' => __( 'SportsPress Teams (CSV)', 'sportspress' ),
44
  'description' => __( 'Import <strong>teams</strong> from a csv file.', 'sportspress'),
74
  $importer->dispatch();
75
  }
76
 
77
+ /**
78
+ * Add menu item
79
+ */
80
+ public function fixtures_importer() {
81
+ $this->includes();
82
+
83
+ require 'importers/class-sp-fixture-importer.php';
84
+
85
+ // Dispatch
86
+ $importer = new SP_Fixture_Importer();
87
+ $importer->dispatch();
88
+ }
89
+
90
  /**
91
  * Add menu item
92
  */
includes/admin/class-sp-admin-notices.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.0.9
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -45,7 +45,7 @@ class SP_Admin_Notices {
45
  add_action( 'admin_notices', array( $this, 'install_notice' ) );
46
  }
47
 
48
- if ( 'post' == $screen->base ) {
49
  $post_id = get_the_ID();
50
  if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) {
51
  add_action( 'admin_notices', array( $this, 'no_access_notice' ) );
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
45
  add_action( 'admin_notices', array( $this, 'install_notice' ) );
46
  }
47
 
48
+ if ( is_object( $screen ) && 'post' == $screen->base ) {
49
  $post_id = get_the_ID();
50
  if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) {
51
  add_action( 'admin_notices', array( $this, 'no_access_notice' ) );
includes/admin/class-sp-admin-settings.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 1.8.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -42,6 +42,13 @@ class SP_Admin_Settings {
42
  $settings = apply_filters( 'sportspress_get_settings_pages', $settings );
43
 
44
  $settings[] = include( 'settings/class-sp-settings-text.php' );
 
 
 
 
 
 
 
45
 
46
  if ( current_user_can( 'manage_options' ) ) $settings[] = include( 'settings/class-sp-settings-status.php' );
47
 
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
42
  $settings = apply_filters( 'sportspress_get_settings_pages', $settings );
43
 
44
  $settings[] = include( 'settings/class-sp-settings-text.php' );
45
+
46
+ if (
47
+ ( ! is_multisite() && current_user_can( 'manage_options' ) ) ||
48
+ ( is_multisite() && current_user_can( 'manage_network_options' ) )
49
+ ) {
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
 
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.0
9
  * @package SportsPress/Admin
10
  * @category Class
11
  * @author ThemeBoy
@@ -161,6 +161,8 @@ class SP_Admin_Sports {
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
  $i ++;
165
  }
166
 
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
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
 
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.0.3
13
  */
14
 
15
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -181,36 +181,62 @@ class SP_Admin_Welcome {
181
 
182
  <hr>
183
 
184
- <div class="feature-section two-col">
185
- <h2>Customization Improvements</h2>
186
  <div class="col">
187
- <img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/layout-designer.gif" alt=""/>
188
- <h3>Layout Designer</h3>
189
- <p>You can now choose to show or hide specific elements and reorder them as you like. Design your own unique layouts for event, team, player, and staff pages.</p>
190
  </div>
191
  <div class="col">
192
- <img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/smart-statistics.png" alt=""/>
193
- <h3>Smarter Statistics</h3>
194
- <p>Offensive and defensive statistics can now be displayed separately in events and player profiles. A global visibility option lets you choose whether to show or hide each column.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  </div>
196
  </div>
197
 
198
  <hr />
199
 
200
  <div class="changelog">
201
- <h2>Take Control of Your Data</h2>
202
  <div class="under-the-hood three-col">
203
  <div class="col">
204
- <h3>Taxonomy Ordering</h3>
205
- <p>The order of competitions, seasons, venues, positions, and roles can now be changed by editing the slug of each term.</p>
206
  </div>
207
  <div class="col">
208
- <h3>Career Totals</h3>
209
- <p>Display career totals in player statistics tables. This row is added as a footer below the list of seasons.</p>
210
  </div>
211
  <div class="col">
212
- <h3>REST API Support</h3>
213
- <p>SportsPress now integrates with the WP REST API with custom endpoints for retrieving and updating sports data.</p>
214
  </div>
215
  </div>
216
  </div>
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
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
 
224
  <hr />
225
 
226
  <div class="changelog">
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>
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 1.7
14
  */
15
  class SP_Admin {
16
 
@@ -94,15 +94,29 @@ class SP_Admin {
94
  public function action_links() {
95
  global $pagenow, $typenow;
96
  if ( 'edit.php' == $pagenow && in_array( $typenow, sp_primary_post_types() ) ) {
97
- ?>
98
- <script type="text/javascript">
99
- (function($) {
100
- $(".wrap .page-title-action:first-child").after(
101
- $("<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>")
102
- );
103
- })(jQuery);
104
- </script>
105
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
  }
108
  }
10
  * @author ThemeBoy
11
  * @category Admin
12
  * @package SportsPress/Admin
13
+ * @version 2.1
14
  */
15
  class SP_Admin {
16
 
94
  public function action_links() {
95
  global $pagenow, $typenow;
96
  if ( 'edit.php' == $pagenow && in_array( $typenow, sp_primary_post_types() ) ) {
97
+ if ( 'sp_event' === $typenow ) {
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>")
105
+ );
106
+ })(jQuery);
107
+ </script>
108
+ <?php
109
+ } else {
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);
117
+ </script>
118
+ <?php
119
+ }
120
  }
121
  }
122
  }
includes/admin/importers/class-sp-event-importer.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
- * @version 2.0.4
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -452,6 +452,7 @@ if ( class_exists( 'WP_Importer' ) ) {
452
  echo '<div class="narrow">';
453
  echo '<p>' . __( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ).'</p>';
454
  echo '<p>' . sprintf( __( 'Events need to be defined with columns in a specific order (3+ columns). <a href="%s">Click here to download a sample</a>.', 'sportspress' ), plugin_dir_url( SP_PLUGIN_FILE ) . 'dummy-data/events-sample.csv' ) . '</p>';
 
455
  wp_import_upload_form( 'admin.php?import=sp_event_csv&step=1' );
456
  echo '</div>';
457
  }
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
+ * @version 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
452
  echo '<div class="narrow">';
453
  echo '<p>' . __( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ).'</p>';
454
  echo '<p>' . sprintf( __( 'Events need to be defined with columns in a specific order (3+ columns). <a href="%s">Click here to download a sample</a>.', 'sportspress' ), plugin_dir_url( SP_PLUGIN_FILE ) . 'dummy-data/events-sample.csv' ) . '</p>';
455
+ echo '<p>' . sprintf( __( 'Supports CSV files generated by <a href="%s">LeagueLobster</a>.', 'sportspress' ), 'http://tboy.co/leaguelobster' ) . '</p>';
456
  wp_import_upload_form( 'admin.php?import=sp_event_csv&step=1' );
457
  echo '</div>';
458
  }
includes/admin/importers/class-sp-fixture-importer.php ADDED
@@ -0,0 +1,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fixture importer - import fixtures into SportsPress.
4
+ *
5
+ * @author ThemeBoy
6
+ * @category Admin
7
+ * @package SportsPress/Admin/Importers
8
+ * @version 2.1
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
+
13
+ if ( class_exists( 'WP_Importer' ) ) {
14
+ class SP_Fixture_Importer extends SP_Importer {
15
+
16
+ /**
17
+ * __construct function.
18
+ *
19
+ * @access public
20
+ * @return void
21
+ */
22
+ public function __construct() {
23
+ $this->import_page = 'sp_fixture_csv';
24
+ $this->import_label = __( 'Import Fixtures', 'sportspress' );
25
+ $this->columns = array(
26
+ 'post_date' => __( 'Date', 'sportspress' ),
27
+ 'post_time' => __( 'Time', 'sportspress' ),
28
+ 'sp_venue' => __( 'Venue', 'sportspress' ),
29
+ 'sp_home' => __( 'Home', 'sportspress' ),
30
+ 'sp_away' => __( 'Away', 'sportspress' ),
31
+ 'sp_day' => __( 'Match Day', 'sportspress' ),
32
+ );
33
+ $this->optionals = array( 'sp_day' );
34
+ }
35
+
36
+ /**
37
+ * import function.
38
+ *
39
+ * @access public
40
+ * @param array $array
41
+ * @param array $columns
42
+ * @return void
43
+ */
44
+ function import( $array = array(), $columns = array( 'post_title' ) ) {
45
+ $this->imported = $this->skipped = 0;
46
+
47
+ if ( ! is_array( $array ) || ! sizeof( $array ) ):
48
+ $this->footer();
49
+ die();
50
+ endif;
51
+
52
+ $rows = array_chunk( $array, sizeof( $columns ) );
53
+
54
+ // Get event format, league, and season from post vars
55
+ $event_format = ( empty( $_POST['sp_format'] ) ? false : $_POST['sp_format'] );
56
+ $league = ( sp_array_value( $_POST, 'sp_league', '-1' ) == '-1' ? false : $_POST['sp_league'] );
57
+ $season = ( sp_array_value( $_POST, 'sp_season', '-1' ) == '-1' ? false : $_POST['sp_season'] );
58
+ $date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : $_POST['sp_date_format'] );
59
+
60
+ foreach ( $rows as $row ):
61
+
62
+ $row = array_filter( $row );
63
+
64
+ if ( empty( $row ) ) continue;
65
+
66
+ $meta = array();
67
+
68
+ foreach ( $columns as $index => $key ):
69
+ $meta[ $key ] = sp_array_value( $row, $index );
70
+ endforeach;
71
+
72
+ // Get event details
73
+ $event = array(
74
+ sp_array_value( $meta, 'post_date' ),
75
+ sp_array_value( $meta, 'post_time' ),
76
+ sp_array_value( $meta, 'sp_venue' ),
77
+ sp_array_value( $meta, 'sp_day' ),
78
+ );
79
+
80
+ $teams = array(
81
+ sp_array_value( $meta, 'sp_home' ),
82
+ sp_array_value( $meta, 'sp_away' ),
83
+ );
84
+
85
+ // Add new event if date is given
86
+ if ( sizeof( $event ) > 0 && ! empty( $event[0] ) ):
87
+
88
+ // List event columns
89
+ list( $date, $time, $venue, $day ) = $event;
90
+
91
+ // Format date
92
+ $date = str_replace( '/', '-', trim( $date ) );
93
+ $date_array = explode( '-', $date );
94
+ switch ( $date_format ):
95
+ case 'dd/mm/yyyy':
96
+ $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .
97
+ substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .
98
+ substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );
99
+ break;
100
+ case 'mm/dd/yyyy':
101
+ $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .
102
+ substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .
103
+ substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );
104
+ break;
105
+ default:
106
+ $date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' .
107
+ substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' .
108
+ substr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 );
109
+ endswitch;
110
+
111
+ // Add time to date if given
112
+ if ( ! empty( $time ) ):
113
+ $date .= ' ' . trim( $time );
114
+ endif;
115
+
116
+ // Define post type args
117
+ $args = array( 'post_type' => 'sp_event', 'post_status' => 'publish', 'post_date' => $date, 'post_title' => __( 'Event', 'sportspress' ) );
118
+
119
+ // Insert event
120
+ $id = wp_insert_post( $args );
121
+
122
+ // Flag as import
123
+ update_post_meta( $id, '_sp_import', 1 );
124
+
125
+ // Update event format
126
+ if ( $event_format ):
127
+ update_post_meta( $id, 'sp_format', $event_format );
128
+ endif;
129
+
130
+ // Update league
131
+ if ( $league ):
132
+ wp_set_object_terms( $id, $league, 'sp_league', false );
133
+ endif;
134
+
135
+ // Update season
136
+ if ( $season ):
137
+ wp_set_object_terms( $id, $season, 'sp_season', false );
138
+ endif;
139
+
140
+ // Update venue
141
+ wp_set_object_terms( $id, $venue, 'sp_venue', false );
142
+
143
+ // Update match day
144
+ if ( '' !== $day ) {
145
+ update_post_meta( $id, 'sp_day', $day );
146
+ }
147
+
148
+ // Increment
149
+ $this->imported ++;
150
+
151
+ endif;
152
+
153
+ // Add teams to event
154
+ if ( sizeof( $teams ) > 0 ):
155
+
156
+ foreach ( $teams as $team_name ):
157
+
158
+ if ( '' !== $team_name ):
159
+
160
+ // Find out if team exists
161
+ $team_object = get_page_by_title( stripslashes( $team_name ), OBJECT, 'sp_team' );
162
+
163
+ // Get or insert team
164
+ if ( $team_object ):
165
+
166
+ // Make sure team is published
167
+ if ( $team_object->post_status != 'publish' ):
168
+ wp_update_post( array( 'ID' => $team_object->ID, 'post_status' => 'publish' ) );
169
+ endif;
170
+
171
+ // Get team ID
172
+ $team_id = $team_object->ID;
173
+
174
+ else:
175
+
176
+ // Insert team
177
+ $team_id = wp_insert_post( array( 'post_type' => 'sp_team', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $team_name ) ) );
178
+
179
+ // Flag as import
180
+ update_post_meta( $team_id, '_sp_import', 1 );
181
+
182
+ endif;
183
+
184
+ // Update league
185
+ if ( $league ):
186
+ wp_set_object_terms( $team_id, $league, 'sp_league', true );
187
+ endif;
188
+
189
+ // Update season
190
+ if ( $season ):
191
+ wp_set_object_terms( $team_id, $season, 'sp_season', true );
192
+ endif;
193
+
194
+ // Add to event if exists
195
+ if ( isset( $id ) ):
196
+
197
+ // Add team to event
198
+ add_post_meta( $id, 'sp_team', $team_id );
199
+
200
+ // Get event name
201
+ $title = get_the_title( $id );
202
+
203
+ // Initialize event name
204
+ if ( __( 'Event', 'sportspress' ) === $title ) {
205
+ $title = '';
206
+ } else {
207
+ $title .= ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ';
208
+ }
209
+
210
+ // Append team name to event name
211
+ $title .= $team_name;
212
+
213
+ // Update event with new name
214
+ $post = array(
215
+ 'ID' => $id,
216
+ 'post_title' => $title,
217
+ 'post_name' => $id,
218
+ );
219
+ wp_update_post( $post );
220
+
221
+ endif;
222
+
223
+ else:
224
+
225
+ // Add empty team to event
226
+ add_post_meta( $id, 'sp_team', -1 );
227
+
228
+ endif;
229
+
230
+ endforeach;
231
+
232
+ endif;
233
+
234
+ endforeach;
235
+
236
+ // Show Result
237
+ echo '<div class="updated settings-error below-h2"><p>
238
+ '.sprintf( __( 'Import complete - imported <strong>%s</strong> events and skipped <strong>%s</strong>.', 'sportspress' ), $this->imported, $this->skipped ).'
239
+ </p></div>';
240
+
241
+ $this->import_end();
242
+ }
243
+
244
+ /**
245
+ * Performs post-import cleanup of files and the cache
246
+ */
247
+ function import_end() {
248
+ echo '<p>' . __( 'All done!', 'sportspress' ) . ' <a href="' . admin_url('edit.php?post_type=sp_event') . '">' . __( 'View Fixtures', 'sportspress' ) . '</a>' . '</p>';
249
+
250
+ do_action( 'import_end' );
251
+ }
252
+
253
+ /**
254
+ * greet function.
255
+ *
256
+ * @access public
257
+ * @return void
258
+ */
259
+ function greet() {
260
+ echo '<div class="narrow">';
261
+ echo '<p>' . __( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ).'</p>';
262
+ echo '<p>' . sprintf( __( 'Fixtures need to be defined with columns in a specific order (4+ columns). <a href="%s">Click here to download a sample</a>.', 'sportspress' ), plugin_dir_url( SP_PLUGIN_FILE ) . 'dummy-data/fixtures-sample.csv' ) . '</p>';
263
+ echo '<p>' . sprintf( __( 'Supports CSV files generated by <a href="%s">LeagueLobster</a>.', 'sportspress' ), 'http://tboy.co/leaguelobster' ) . '</p>';
264
+ wp_import_upload_form( 'admin.php?import=sp_fixture_csv&step=1' );
265
+ echo '</div>';
266
+ }
267
+
268
+ /**
269
+ * options function.
270
+ *
271
+ * @access public
272
+ * @return void
273
+ */
274
+ function options() {
275
+ ?>
276
+ <table class="form-table">
277
+ <tbody>
278
+ <tr>
279
+ <th scope="row"><label><?php _e( 'Format', 'sportspress' ); ?></label><br/></th>
280
+ <td class="forminp forminp-radio" id="sp_formatdiv">
281
+ <fieldset id="post-formats-select">
282
+ <ul>
283
+ <li><input type="radio" name="sp_format" class="post-format" id="post-format-league" value="league" checked="checked"> <label for="post-format-league" class="post-format-icon post-format-league"><?php _e( 'Competitive', 'sportspress' ); ?></label></li>
284
+ <li><input type="radio" name="sp_format" class="post-format" id="post-format-friendly" value="friendly"> <label for="post-format-friendly" class="post-format-icon post-format-friendly"><?php _e( 'Friendly', 'sportspress' ); ?></label></li>
285
+ <br>
286
+ </fieldset>
287
+ </td>
288
+ </tr>
289
+ <tr>
290
+ <th scope="row"><label><?php _e( 'Competition', 'sportspress' ); ?></label><br/></th>
291
+ <td><?php
292
+ $args = array(
293
+ 'taxonomy' => 'sp_league',
294
+ 'name' => 'sp_league',
295
+ 'values' => 'slug',
296
+ 'show_option_none' => __( '&mdash; Not set &mdash;', 'sportspress' ),
297
+ );
298
+ if ( ! sp_dropdown_taxonomies( $args ) ):
299
+ echo '<p>' . __( 'None', 'sportspress' ) . '</p>';
300
+ sp_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
301
+ endif;
302
+ ?></td>
303
+ </tr>
304
+ <tr>
305
+ <th scope="row"><label><?php _e( 'Season', 'sportspress' ); ?></label><br/></th>
306
+ <td><?php
307
+ $args = array(
308
+ 'taxonomy' => 'sp_season',
309
+ 'name' => 'sp_season',
310
+ 'values' => 'slug',
311
+ 'show_option_none' => __( '&mdash; Not set &mdash;', 'sportspress' ),
312
+ );
313
+ if ( ! sp_dropdown_taxonomies( $args ) ):
314
+ echo '<p>' . __( 'None', 'sportspress' ) . '</p>';
315
+ sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
316
+ endif;
317
+ ?></td>
318
+ </tr>
319
+ <tr>
320
+ <th scope="row" class="titledesc">
321
+ <?php _e( 'Date Format', 'sportspress' ); ?>
322
+ </th>
323
+ <td class="forminp forminp-radio">
324
+ <fieldset>
325
+ <ul>
326
+ <li>
327
+ <label><input name="sp_date_format" value="yyyy/mm/dd" type="radio" checked> yyyy/mm/dd</label>
328
+ </li>
329
+ <li>
330
+ <label><input name="sp_date_format" value="dd/mm/yyyy" type="radio"> dd/mm/yyyy</label>
331
+ </li>
332
+ <li>
333
+ <label><input name="sp_date_format" value="mm/dd/yyyy" type="radio"> mm/dd/yyyy</label>
334
+ </li>
335
+ </ul>
336
+ </fieldset>
337
+ </td>
338
+ </tr>
339
+ </tbody>
340
+ </table>
341
+ <?php
342
+ }
343
+ }
344
+ }
includes/admin/importers/class-sp-importer.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
- * @version 1.3
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -22,6 +22,7 @@ if ( class_exists( 'WP_Importer' ) ) {
22
  var $skipped;
23
  var $import_label;
24
  var $columns = array();
 
25
 
26
  /**
27
  * Constructor.
@@ -152,7 +153,7 @@ if ( class_exists( 'WP_Importer' ) ) {
152
  <tr>
153
  <?php $index = 0; foreach ( $this->columns as $key => $label ): $value = sp_array_value( $row, $index ); ?>
154
  <td>
155
- <input type="text" class="widefat" value="<?php echo esc_attr( $value ); ?>" name="sp_import[]">
156
  </td>
157
  <?php $index ++; endforeach; ?>
158
  <td class="sp-actions-column">
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
+ * @version 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
22
  var $skipped;
23
  var $import_label;
24
  var $columns = array();
25
+ var $optionals = array();
26
 
27
  /**
28
  * Constructor.
153
  <tr>
154
  <?php $index = 0; foreach ( $this->columns as $key => $label ): $value = sp_array_value( $row, $index ); ?>
155
  <td>
156
+ <input type="text" class="widefat" value="<?php echo esc_attr( $value ); ?>" name="sp_import[]"<?php if ( in_array( $key, $this->optionals ) ) { ?> placeholder="<?php _e( 'Default', 'sportspress' ); ?>"<?php } ?>>
157
  </td>
158
  <?php $index ++; endforeach; ?>
159
  <td class="sp-actions-column">
includes/admin/post-types/class-sp-admin-cpt-event.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
- * @version 2.0.2
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -122,6 +122,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
122
  'sp_league' => __( 'Competition', 'sportspress' ),
123
  'sp_season' => __( 'Season', 'sportspress' ),
124
  'sp_venue' => __( 'Venue', 'sportspress' ),
 
125
  ), $existing_columns, array(
126
  'title' => __( 'Event', 'sportspress' ),
127
  ) );
@@ -143,7 +144,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
143
  endif;
144
  break;
145
  case 'sp_time':
146
- echo get_post_time( 'H:i', false, $post_id, true );
147
  break;
148
  case 'sp_team':
149
  $teams = (array)get_post_meta( $post_id, 'sp_team', false );
@@ -208,6 +209,11 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
208
  case 'sp_venue':
209
  echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : '&mdash;';
210
  break;
 
 
 
 
 
211
  endswitch;
212
  }
213
 
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
+ * @version 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
122
  'sp_league' => __( 'Competition', 'sportspress' ),
123
  'sp_season' => __( 'Season', 'sportspress' ),
124
  'sp_venue' => __( 'Venue', 'sportspress' ),
125
+ 'sp_day' => __( 'Match Day', 'sportspress' ),
126
  ), $existing_columns, array(
127
  'title' => __( 'Event', 'sportspress' ),
128
  ) );
144
  endif;
145
  break;
146
  case 'sp_time':
147
+ echo apply_filters( 'sportspress_event_time_admin', get_post_time( 'H:i', false, $post_id, true ) );
148
  break;
149
  case 'sp_team':
150
  $teams = (array)get_post_meta( $post_id, 'sp_team', false );
209
  case 'sp_venue':
210
  echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : '&mdash;';
211
  break;
212
+ case 'sp_day':
213
+ $day = get_post_meta ( $post_id, 'sp_day', true );
214
+ if ( '' === $day ) $day = __( 'Default', 'sportspress' );
215
+ echo $day;
216
+ break;
217
  endswitch;
218
  }
219
 
includes/admin/post-types/class-sp-admin-meta-boxes.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Admin
9
  * @package SportsPress/Admin/Meta_Boxes
10
- * @version 2.0
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -60,6 +60,13 @@ class SP_Admin_Meta_Boxes {
60
  'context' => 'normal',
61
  'priority' => 'high',
62
  ),
 
 
 
 
 
 
 
63
  ),
64
  'sp_column' => array(
65
  'details' => array(
7
  * @author ThemeBoy
8
  * @category Admin
9
  * @package SportsPress/Admin/Meta_Boxes
10
+ * @version 2.1.6
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
60
  'context' => 'normal',
61
  'priority' => 'high',
62
  ),
63
+ 'equation' => array(
64
+ 'title' => __( 'Equation', 'sportspress' ),
65
+ 'save' => 'SP_Meta_Box_Performance_Equation::save',
66
+ 'output' => 'SP_Meta_Box_Performance_Equation::output',
67
+ 'context' => 'normal',
68
+ 'priority' => 'high',
69
+ ),
70
  ),
71
  'sp_column' => array(
72
  'details' => array(
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 1.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -163,7 +163,7 @@ class SP_Meta_Box_Calendar_Data {
163
  </td>
164
  <?php if ( 'separate' == $time_format ) { ?>
165
  <td>
166
- <?php echo get_post_time( get_option( 'time_format' ), false, $event, true ); ?>
167
  </td>
168
  <td>
169
  <?php
@@ -180,7 +180,7 @@ class SP_Meta_Box_Calendar_Data {
180
  if ( ! empty( $main_results ) ):
181
  echo implode( ' - ', $main_results );
182
  else:
183
- echo get_post_time( get_option( 'time_format' ), false, $event, true );
184
  endif;
185
  ?>
186
  </td>
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
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
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>
includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 1.9.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -25,8 +25,10 @@ class SP_Meta_Box_Calendar_Details {
25
  $date = get_post_meta( $post->ID, 'sp_date', true );
26
  $date_from = get_post_meta( $post->ID, 'sp_date_from', true );
27
  $date_to = get_post_meta( $post->ID, 'sp_date_to', true );
 
28
  $teams = get_post_meta( $post->ID, 'sp_team', false );
29
  $table_id = get_post_meta( $post->ID, 'sp_table', true );
 
30
  $order = get_post_meta( $post->ID, 'sp_order', true );
31
  ?>
32
  <div>
@@ -62,6 +64,12 @@ class SP_Meta_Box_Calendar_Details {
62
  <input type="text" class="sp-datepicker-to" name="sp_date_to" value="<?php echo $date_to ? $date_to : date_i18n( 'Y-m-d' ); ?>" size="10">
63
  </p>
64
  </div>
 
 
 
 
 
 
65
  <?php
66
  foreach ( $taxonomies as $taxonomy ) {
67
  sp_taxonomy_field( $taxonomy, $post, true );
@@ -85,6 +93,13 @@ class SP_Meta_Box_Calendar_Details {
85
  endif;
86
  ?>
87
  </p>
 
 
 
 
 
 
 
88
  <p><strong><?php _e( 'Sort Order', 'sportspress' ); ?></strong></p>
89
  <p>
90
  <select name="sp_order">
@@ -105,7 +120,9 @@ class SP_Meta_Box_Calendar_Details {
105
  update_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0 ) );
106
  update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null ) );
107
  update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null ) );
108
- update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
 
 
109
  sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
110
  }
111
  }
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
25
  $date = get_post_meta( $post->ID, 'sp_date', true );
26
  $date_from = get_post_meta( $post->ID, 'sp_date_from', true );
27
  $date_to = get_post_meta( $post->ID, 'sp_date_to', true );
28
+ $day = get_post_meta( $post->ID, 'sp_day', true );
29
  $teams = get_post_meta( $post->ID, 'sp_team', false );
30
  $table_id = get_post_meta( $post->ID, 'sp_table', true );
31
+ $orderby = get_post_meta( $post->ID, 'sp_orderby', true );
32
  $order = get_post_meta( $post->ID, 'sp_order', true );
33
  ?>
34
  <div>
64
  <input type="text" class="sp-datepicker-to" name="sp_date_to" value="<?php echo $date_to ? $date_to : date_i18n( 'Y-m-d' ); ?>" size="10">
65
  </p>
66
  </div>
67
+ <div class="sp-event-day-field">
68
+ <p><strong><?php _e( 'Match Day', 'sportspress' ); ?></strong></p>
69
+ <p>
70
+ <input name="sp_day" type="text" class="medium-text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>">
71
+ </p>
72
+ </div>
73
  <?php
74
  foreach ( $taxonomies as $taxonomy ) {
75
  sp_taxonomy_field( $taxonomy, $post, true );
93
  endif;
94
  ?>
95
  </p>
96
+ <p><strong><?php _e( 'Sort by', 'sportspress' ); ?></strong></p>
97
+ <p>
98
+ <select name="sp_orderby">
99
+ <option value="date" <?php selected( 'date', $orderby ); ?>><?php _e( 'Date', 'sportspress' ); ?></option>
100
+ <option value="day" <?php selected( 'day', $orderby ); ?>><?php _e( 'Match Day', 'sportspress' ); ?></option>
101
+ </select>
102
+ </p>
103
  <p><strong><?php _e( 'Sort Order', 'sportspress' ); ?></strong></p>
104
  <p>
105
  <select name="sp_order">
120
  update_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0 ) );
121
  update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null ) );
122
  update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null ) );
123
+ update_post_meta( $post_id, 'sp_day', sp_array_value( $_POST, 'sp_day', null ) );
124
+ update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', null ) );
125
+ update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', null ) );
126
  sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
127
  }
128
  }
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 1.9.19
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -120,6 +120,19 @@ class SP_Meta_Box_Equation {
120
  'posts_per_page' => -1,
121
  'orderby' => 'menu_order',
122
  'order' => 'ASC',
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  );
124
  $vars = get_posts( $args );
125
 
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
120
  'posts_per_page' => -1,
121
  'orderby' => 'menu_order',
122
  'order' => 'ASC',
123
+ 'meta_query' => array(
124
+ 'relation' => 'OR',
125
+ array(
126
+ 'key' => 'sp_format',
127
+ 'value' => 'number',
128
+ 'compare' => 'NOT EXISTS',
129
+ ),
130
+ array(
131
+ 'key' => 'sp_format',
132
+ 'value' => array( 'equation', 'text' ),
133
+ 'compare' => 'NOT IN',
134
+ ),
135
+ ),
136
  );
137
  $vars = get_posts( $args );
138
 
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 1.9.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -19,10 +19,17 @@ class SP_Meta_Box_Event_Details {
19
  * Output the metabox
20
  */
21
  public static function output( $post ) {
 
22
  $taxonomies = get_object_taxonomies( 'sp_event' );
23
  $minutes = get_post_meta( $post->ID, 'sp_minutes', true );
24
  ?>
25
  <?php do_action( 'sportspress_event_details_meta_box', $post ); ?>
 
 
 
 
 
 
26
  <div class="sp-event-minutes-field">
27
  <p><strong><?php _e( 'Full Time', 'sportspress' ); ?></strong></p>
28
  <p>
@@ -66,6 +73,7 @@ class SP_Meta_Box_Event_Details {
66
  * Save meta box data
67
  */
68
  public static function save( $post_id, $post ) {
 
69
  update_post_meta( $post_id, 'sp_minutes', sp_array_value( $_POST, 'sp_minutes', get_option( 'sportspress_event_minutes', 90 ) ) );
70
  $venues = array_filter( sp_array_value( sp_array_value( $_POST, 'tax_input', array() ), 'sp_venue', array() ) );
71
  if ( empty( $venues ) ) {
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
19
  * Output the metabox
20
  */
21
  public static function output( $post ) {
22
+ $day = get_post_meta( $post->ID, 'sp_day', true );
23
  $taxonomies = get_object_taxonomies( 'sp_event' );
24
  $minutes = get_post_meta( $post->ID, 'sp_minutes', true );
25
  ?>
26
  <?php do_action( 'sportspress_event_details_meta_box', $post ); ?>
27
+ <div class="sp-event-day-field">
28
+ <p><strong><?php _e( 'Match Day', 'sportspress' ); ?></strong></p>
29
+ <p>
30
+ <input name="sp_day" type="text" class="medium-text" placeholder="<?php _e( 'Default', 'sportspress' ); ?>" value="<?php echo esc_attr( $day ); ?>">
31
+ </p>
32
+ </div>
33
  <div class="sp-event-minutes-field">
34
  <p><strong><?php _e( 'Full Time', 'sportspress' ); ?></strong></p>
35
  <p>
73
  * Save meta box data
74
  */
75
  public static function save( $post_id, $post ) {
76
+ update_post_meta( $post_id, 'sp_day', sp_array_value( $_POST, 'sp_day', null ) );
77
  update_post_meta( $post_id, 'sp_minutes', sp_array_value( $_POST, 'sp_minutes', get_option( 'sportspress_event_minutes', 90 ) ) );
78
  $venues = array_filter( sp_array_value( sp_array_value( $_POST, 'tax_input', array() ), 'sp_venue', array() ) );
79
  if ( empty( $venues ) ) {
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.0.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -22,6 +22,11 @@ class SP_Meta_Box_Event_Performance {
22
  $event = new SP_Event( $post );
23
  list( $labels, $columns, $stats, $teams, $formats, $order ) = $event->performance( true );
24
 
 
 
 
 
 
25
  // Determine if columns are auto or manual
26
  if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) )
27
  $manual = true;
@@ -60,7 +65,7 @@ class SP_Meta_Box_Event_Performance {
60
  // Check if individual mode
61
  $is_individual = get_option( 'sportspress_load_individual_mode_module', 'no' ) === 'yes' ? true : false;
62
 
63
- self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual );
64
  }
65
 
66
  /**
@@ -70,12 +75,13 @@ class SP_Meta_Box_Event_Performance {
70
  update_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array() ) );
71
  update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
72
  update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
 
73
  }
74
 
75
  /**
76
  * Admin edit tables
77
  */
78
- 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 ) {
79
  $sections = get_option( 'sportspress_event_performance_sections', -1 );
80
 
81
  if ( $is_individual ) {
@@ -94,8 +100,23 @@ class SP_Meta_Box_Event_Performance {
94
  $players[] = -1;
95
  $data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
96
 
 
 
 
 
 
 
 
97
  foreach ( $data as $player_id => $player_performance ):
98
- self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, $numbers, -1, $formats );
 
 
 
 
 
 
 
 
99
  endforeach;
100
  endforeach;
101
  ?>
@@ -114,10 +135,17 @@ class SP_Meta_Box_Event_Performance {
114
  $players = sp_array_between( (array)get_post_meta( $post_id, 'sp_player', false ), 0, $key );
115
  $players[] = -1;
116
  $data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
 
 
 
 
 
 
 
117
  ?>
118
  <div>
119
  <p><strong><?php echo get_the_title( $team_id ); ?></strong></p>
120
- <?php self::table( $labels, $columns, $data, $team_id, $has_checkboxes, $positions, $status, -1, $formats, $order, $numbers ); ?>
121
  <?php do_action( 'sportspress_after_event_performance_table_admin', $labels, $columns, $data, $team_id ); ?>
122
  </div>
123
  <?php } else { ?>
@@ -129,22 +157,35 @@ class SP_Meta_Box_Event_Performance {
129
  'posts_per_page' => 100,
130
  'orderby' => 'menu_order',
131
  'order' => 'ASC',
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  );
133
 
134
- $columns = get_posts( $args );
135
 
136
  $labels = array( array(), array() );
137
- foreach ( $columns as $column ):
138
- $section = get_post_meta( $column->ID, 'sp_section', true );
139
  if ( '' === $section ) {
140
  $section = -1;
141
  }
142
  switch ( $section ):
143
  case 1:
144
- $labels[1][ $column->post_name ] = $column->post_title;
145
  break;
146
  default:
147
- $labels[0][ $column->post_name ] = $column->post_title;
148
  endswitch;
149
  endforeach;
150
 
@@ -167,6 +208,13 @@ class SP_Meta_Box_Event_Performance {
167
  $players[] = -1;
168
  $data[0] = $data[1] = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
169
  }
 
 
 
 
 
 
 
170
 
171
  // Determine order of sections
172
  if ( 1 == $sections ) {
@@ -179,7 +227,7 @@ class SP_Meta_Box_Event_Performance {
179
  ?>
180
  <div>
181
  <p><strong><?php echo get_the_title( $team_id ); ?> &mdash; <?php echo $section_label; ?></strong></p>
182
- <?php self::table( $labels[ $section_id ], $columns, $data[ $section_id ], $team_id, ( $has_checkboxes && 0 === $i ), $positions, $status, $section_id, $formats, $order, $numbers ); ?>
183
  <?php do_action( 'sportspress_after_event_performance_table_admin', $labels[ $section_id ], $columns, $data[ $section_id ], $team_id ); ?>
184
  </div>
185
  <?php
@@ -193,7 +241,7 @@ class SP_Meta_Box_Event_Performance {
193
  /**
194
  * Admin edit table
195
  */
196
- 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 ) {
197
  ?>
198
  <div class="sp-data-table-container">
199
  <table class="widefat sp-data-table sp-performance-table sp-sortable-table">
@@ -218,8 +266,18 @@ class SP_Meta_Box_Event_Performance {
218
  }
219
  $data = $players;
220
  }
 
221
  foreach ( $data as $player_id => $player_performance ):
222
- self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, true, $numbers, $section, $formats );
 
 
 
 
 
 
 
 
 
223
  endforeach;
224
  ?>
225
  </tbody>
@@ -248,6 +306,7 @@ class SP_Meta_Box_Event_Performance {
248
  </th>
249
  <?php } ?>
250
  <?php foreach ( $labels as $key => $label ): ?>
 
251
  <th>
252
  <?php if ( $has_checkboxes ): ?>
253
  <label for="sp_columns_<?php echo $key; ?>">
@@ -289,6 +348,7 @@ class SP_Meta_Box_Event_Performance {
289
  <td>&nbsp;</td>
290
  <?php } ?>
291
  <?php foreach( $labels as $column => $label ):
 
292
  $player_id = 0;
293
  $player_performance = sp_array_value( $data, $player_id, array() );
294
  $value = sp_array_value( $player_performance, $column, '' );
@@ -309,7 +369,7 @@ class SP_Meta_Box_Event_Performance {
309
  /**
310
  * Admin edit table row
311
  */
312
- 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() ) {
313
  if ( $player_id <= 0 ) return;
314
 
315
  $value = sp_array_value( $player_performance, 'number', '' );
@@ -352,17 +412,47 @@ class SP_Meta_Box_Event_Performance {
352
  </td>
353
  <?php } ?>
354
  <?php foreach( $labels as $column => $label ):
 
355
  $value = sp_array_value( $player_performance, $column, '' );
 
356
  $placeholder = sp_get_format_placeholder( sp_array_value( $formats, $column, 'number' ) );
357
  ?>
358
  <td>
359
  <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; ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  </td>
361
  <?php endforeach; ?>
362
  <?php if ( apply_filters( 'sportspress_event_performance_show_status', $status, $section ) ) { ?>
363
  <td class="sp-status-selector">
 
 
 
 
 
 
 
 
364
  <?php echo self::status_select( $team_id, $player_id, sp_array_value( $player_performance, 'status', null ) ); ?>
365
  <?php echo self::sub_select( $team_id, $player_id, sp_array_value( $player_performance, 'sub', null ), $data ); ?>
 
 
366
  </td>
367
  <?php } ?>
368
  </tr>
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
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;
29
+
30
  // Determine if columns are auto or manual
31
  if ( 'manual' == get_option( 'sportspress_event_performance_columns', 'auto' ) )
32
  $manual = true;
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
  /**
75
  update_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array() ) );
76
  update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
77
  update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
78
+ update_post_meta( $post_id, 'sp_timeline', sp_array_value( $_POST, 'sp_timeline', array() ) );
79
  }
80
 
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 ) {
100
  $players[] = -1;
101
  $data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
102
 
103
+ // Get team timeline
104
+ if ( is_array( $timeline ) ):
105
+ $team_timeline = (array) sp_array_value( $timeline, $team_id, array() );
106
+ else:
107
+ $team_timeline = false;
108
+ endif;
109
+
110
  foreach ( $data as $player_id => $player_performance ):
111
+
112
+ // Get player timeline
113
+ if ( is_array( $team_timeline ) ):
114
+ $player_timeline = (array) sp_array_value( $team_timeline, $player_id, array() );
115
+ else:
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
  ?>
135
  $players = sp_array_between( (array)get_post_meta( $post_id, 'sp_player', false ), 0, $key );
136
  $players[] = -1;
137
  $data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
138
+
139
+ // Get team timeline
140
+ if ( is_array( $timeline ) ):
141
+ $team_timeline = (array) sp_array_value( $timeline, $team_id, array() );
142
+ else:
143
+ $team_timeline = false;
144
+ endif;
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 { ?>
157
  'posts_per_page' => 100,
158
  'orderby' => 'menu_order',
159
  'order' => 'ASC',
160
+ 'meta_query' => array(
161
+ 'relation' => 'OR',
162
+ array(
163
+ 'key' => 'sp_format',
164
+ 'value' => 'number',
165
+ 'compare' => 'NOT EXISTS',
166
+ ),
167
+ array(
168
+ 'key' => 'sp_format',
169
+ 'value' => 'equation',
170
+ 'compare' => '!=',
171
+ ),
172
+ ),
173
  );
174
 
175
+ $performances = get_posts( $args );
176
 
177
  $labels = array( array(), array() );
178
+ foreach ( $performances as $performance ):
179
+ $section = get_post_meta( $performance->ID, 'sp_section', true );
180
  if ( '' === $section ) {
181
  $section = -1;
182
  }
183
  switch ( $section ):
184
  case 1:
185
+ $labels[1][ $performance->post_name ] = $performance->post_title;
186
  break;
187
  default:
188
+ $labels[0][ $performance->post_name ] = $performance->post_title;
189
  endswitch;
190
  endforeach;
191
 
208
  $players[] = -1;
209
  $data[0] = $data[1] = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
210
  }
211
+
212
+ // Get team timeline
213
+ if ( is_array( $timeline ) ):
214
+ $team_timeline = (array) sp_array_value( $timeline, $team_id, array() );
215
+ else:
216
+ $team_timeline = false;
217
+ endif;
218
 
219
  // Determine order of sections
220
  if ( 1 == $sections ) {
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
  /**
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">
266
  }
267
  $data = $players;
268
  }
269
+
270
  foreach ( $data as $player_id => $player_performance ):
271
+
272
+ // Get player timeline
273
+ if ( is_array( $team_timeline ) ):
274
+ $player_timeline = (array) sp_array_value( $team_timeline, $player_id, array() );
275
+ else:
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
  ?>
283
  </tbody>
306
  </th>
307
  <?php } ?>
308
  <?php foreach ( $labels as $key => $label ): ?>
309
+ <?php if ( 'equation' === sp_array_value( $formats, $key, 'number' ) ) continue; ?>
310
  <th>
311
  <?php if ( $has_checkboxes ): ?>
312
  <label for="sp_columns_<?php echo $key; ?>">
348
  <td>&nbsp;</td>
349
  <?php } ?>
350
  <?php foreach( $labels as $column => $label ):
351
+ if ( 'equation' === sp_array_value( $formats, $column, 'number' ) ) continue;
352
  $player_id = 0;
353
  $player_performance = sp_array_value( $data, $player_id, array() );
354
  $value = sp_array_value( $player_performance, $column, '' );
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', '' );
412
  </td>
413
  <?php } ?>
414
  <?php foreach( $labels as $column => $label ):
415
+ if ( 'equation' === sp_array_value( $formats, $column, 'number' ) ) continue;
416
  $value = sp_array_value( $player_performance, $column, '' );
417
+ $intval = intval( $value );
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 ) ) {
426
+ $times = sp_array_value( $player_timeline, $column, array() );
427
+ } else {
428
+ $times = false;
429
+ }
430
+
431
+ if ( is_array( $times ) ) {
432
+ ?>
433
+ <hr>
434
+ <?php for ( $i = 0; $i < $intval; $i++ ) { ?><input class="sp-sync-input small-text" type="text" name="sp_timeline[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>][<?php echo $i; ?>]" value="<?php echo esc_attr( sp_array_value( $times, $i, '' ) ); ?>" placeholder="-" /><?php } ?>
435
+ <span class="description"><?php _e( 'mins', 'sportspress' ); ?></span>
436
+ <?php
437
+ }
438
+ }
439
+ ?>
440
  </td>
441
  <?php endforeach; ?>
442
  <?php if ( apply_filters( 'sportspress_event_performance_show_status', $status, $section ) ) { ?>
443
  <td class="sp-status-selector">
444
+ <?php
445
+ // Get substitute times
446
+ if ( is_array( $player_timeline ) ) {
447
+ $times = sp_array_value( $player_timeline, 'sub', array() );
448
+ } else {
449
+ $times = false;
450
+ }
451
+ ?>
452
  <?php echo self::status_select( $team_id, $player_id, sp_array_value( $player_performance, 'status', null ) ); ?>
453
  <?php echo self::sub_select( $team_id, $player_id, sp_array_value( $player_performance, 'sub', null ), $data ); ?>
454
+ <input class="sp-sync-input small-text" type="text" name="sp_timeline[<?php echo $team_id; ?>][<?php echo $player_id; ?>][sub][]" value="<?php echo esc_attr( sp_array_value( $times, 0, '' ) ); ?>" placeholder="-" />
455
+ <span class="description"><?php _e( 'mins', 'sportspress' ); ?></span>
456
  </td>
457
  <?php } ?>
458
  </tr>
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 1.9.19
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -95,12 +95,12 @@ class SP_Meta_Box_Event_Teams {
95
  );
96
  ?>
97
  <?php if ( $tabs ) { ?>
98
- <ul id="sp_team-tabs" class="wp-tab-bar sp-tab-bar">
99
  <?php
100
  $j = 0;
101
  foreach ( $tabs as $slug => $tab ) {
102
  ?>
103
- <li class="wp-tab<?php if ( 0 == $j ) { ?>-active<?php } ?>"><a href="#<?php echo $slug; ?>-all"><?php echo $tab['label']; ?></a></li>
104
  <?php
105
  $j++;
106
  }
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
95
  );
96
  ?>
97
  <?php if ( $tabs ) { ?>
98
+ <ul id="sp_team-tabs" class="sp-tab-bar category-tabs">
99
  <?php
100
  $j = 0;
101
  foreach ( $tabs as $slug => $tab ) {
102
  ?>
103
+ <li class="<?php if ( 0 == $j ) { ?>tabs<?php } ?>"><a href="#<?php echo $slug; ?>-all"><?php echo $tab['label']; ?></a></li>
104
  <?php
105
  $j++;
106
  }
includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 1.9.13
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -51,10 +51,10 @@ class SP_Meta_Box_List_Columns {
51
  </ul>
52
  <p><strong><?php _e( 'Data', 'sportspress' ); ?></strong></p>
53
  <div class="sp-instance">
54
- <ul id="sp_column-tabs" class="wp-tab-bar sp-tab-bar">
55
- <li class="wp-tab-active"><a href="#sp_performance-all"><?php _e( 'Performance', 'sportspress' ); ?></a></li>
56
- <li class="wp-tab"><a href="#sp_metric-all"><?php _e( 'Metrics', 'sportspress' ); ?></a></li>
57
- <li class="wp-tab"><a href="#sp_statistic-all"><?php _e( 'Statistics', 'sportspress' ); ?></a></li>
58
  </ul>
59
  <?php
60
  sp_column_checklist( $post->ID, 'sp_performance', 'block', $selected );
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
51
  </ul>
52
  <p><strong><?php _e( 'Data', 'sportspress' ); ?></strong></p>
53
  <div class="sp-instance">
54
+ <ul id="sp_column-tabs" class="sp-tab-bar category-tabs">
55
+ <li class="tabs"><a href="#sp_performance-all"><?php _e( 'Performance', 'sportspress' ); ?></a></li>
56
+ <li><a href="#sp_metric-all"><?php _e( 'Metrics', 'sportspress' ); ?></a></li>
57
+ <li><a href="#sp_statistic-all"><?php _e( 'Statistics', 'sportspress' ); ?></a></li>
58
  </ul>
59
  <?php
60
  sp_column_checklist( $post->ID, 'sp_performance', 'block', $selected );
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 1.9.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -22,6 +22,7 @@ class SP_Meta_Box_List_Details {
22
  $taxonomies = get_object_taxonomies( 'sp_list' );
23
  $caption = get_post_meta( $post->ID, 'sp_caption', true );
24
  $team_id = get_post_meta( $post->ID, 'sp_team', true );
 
25
  $grouping = get_post_meta( $post->ID, 'sp_grouping', true );
26
  $orderby = get_post_meta( $post->ID, 'sp_orderby', true );
27
  $order = get_post_meta( $post->ID, 'sp_order', true );
@@ -42,7 +43,7 @@ class SP_Meta_Box_List_Details {
42
  ?>
43
  <?php if ( apply_filters( 'sportspress_list_team_selector', true ) ) { ?>
44
  <p><strong><?php _e( 'Team', 'sportspress' ); ?></strong></p>
45
- <p class="sp-tab-select">
46
  <?php
47
  $args = array(
48
  'post_type' => 'sp_team',
@@ -55,6 +56,11 @@ class SP_Meta_Box_List_Details {
55
  sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
56
  endif;
57
  ?>
 
 
 
 
 
58
  </p>
59
  <?php } ?>
60
  <p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p>
@@ -110,6 +116,7 @@ class SP_Meta_Box_List_Details {
110
  public static function save( $post_id, $post ) {
111
  update_post_meta( $post_id, 'sp_caption', esc_attr( sp_array_value( $_POST, 'sp_caption', 0 ) ) );
112
  update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
 
113
  update_post_meta( $post_id, 'sp_grouping', sp_array_value( $_POST, 'sp_grouping', array() ) );
114
  update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array() ) );
115
  update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
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
22
  $taxonomies = get_object_taxonomies( 'sp_list' );
23
  $caption = get_post_meta( $post->ID, 'sp_caption', true );
24
  $team_id = get_post_meta( $post->ID, 'sp_team', true );
25
+ $era = get_post_meta( $post->ID, 'sp_era', true );
26
  $grouping = get_post_meta( $post->ID, 'sp_grouping', true );
27
  $orderby = get_post_meta( $post->ID, 'sp_orderby', true );
28
  $order = get_post_meta( $post->ID, 'sp_order', true );
43
  ?>
44
  <?php if ( apply_filters( 'sportspress_list_team_selector', true ) ) { ?>
45
  <p><strong><?php _e( 'Team', 'sportspress' ); ?></strong></p>
46
+ <p class="sp-tab-select sp-team-era-selector">
47
  <?php
48
  $args = array(
49
  'post_type' => 'sp_team',
56
  sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
57
  endif;
58
  ?>
59
+ <select name="sp_era">
60
+ <option value="all" <?php selected( 'all', $era ); ?>><?php _e( 'All', 'sportspress' ); ?></option>
61
+ <option value="current" <?php selected( 'current', $era ); ?>><?php _e( 'Current', 'sportspress' ); ?></option>
62
+ <option value="past" <?php selected( 'past', $era ); ?>><?php _e( 'Past', 'sportspress' ); ?></option>
63
+ </select>
64
  </p>
65
  <?php } ?>
66
  <p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p>
116
  public static function save( $post_id, $post ) {
117
  update_post_meta( $post_id, 'sp_caption', esc_attr( sp_array_value( $_POST, 'sp_caption', 0 ) ) );
118
  update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
119
+ update_post_meta( $post_id, 'sp_era', sp_array_value( $_POST, 'sp_era', array() ) );
120
  update_post_meta( $post_id, 'sp_grouping', sp_array_value( $_POST, 'sp_grouping', array() ) );
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() ) );
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.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -39,6 +39,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
39
  if ( '' === $format ) {
40
  $format = 'number';
41
  }
 
42
  ?>
43
  <p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
44
  <p>
@@ -60,13 +61,17 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
60
  <p class="sp-format-selector">
61
  <select name="sp_format">
62
  <?php
63
- $options = apply_filters( 'sportspress_performance_formats', array( 'number' => __( 'Number', 'sportspress' ), 'text' => __( 'Text', 'sportspress' ) ) );
64
  foreach ( $options as $key => $value ):
65
  printf( '<option value="%s" %s>%s</option>', $key, selected( $key == $format, true, false ), $value );
66
  endforeach;
67
  ?>
68
  </select>
69
  </p>
 
 
 
 
70
  <?php
71
  if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
72
  $visible = get_post_meta( $post->ID, 'sp_visible', true );
@@ -103,6 +108,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
103
  self::delete_duplicate( $_POST );
104
  update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) );
105
  update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
 
106
  if ( 'auto' === get_option( 'sportspress_player_columns', 'auto' ) ) {
107
  update_post_meta( $post_id, 'sp_visible', sp_array_value( $_POST, 'sp_visible', 1 ) );
108
  }
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
39
  if ( '' === $format ) {
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>
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 );
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
  }
includes/admin/post-types/meta-boxes/class-sp-meta-box-performance-equation.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Performance Equation
4
+ *
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
12
+
13
+ if ( ! class_exists( 'SP_Meta_Box_Equation' ) )
14
+ include( 'class-sp-meta-box-equation.php' );
15
+
16
+ /**
17
+ * SP_Meta_Box_Performance_Equation
18
+ */
19
+ class SP_Meta_Box_Performance_Equation extends SP_Meta_Box_Equation {
20
+
21
+ /**
22
+ * Output the metabox
23
+ */
24
+ public static function output( $post ) {
25
+ $equation = get_post_meta( $post->ID, 'sp_equation', true );
26
+ $groups = array( 'performance' );
27
+ self::builder( $post->post_title, $equation, $groups );
28
+ }
29
+ }
includes/admin/post-types/meta-boxes/class-sp-meta-box-player-columns.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
@@ -24,9 +24,9 @@ class SP_Meta_Box_Player_Columns {
24
  ?>
25
  <div class="sp-instance">
26
  <?php if ( $tabs ) { ?>
27
- <ul id="sp_column-tabs" class="wp-tab-bar sp-tab-bar">
28
  <?php foreach ( $tabs as $index => $post_type ) { $object = get_post_type_object( $post_type ); ?>
29
- <li class="wp-tab<?php if ( 0 == $index ) { ?>-active<?php } ?>"><a href="#<?php echo $post_type; ?>-all"><?php echo $object->labels->menu_name; ?></a></li>
30
  <?php } ?>
31
  </ul>
32
  <?php
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
24
  ?>
25
  <div class="sp-instance">
26
  <?php if ( $tabs ) { ?>
27
+ <ul id="sp_column-tabs" class="sp-tab-bar category-tabs">
28
  <?php foreach ( $tabs as $index => $post_type ) { $object = get_post_type_object( $post_type ); ?>
29
+ <li class="<?php if ( 0 == $index ) { ?>tabs<?php } ?>"><a href="#<?php echo $post_type; ?>-all"><?php echo $object->labels->menu_name; ?></a></li>
30
  <?php } ?>
31
  </ul>
32
  <?php
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.0.13
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -108,7 +108,7 @@ class SP_Meta_Box_Player_Statistics {
108
  <td>
109
  <label><strong><?php _e( 'Total', 'sportspress' ); ?></strong></label>
110
  </td>
111
- <?php if ( $team_select && apply_filters( 'sportspress_player_team_statistics', true ) ) { ?>
112
  <td>&nbsp;</td>
113
  <?php } ?>
114
  <?php foreach ( $columns as $column => $label ): if ( $column == 'team' ) continue;
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
108
  <td>
109
  <label><strong><?php _e( 'Total', 'sportspress' ); ?></strong></label>
110
  </td>
111
+ <?php if ( $team_select && apply_filters( 'sportspress_player_team_statistics', $league_id ) ) { ?>
112
  <td>&nbsp;</td>
113
  <?php } ?>
114
  <?php foreach ( $columns as $column => $label ): if ( $column == 'team' ) continue;
includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 1.9.13
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -92,7 +92,7 @@ class SP_Meta_Box_Team_Staff {
92
  else:
93
  ?>
94
  <tr class="sp-row alternate">
95
- <td colspan="4">
96
  <?php _e( 'No results found.', 'sportspress' ); ?>
97
  </td>
98
  </tr>
@@ -101,7 +101,7 @@ class SP_Meta_Box_Team_Staff {
101
  else:
102
  ?>
103
  <tr class="sp-row alternate">
104
- <td colspan="4">
105
  <?php printf( __( 'Select %s', 'sportspress' ), __( 'Details', 'sportspress' ) ); ?>
106
  </td>
107
  </tr>
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
92
  else:
93
  ?>
94
  <tr class="sp-row alternate">
95
+ <td colspan="5">
96
  <?php _e( 'No results found.', 'sportspress' ); ?>
97
  </td>
98
  </tr>
101
  else:
102
  ?>
103
  <tr class="sp-row alternate">
104
+ <td colspan="5">
105
  <?php printf( __( 'Select %s', 'sportspress' ), __( 'Details', 'sportspress' ) ); ?>
106
  </td>
107
  </tr>
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.0.13
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -23,15 +23,14 @@ class SP_Settings_Events extends SP_Settings_Page {
23
  public function __construct() {
24
  $this->id = 'events';
25
  $this->label = __( 'Events', 'sportspress' );
26
-
27
  $this->template = 'event';
28
- $this->templates = SP()->templates->event;
29
 
30
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
31
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
32
  add_action( 'sportspress_admin_field_current_mode', array( $this, 'current_mode_setting' ) );
33
  add_action( 'sportspress_admin_field_delimiter', array( $this, 'delimiter_setting' ) );
34
  add_action( 'sportspress_admin_field_event_layout', array( $this, 'layout_setting' ) );
 
35
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
36
  }
37
 
@@ -61,14 +60,17 @@ class SP_Settings_Events extends SP_Settings_Page {
61
  apply_filters( 'sportspress_event_template_options', array(
62
  array( 'type' => 'event_layout' ),
63
 
 
 
64
  array(
65
- 'title' => __( 'Display', 'sportspress' ),
66
  'desc' => __( 'Date', 'sportspress' ),
67
  'id' => 'sportspress_event_show_date',
68
  'default' => 'yes',
69
  'type' => 'checkbox',
70
  'checkboxgroup' => 'start',
71
  ),
 
72
  array(
73
  'desc' => __( 'Time', 'sportspress' ),
74
  'id' => 'sportspress_event_show_time',
@@ -76,6 +78,22 @@ class SP_Settings_Events extends SP_Settings_Page {
76
  'type' => 'checkbox',
77
  'checkboxgroup' => '',
78
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  ) ),
80
 
81
  array(
@@ -217,6 +235,17 @@ class SP_Settings_Events extends SP_Settings_Page {
217
  ),
218
 
219
  apply_filters( 'sportspress_event_logo_options', array(
 
 
 
 
 
 
 
 
 
 
 
220
  array(
221
  'title' => __( 'Display', 'sportspress' ),
222
  'desc' => __( 'Name', 'sportspress' ),
@@ -280,101 +309,115 @@ class SP_Settings_Events extends SP_Settings_Page {
280
  array( 'title' => __( 'Box Score', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'performance_options' ),
281
  ),
282
 
283
- apply_filters( 'sportspress_performance_options', array(
284
  array(
285
- 'title' => __( 'Rows', 'sportspress' ),
286
- 'desc' => __( 'Staff', 'sportspress' ),
287
- 'id' => 'sportspress_event_show_staff',
288
- 'default' => 'yes',
289
- 'type' => 'checkbox',
290
- 'checkboxgroup' => 'start',
291
- ),
 
292
 
293
- array(
294
- 'desc' => __( 'Players', 'sportspress' ),
295
- 'id' => 'sportspress_event_show_players',
296
- 'default' => 'yes',
297
- 'type' => 'checkbox',
298
- 'checkboxgroup' => '',
299
- ),
300
 
301
- array(
302
- 'desc' => __( 'Total', 'sportspress' ),
303
- 'id' => 'sportspress_event_show_total',
304
- 'default' => 'yes',
305
- 'type' => 'checkbox',
306
- 'checkboxgroup' => 'end',
307
- ),
308
 
309
- array(
310
- 'title' => __( 'Columns', 'sportspress' ),
311
- 'id' => 'sportspress_event_performance_columns',
312
- 'default' => 'auto',
313
- 'type' => 'radio',
314
- 'options' => array(
315
- 'auto' => __( 'Auto', 'sportspress' ),
316
- 'manual' => __( 'Manual', 'sportspress' ),
 
317
  ),
318
- ),
319
 
320
- array(
321
- 'title' => __( 'Mode', 'sportspress' ),
322
- 'id' => 'sportspress_event_performance_mode',
323
- 'default' => 'values',
324
- 'type' => 'radio',
325
- 'options' => array(
326
- 'values' => __( 'Values', 'sportspress' ),
327
- 'icons' => __( 'Icons', 'sportspress' ),
 
328
  ),
329
- ),
330
 
331
- array(
332
- 'title' => __( 'Positions', 'sportspress' ),
333
- 'desc' => __( 'Top-level only', 'sportspress' ),
334
- 'id' => 'sportspress_event_hide_child_positions',
335
- 'default' => 'no',
336
- 'type' => 'checkbox',
 
337
  ),
338
 
339
- array(
340
- 'title' => __( 'Players', 'sportspress' ),
341
- 'desc' => __( 'Display squad numbers', 'sportspress' ),
342
- 'id' => 'sportspress_event_show_player_numbers',
343
- 'default' => 'yes',
344
- 'type' => 'checkbox',
345
- 'checkboxgroup' => 'start',
346
- ),
347
-
348
- array(
349
- 'desc' => __( 'Display positions', 'sportspress' ),
350
- 'id' => 'sportspress_event_show_position',
351
- 'default' => 'yes',
352
- 'type' => 'checkbox',
353
- 'checkboxgroup' => '',
354
- ),
 
 
 
 
 
 
 
 
 
 
355
 
356
  array(
357
- 'title' => __( 'Performance', 'sportspress' ),
358
- 'id' => 'sportspress_event_performance_sections',
359
- 'default' => -1,
360
- 'type' => 'radio',
361
- 'options' => array(
362
- -1 => __( 'Combined', 'sportspress' ),
363
- 0 => __( 'Offense', 'sportspress' ) . ' &rarr; ' . __( 'Defense', 'sportspress' ),
364
- 1 => __( 'Defense', 'sportspress' ) . ' &rarr; ' . __( 'Offense', 'sportspress' ),
 
 
365
  ),
366
- ),
367
 
368
- array(
369
- 'title' => __( 'Total', 'sportspress' ),
370
- 'id' => 'sportspress_event_total_performance',
371
- 'default' => 'all',
372
- 'type' => 'radio',
373
- 'options' => array(
374
- 'all' => __( 'All', 'sportspress' ),
375
- 'primary' => __( 'Primary', 'sportspress' ),
 
376
  ),
377
- ),
378
  ) ),
379
 
380
  array(
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
23
  public function __construct() {
24
  $this->id = 'events';
25
  $this->label = __( 'Events', 'sportspress' );
 
26
  $this->template = 'event';
 
27
 
28
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
29
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
30
  add_action( 'sportspress_admin_field_current_mode', array( $this, 'current_mode_setting' ) );
31
  add_action( 'sportspress_admin_field_delimiter', array( $this, 'delimiter_setting' ) );
32
  add_action( 'sportspress_admin_field_event_layout', array( $this, 'layout_setting' ) );
33
+ add_action( 'sportspress_admin_field_event_tabs', array( $this, 'tabs_setting' ) );
34
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
35
  }
36
 
60
  apply_filters( 'sportspress_event_template_options', array(
61
  array( 'type' => 'event_layout' ),
62
 
63
+ array( 'type' => 'event_tabs' ),
64
+
65
  array(
66
+ 'title' => __( 'Details', 'sportspress' ),
67
  'desc' => __( 'Date', 'sportspress' ),
68
  'id' => 'sportspress_event_show_date',
69
  'default' => 'yes',
70
  'type' => 'checkbox',
71
  'checkboxgroup' => 'start',
72
  ),
73
+
74
  array(
75
  'desc' => __( 'Time', 'sportspress' ),
76
  'id' => 'sportspress_event_show_time',
78
  'type' => 'checkbox',
79
  'checkboxgroup' => '',
80
  ),
81
+
82
+ array(
83
+ 'desc' => __( 'Match Day', 'sportspress' ),
84
+ 'id' => 'sportspress_event_show_day',
85
+ 'default' => 'no',
86
+ 'type' => 'checkbox',
87
+ 'checkboxgroup' => '',
88
+ ),
89
+
90
+ array(
91
+ 'desc' => __( 'Full Time', 'sportspress' ),
92
+ 'id' => 'sportspress_event_show_full_time',
93
+ 'default' => 'no',
94
+ 'type' => 'checkbox',
95
+ 'checkboxgroup' => 'end',
96
+ ),
97
  ) ),
98
 
99
  array(
235
  ),
236
 
237
  apply_filters( 'sportspress_event_logo_options', array(
238
+ array(
239
+ 'title' => __( 'Layout', 'sportspress' ),
240
+ 'id' => 'sportspress_event_logos_format',
241
+ 'default' => 'inline',
242
+ 'type' => 'radio',
243
+ 'options' => array(
244
+ 'inline' => __( 'Inline', 'sportspress' ),
245
+ 'block' => __( 'Block', 'sportspress' ),
246
+ ),
247
+ ),
248
+
249
  array(
250
  'title' => __( 'Display', 'sportspress' ),
251
  'desc' => __( 'Name', 'sportspress' ),
309
  array( 'title' => __( 'Box Score', 'sportspress' ), 'type' => 'title', 'desc' => '', 'id' => 'performance_options' ),
310
  ),
311
 
312
+ apply_filters( 'sportspress_performance_options', array_merge(
313
  array(
314
+ array(
315
+ 'title' => __( 'Rows', 'sportspress' ),
316
+ 'desc' => __( 'Staff', 'sportspress' ),
317
+ 'id' => 'sportspress_event_show_staff',
318
+ 'default' => 'yes',
319
+ 'type' => 'checkbox',
320
+ 'checkboxgroup' => 'start',
321
+ ),
322
 
323
+ array(
324
+ 'desc' => __( 'Players', 'sportspress' ),
325
+ 'id' => 'sportspress_event_show_players',
326
+ 'default' => 'yes',
327
+ 'type' => 'checkbox',
328
+ 'checkboxgroup' => '',
329
+ ),
330
 
331
+ array(
332
+ 'desc' => __( 'Total', 'sportspress' ),
333
+ 'id' => 'sportspress_event_show_total',
334
+ 'default' => 'yes',
335
+ 'type' => 'checkbox',
336
+ 'checkboxgroup' => 'end',
337
+ ),
338
 
339
+ array(
340
+ 'title' => __( 'Columns', 'sportspress' ),
341
+ 'id' => 'sportspress_event_performance_columns',
342
+ 'default' => 'auto',
343
+ 'type' => 'radio',
344
+ 'options' => array(
345
+ 'auto' => __( 'Auto', 'sportspress' ),
346
+ 'manual' => __( 'Manual', 'sportspress' ),
347
+ ),
348
  ),
 
349
 
350
+ array(
351
+ 'title' => __( 'Mode', 'sportspress' ),
352
+ 'id' => 'sportspress_event_performance_mode',
353
+ 'default' => 'values',
354
+ 'type' => 'radio',
355
+ 'options' => array(
356
+ 'values' => __( 'Values', 'sportspress' ),
357
+ 'icons' => __( 'Icons', 'sportspress' ),
358
+ ),
359
  ),
 
360
 
361
+ array(
362
+ 'title' => __( 'Positions', 'sportspress' ),
363
+ 'desc' => __( 'Top-level only', 'sportspress' ),
364
+ 'id' => 'sportspress_event_hide_child_positions',
365
+ 'default' => 'no',
366
+ 'type' => 'checkbox',
367
+ ),
368
  ),
369
 
370
+ apply_filters( 'sportspress_event_performance_display_options', array(
371
+ array(
372
+ 'title' => __( 'Display', 'sportspress' ),
373
+ 'desc' => __( 'Squad Number', 'sportspress' ),
374
+ 'id' => 'sportspress_event_show_player_numbers',
375
+ 'default' => 'yes',
376
+ 'type' => 'checkbox',
377
+ 'checkboxgroup' => 'start',
378
+ ),
379
+
380
+ array(
381
+ 'desc' => __( 'Position', 'sportspress' ),
382
+ 'id' => 'sportspress_event_show_position',
383
+ 'default' => 'yes',
384
+ 'type' => 'checkbox',
385
+ 'checkboxgroup' => '',
386
+ ),
387
+
388
+ array(
389
+ 'desc' => __( 'Minutes', 'sportspress' ),
390
+ 'id' => 'sportspress_event_performance_show_minutes',
391
+ 'default' => 'yes',
392
+ 'type' => 'checkbox',
393
+ 'checkboxgroup' => 'end',
394
+ ),
395
+ ) ),
396
 
397
  array(
398
+ array(
399
+ 'title' => __( 'Performance', 'sportspress' ),
400
+ 'id' => 'sportspress_event_performance_sections',
401
+ 'default' => -1,
402
+ 'type' => 'radio',
403
+ 'options' => array(
404
+ -1 => __( 'Combined', 'sportspress' ),
405
+ 0 => __( 'Offense', 'sportspress' ) . ' &rarr; ' . __( 'Defense', 'sportspress' ),
406
+ 1 => __( 'Defense', 'sportspress' ) . ' &rarr; ' . __( 'Offense', 'sportspress' ),
407
+ ),
408
  ),
 
409
 
410
+ array(
411
+ 'title' => __( 'Total', 'sportspress' ),
412
+ 'id' => 'sportspress_event_total_performance',
413
+ 'default' => 'all',
414
+ 'type' => 'radio',
415
+ 'options' => array(
416
+ 'all' => __( 'All', 'sportspress' ),
417
+ 'primary' => __( 'Primary', 'sportspress' ),
418
+ ),
419
  ),
420
+ )
421
  ) ),
422
 
423
  array(
includes/admin/settings/class-sp-settings-licenses.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * SportsPress License Settings
4
+ *
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
12
+
13
+ if ( ! class_exists( 'SP_Settings_Licenses' ) ) :
14
+
15
+ /**
16
+ * SP_Settings_Licenses
17
+ */
18
+ class SP_Settings_Licenses extends SP_Settings_Page {
19
+
20
+ /**
21
+ * @var array
22
+ */
23
+ public $licenses = array();
24
+
25
+ /**
26
+ * Constructor
27
+ */
28
+ public function __construct() {
29
+ $this->id = 'licenses';
30
+ $this->label = __( 'Licenses', 'sportspress' );
31
+
32
+ $this->licenses = apply_filters( 'sportspress_licenses', array(
33
+ 'pro' => array(
34
+ 'name' => 'SportsPress Pro',
35
+ 'url' => 'https://account.themeboy.com',
36
+ ),
37
+ ));
38
+
39
+ if ( sizeof ( $this->licenses ) <= 1 )
40
+ return;
41
+
42
+ add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
43
+ add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
44
+ add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
45
+ }
46
+
47
+ /**
48
+ * Output licenses
49
+ *
50
+ * @access public
51
+ * @return void
52
+ */
53
+ public function output() {
54
+ ?>
55
+ <?php wp_nonce_field( 'sp_license_nonce', 'sp_license_nonce' ); ?>
56
+ <div class="sp-modules-wrapper">
57
+ <div class="sp-modules-main">
58
+ <?php
59
+ foreach ( $this->licenses as $id => $license ) {
60
+ $key = get_site_option( 'sportspress_' . $id . '_license_key' );
61
+ $key = trim( $key );
62
+ $status = get_site_option( 'sportspress_' . $id . '_license_status', false );
63
+ ?>
64
+ <div class="sp-settings-section sp-settings-section-license_options">
65
+ <h3><?php echo $license['name']; ?></h3>
66
+ <table class="form-table sp-licenses-table">
67
+ <tbody>
68
+ <tr>
69
+ <th scope="row" class="titledesc">
70
+ <?php _e( 'License Key', 'sportspress' ); ?>
71
+ <?php if ( $key && $status && 'valid' == $status ) { ?>
72
+ <i class="dashicons dashicons-yes sp-desc-active"></i>
73
+ <?php } else { ?>
74
+ <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'Enter the license key from your purchase receipt.', 'sportspress' ); ?>"></i>
75
+ <?php } ?>
76
+ </th>
77
+ <td>
78
+ <?php if ( false !== $status && 'valid' == $status ) { ?>
79
+ <p>
80
+ <input type="text" name="sp_license_key_<?php echo $id; ?>" size="40" value="<?php esc_attr_e( $key ); ?>" readonly="readonly">
81
+ <input name="sp_license_deactivate_<?php echo $id; ?>" class="button button-secondary button-small" type="submit" value="<?php esc_attr_e( 'Deactivate', 'sportspress' ); ?>" />
82
+ </p>
83
+ <?php } else { ?>
84
+ <p>
85
+ <input type="text" name="sp_license_key_<?php echo $id; ?>" size="40">
86
+ <input name="sp_license_activate_<?php echo $id; ?>" class="button button-primary button-small" type="submit" value="<?php esc_attr_e( 'Activate', 'sportspress' ); ?>" />
87
+ </p>
88
+ <?php } ?>
89
+ </td>
90
+ </tr>
91
+ </tbody>
92
+ </table>
93
+ </div>
94
+ <?php } ?>
95
+ </div>
96
+ </div>
97
+ <?php
98
+
99
+ $GLOBALS['hide_save_button'] = true;
100
+ }
101
+
102
+ /**
103
+ * Save license
104
+ */
105
+ public function save() {
106
+ // run a quick security check
107
+ if ( ! check_admin_referer( 'sp_license_nonce', 'sp_license_nonce' ) ) {
108
+ return;
109
+ }
110
+
111
+ foreach ( $_POST as $name => $value ) {
112
+ if ( 'sp_license_activate_' === substr( $name, 0, 20 ) ) {
113
+ $this->activate( substr( $name, 20 ) );
114
+ } elseif ( 'sp_license_deactivate_' === substr( $name, 0, 22 ) ) {
115
+ $this->deactivate( substr( $name, 22 ) );
116
+ }
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Activate license
122
+ */
123
+ public function activate( $id ) {
124
+
125
+ // return if a license key isn't set
126
+ if ( ! isset( $_POST[ 'sp_license_key_' . $id ] ) )
127
+ return;
128
+
129
+ // retrieve the license key
130
+ $license = trim( $_POST[ 'sp_license_key_' . $id ] );
131
+
132
+ // get the name of the product
133
+ $name = $this->licenses[ $id ]['name'];
134
+
135
+ // data to send in our API request
136
+ $api_params = array(
137
+ 'edd_action'=> 'activate_license',
138
+ 'license' => $license,
139
+ 'item_name' => urlencode( $name ), // the name of our product in EDD
140
+ 'url' => home_url()
141
+ );
142
+
143
+ // Call the custom API.
144
+ $response = wp_remote_post( $this->licenses[ $id ]['url'], array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
145
+
146
+ // Make sure the response came back okay
147
+ if ( is_wp_error( $response ) ) {
148
+ SP_Admin_Settings::add_error( __( 'Sorry, there has been an error.', 'sportspress' ) );
149
+ return false;
150
+ }
151
+
152
+ // Decode the license data
153
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
154
+
155
+ // Update license status
156
+ update_site_option( 'sportspress_' . $id . '_license_status', $license_data->license );
157
+
158
+ // Update License or display error
159
+ if ( 'valid' == $license_data->license ) {
160
+ update_site_option( 'sportspress_' . $id . '_license_key', $license );
161
+ SP_Admin_Settings::add_override( __( 'License activated.', 'sportspress' ) );
162
+ } else {
163
+ SP_Admin_Settings::add_error( __( 'License invalid.', 'sportspress' ) );
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Deactivate license
169
+ */
170
+ public function deactivate( $id ) {
171
+
172
+ // return if a license key isn't set
173
+ if ( ! isset( $_POST[ 'sp_license_key_' . $id ] ) )
174
+ return;
175
+
176
+ // retrieve the license key
177
+ $license = trim( $_POST[ 'sp_license_key_' . $id ] );
178
+
179
+ // get the name of the product
180
+ $name = $this->licenses[ $id ]['name'];
181
+
182
+ // data to send in our API request
183
+ $api_params = array(
184
+ 'edd_action'=> 'deactivate_license',
185
+ 'license' => $license,
186
+ 'item_name' => urlencode( $name ), // the name of our product in EDD
187
+ 'url' => home_url()
188
+ );
189
+
190
+ // Call the custom API.
191
+ $response = wp_remote_post( $this->licenses[ $id ]['url'], array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
192
+
193
+ // make sure the response came back okay
194
+ if ( is_wp_error( $response ) ) {
195
+ SP_Admin_Settings::add_error( __( 'Sorry, there has been an error.', 'sportspress' ) );
196
+ return false;
197
+ }
198
+
199
+ // decode the license data
200
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
201
+
202
+ // $license_data->license will be either "deactivated" or "failed"
203
+ if ( $license_data->license == 'deactivated' ) {
204
+ delete_site_option( 'sportspress_' . $id . '_license_status' );
205
+ SP_Admin_Settings::add_override( __( 'License deactivated.', 'sportspress' ) );
206
+ } else {
207
+ SP_Admin_Settings::add_error( __( 'Sorry, there has been an error.', 'sportspress' ) );
208
+ }
209
+ }
210
+ }
211
+
212
+ endif;
213
+
214
+ return new SP_Settings_Licenses();
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 1.9.17
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -157,8 +157,6 @@ class SP_Settings_Modules extends SP_Settings_Page {
157
  'http://tboy.co/installation' => __( 'Getting Started', 'sportspress' ),
158
  'http://tboy.co/manuals' => __( 'Manuals', 'sportspress' ),
159
  'http://tboy.co/videos' => __( 'Videos', 'sportspress' ),
160
- 'http://tboy.co/developers' => __( 'Developers', 'sportspress' ),
161
- 'http://tboy.co/integration' => __( 'Theme Integration Guide', 'sportspress' ),
162
  ),
163
  ),
164
  'help' => array(
@@ -179,6 +177,15 @@ class SP_Settings_Modules extends SP_Settings_Page {
179
  'http://tboy.co/gplus' => __( 'Google+', 'sportspress' ),
180
  ),
181
  ),
 
 
 
 
 
 
 
 
 
182
  );
183
 
184
  if ( class_exists( 'SportsPress_Pro' ) ) {
@@ -261,8 +268,10 @@ class SP_Settings_Modules extends SP_Settings_Page {
261
  </table>
262
  <?php } ?>
263
 
264
- <input name="save" class="button-primary" type="submit" value="<?php _e( 'Save Changes', 'sportspress' ); ?>" />
265
- <?php $GLOBALS['hide_save_button'] = true; ?>
 
 
266
  </div>
267
  </div>
268
 
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
157
  'http://tboy.co/installation' => __( 'Getting Started', 'sportspress' ),
158
  'http://tboy.co/manuals' => __( 'Manuals', 'sportspress' ),
159
  'http://tboy.co/videos' => __( 'Videos', 'sportspress' ),
 
 
160
  ),
161
  ),
162
  'help' => array(
177
  'http://tboy.co/gplus' => __( 'Google+', 'sportspress' ),
178
  ),
179
  ),
180
+ 'developers' => array(
181
+ 'icon' => 'dashicons dashicons-editor-code',
182
+ 'label' => __( 'Developers', 'sportspress' ),
183
+ 'links' => array(
184
+ 'http://tboy.co/developers' => __( 'Reference', 'sportspress' ),
185
+ 'http://tboy.co/slack' => __( 'Slack', 'sportspress' ),
186
+ 'http://tboy.co/github' => __( 'GitHub', 'sportspress' ),
187
+ ),
188
+ ),
189
  );
190
 
191
  if ( class_exists( 'SportsPress_Pro' ) ) {
268
  </table>
269
  <?php } ?>
270
 
271
+ <p class="submit">
272
+ <input name="save" class="button button-primary" type="submit" value="<?php _e( 'Save Changes', 'sportspress' ); ?>" />
273
+ <?php $GLOBALS['hide_save_button'] = true; ?>
274
+ </p>
275
  </div>
276
  </div>
277
 
includes/admin/settings/class-sp-settings-page.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -20,7 +20,6 @@ class SP_Settings_Page {
20
  protected $id = '';
21
  protected $label = '';
22
  protected $template = '';
23
- public $templates = array();
24
  /**
25
  * Add this page to settings
26
  */
@@ -39,6 +38,17 @@ class SP_Settings_Page {
39
  return array();
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Output the settings
44
  */
@@ -60,7 +70,8 @@ class SP_Settings_Page {
60
  if ( $current_section )
61
  do_action( 'sportspress_update_options_' . $this->template . '_' . $current_section );
62
 
63
- if ( ! empty( $this->templates ) )
 
64
  update_option( 'sportspress_' . $this->template . '_template_order', sp_array_value( $_POST, 'sportspress_' . $this->template . '_template_order', false ) );
65
 
66
  if ( isset( $_POST['sportspress_template_visibility'] ) && is_array( $_POST['sportspress_template_visibility'] ) ) {
@@ -82,7 +93,8 @@ class SP_Settings_Page {
82
  * @return void
83
  */
84
  public function layout_setting() {
85
- $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $this->templates );
 
86
 
87
  $layout = get_option( 'sportspress_' . $this->template . '_template_order' );
88
  if ( false === $layout ) {
@@ -90,6 +102,11 @@ class SP_Settings_Page {
90
  }
91
 
92
  $templates = array_merge( array_flip( $layout ), $templates );
 
 
 
 
 
93
  ?>
94
  <tr valign="top">
95
  <th>
@@ -97,8 +114,65 @@ class SP_Settings_Page {
97
  </th>
98
  <td class="sp-sortable-list-container">
99
  <p class="description"><?php _e( 'Drag each item into the order you prefer.', 'sportspress' ); ?></p>
100
-
101
- <ul class="sp-layout sp-sortable-list ui-sortable">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  <?php foreach ( $templates as $template => $details ) {
103
  if ( ! is_array( $details ) ) continue;
104
  $option = sp_array_value( $details, 'option', 'sportspress_' . $this->template . '_show_' . $template );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.1.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
20
  protected $id = '';
21
  protected $label = '';
22
  protected $template = '';
 
23
  /**
24
  * Add this page to settings
25
  */
38
  return array();
39
  }
40
 
41
+ /**
42
+ * Templates
43
+ *
44
+ * @return array
45
+ */
46
+ public function templates() {
47
+ if ( ! isset( $this->template ) ) return array();
48
+ $template = $this->template;
49
+ return SP()->templates->$template;
50
+ }
51
+
52
  /**
53
  * Output the settings
54
  */
70
  if ( $current_section )
71
  do_action( 'sportspress_update_options_' . $this->template . '_' . $current_section );
72
 
73
+ $templates = $this->templates();
74
+ if ( ! empty( $templates ) )
75
  update_option( 'sportspress_' . $this->template . '_template_order', sp_array_value( $_POST, 'sportspress_' . $this->template . '_template_order', false ) );
76
 
77
  if ( isset( $_POST['sportspress_template_visibility'] ) && is_array( $_POST['sportspress_template_visibility'] ) ) {
93
  * @return void
94
  */
95
  public function layout_setting() {
96
+ $templates = $this->templates();
97
+ $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates );
98
 
99
  $layout = get_option( 'sportspress_' . $this->template . '_template_order' );
100
  if ( false === $layout ) {
102
  }
103
 
104
  $templates = array_merge( array_flip( $layout ), $templates );
105
+
106
+ $slice = array_search( 'tabs', array_keys( $templates ) );
107
+ if ( $slice ) {
108
+ $templates = array_slice( $templates, 0, $slice );
109
+ }
110
  ?>
111
  <tr valign="top">
112
  <th>
114
  </th>
115
  <td class="sp-sortable-list-container">
116
  <p class="description"><?php _e( 'Drag each item into the order you prefer.', 'sportspress' ); ?></p>
117
+
118
+ <ul class="sp-layout sp-sortable-list sp-connected-list ui-sortable">
119
+ <?php foreach ( $templates as $template => $details ) {
120
+ if ( ! is_array( $details ) ) continue;
121
+ $option = sp_array_value( $details, 'option', 'sportspress_' . $this->template . '_show_' . $template );
122
+ $visibility = get_option( $option, sp_array_value( $details, 'default', 'yes' ) );
123
+ ?>
124
+ <li>
125
+ <div class="sp-item-bar sp-layout-item-bar">
126
+ <div class="sp-item-handle sp-layout-item-handle ui-sortable-handle">
127
+ <span class="sp-item-title item-title"><?php echo sp_array_value( $details, 'title', ucfirst( $template ) ); ?></span>
128
+ <input type="hidden" name="sportspress_<?php echo $this->template; ?>_template_order[]" value="<?php echo $template; ?>">
129
+ </div>
130
+
131
+ <input type="hidden" name="sportspress_template_visibility[<?php echo $option; ?>]" value="0">
132
+ <input class="sp-toggle-switch" type="checkbox" name="sportspress_template_visibility[<?php echo $option; ?>]" id="<?php echo $option; ?>" value="1" <?php checked( $visibility, 'yes' ); ?>>
133
+ <label for="sportspress_<?php echo $this->template; ?>_show_<?php echo $template; ?>"></label>
134
+ </div>
135
+ </li>
136
+ <?php } ?>
137
+ </ul>
138
+ </td>
139
+ </tr>
140
+ <?php
141
+ }
142
+
143
+ /**
144
+ * Tabs settings
145
+ *
146
+ * @access public
147
+ * @return void
148
+ */
149
+ public function tabs_setting() {
150
+ $templates = $this->templates();
151
+ $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates );
152
+
153
+ $layout = get_option( 'sportspress_' . $this->template . '_template_order' );
154
+ if ( false === $layout ) {
155
+ $layout = array_keys( $templates );
156
+ }
157
+
158
+ $templates = array_merge( array_flip( $layout ), $templates );
159
+
160
+ $slice = array_search( 'tabs', array_keys( $templates ) );
161
+ if ( $slice ) {
162
+ $templates = array_slice( $templates, $slice );
163
+ } else {
164
+ $templates = array();
165
+ }
166
+ ?>
167
+ <tr valign="top">
168
+ <th>
169
+ <?php _e( 'Tabs', 'sportspress' ); ?>
170
+ </th>
171
+ <td class="sp-sortable-list-container">
172
+ <p class="description"><?php _e( 'Drag items here to display them as tabs.', 'sportspress' ); ?></p>
173
+ <input type="hidden" name="sportspress_<?php echo $this->template; ?>_template_order[]" value="tabs">
174
+
175
+ <ul class="sp-layout sp-sortable-list sp-connected-list ui-sortable">
176
  <?php foreach ( $templates as $template => $details ) {
177
  if ( ! is_array( $details ) ) continue;
178
  $option = sp_array_value( $details, 'option', 'sportspress_' . $this->template . '_show_' . $template );
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.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -23,13 +23,12 @@ class SP_Settings_Players extends SP_Settings_Page {
23
  public function __construct() {
24
  $this->id = 'players';
25
  $this->label = __( 'Players', 'sportspress' );
26
-
27
  $this->template = 'player';
28
- $this->templates = SP()->templates->player;
29
 
30
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
31
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
32
  add_action( 'sportspress_admin_field_player_layout', array( $this, 'layout_setting' ) );
 
33
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
34
  }
35
 
@@ -48,6 +47,8 @@ class SP_Settings_Players extends SP_Settings_Page {
48
  apply_filters( 'sportspress_player_options', array(
49
  array( 'type' => 'player_layout' ),
50
 
 
 
51
  array(
52
  'title' => __( 'Link', 'sportspress' ),
53
  'desc' => __( 'Link players', 'sportspress' ),
@@ -58,11 +59,27 @@ class SP_Settings_Players extends SP_Settings_Page {
58
 
59
  array(
60
  'title' => __( 'Details', 'sportspress' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  'desc' => __( 'Nationality', 'sportspress' ),
62
  'id' => 'sportspress_player_show_nationality',
63
  'default' => 'yes',
64
  'type' => 'checkbox',
65
- 'checkboxgroup' => 'start',
66
  ),
67
 
68
  array(
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
23
  public function __construct() {
24
  $this->id = 'players';
25
  $this->label = __( 'Players', 'sportspress' );
 
26
  $this->template = 'player';
 
27
 
28
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
29
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
30
  add_action( 'sportspress_admin_field_player_layout', array( $this, 'layout_setting' ) );
31
+ add_action( 'sportspress_admin_field_player_tabs', array( $this, 'tabs_setting' ) );
32
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
33
  }
34
 
47
  apply_filters( 'sportspress_player_options', array(
48
  array( 'type' => 'player_layout' ),
49
 
50
+ array( 'type' => 'player_tabs' ),
51
+
52
  array(
53
  'title' => __( 'Link', 'sportspress' ),
54
  'desc' => __( 'Link players', 'sportspress' ),
59
 
60
  array(
61
  'title' => __( 'Details', 'sportspress' ),
62
+ 'desc' => __( 'Squad Number', 'sportspress' ),
63
+ 'id' => 'sportspress_player_show_number',
64
+ 'default' => 'no',
65
+ 'type' => 'checkbox',
66
+ 'checkboxgroup' => 'start',
67
+ ),
68
+
69
+ array(
70
+ 'desc' => __( 'Name', 'sportspress' ),
71
+ 'id' => 'sportspress_player_show_name',
72
+ 'default' => 'no',
73
+ 'type' => 'checkbox',
74
+ 'checkboxgroup' => '',
75
+ ),
76
+
77
+ array(
78
  'desc' => __( 'Nationality', 'sportspress' ),
79
  'id' => 'sportspress_player_show_nationality',
80
  'default' => 'yes',
81
  'type' => 'checkbox',
82
+ 'checkboxgroup' => '',
83
  ),
84
 
85
  array(
includes/admin/settings/class-sp-settings-staff.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -23,13 +23,12 @@ class SP_Settings_Staff extends SP_Settings_Page {
23
  public function __construct() {
24
  $this->id = 'staff';
25
  $this->label = __( 'Staff', 'sportspress' );
26
-
27
  $this->template = 'staff';
28
- $this->templates = SP()->templates->staff;
29
 
30
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
31
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
32
  add_action( 'sportspress_admin_field_staff_layout', array( $this, 'layout_setting' ) );
 
33
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
34
  }
35
 
@@ -48,6 +47,8 @@ class SP_Settings_Staff extends SP_Settings_Page {
48
  apply_filters( 'sportspress_staff_options', array(
49
  array( 'type' => 'staff_layout' ),
50
 
 
 
51
  array(
52
  'title' => __( 'Link', 'sportspress' ),
53
  'desc' => __( 'Link staff', 'sportspress' ),
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
23
  public function __construct() {
24
  $this->id = 'staff';
25
  $this->label = __( 'Staff', 'sportspress' );
 
26
  $this->template = 'staff';
 
27
 
28
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
29
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
30
  add_action( 'sportspress_admin_field_staff_layout', array( $this, 'layout_setting' ) );
31
+ add_action( 'sportspress_admin_field_staff_tabs', array( $this, 'tabs_setting' ) );
32
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
33
  }
34
 
47
  apply_filters( 'sportspress_staff_options', array(
48
  array( 'type' => 'staff_layout' ),
49
 
50
+ array( 'type' => 'staff_tabs' ),
51
+
52
  array(
53
  'title' => __( 'Link', 'sportspress' ),
54
  'desc' => __( 'Link staff', 'sportspress' ),
includes/admin/settings/class-sp-settings-teams.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.0
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -23,13 +23,12 @@ class SP_Settings_Teams extends SP_Settings_Page {
23
  public function __construct() {
24
  $this->id = 'teams';
25
  $this->label = __( 'Teams', 'sportspress' );
26
-
27
  $this->template = 'team';
28
- $this->templates = SP()->templates->team;
29
 
30
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
31
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
32
  add_action( 'sportspress_admin_field_team_layout', array( $this, 'layout_setting' ) );
 
33
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
34
  }
35
 
@@ -49,6 +48,8 @@ class SP_Settings_Teams extends SP_Settings_Page {
49
  apply_filters( 'sportspress_team_options', array(
50
  array( 'type' => 'team_layout' ),
51
 
 
 
52
  array(
53
  'title' => __( 'Link', 'sportspress' ),
54
  'desc' => __( 'Link teams', 'sportspress' ),
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
23
  public function __construct() {
24
  $this->id = 'teams';
25
  $this->label = __( 'Teams', 'sportspress' );
 
26
  $this->template = 'team';
 
27
 
28
  add_filter( 'sportspress_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
29
  add_action( 'sportspress_settings_' . $this->id, array( $this, 'output' ) );
30
  add_action( 'sportspress_admin_field_team_layout', array( $this, 'layout_setting' ) );
31
+ add_action( 'sportspress_admin_field_team_tabs', array( $this, 'tabs_setting' ) );
32
  add_action( 'sportspress_settings_save_' . $this->id, array( $this, 'save' ) );
33
  }
34
 
48
  apply_filters( 'sportspress_team_options', array(
49
  array( 'type' => 'team_layout' ),
50
 
51
+ array( 'type' => 'team_tabs' ),
52
+
53
  array(
54
  'title' => __( 'Link', 'sportspress' ),
55
  'desc' => __( 'Link teams', 'sportspress' ),
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.0
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @package SportsPress/API
@@ -28,12 +28,21 @@ class SP_REST_API {
28
  // Create REST routes
29
  add_action( 'rest_api_init', array( $this, 'create_routes' ) );
30
  add_action( 'rest_api_init', array( $this, 'register_fields' ), 0 );
 
 
 
 
 
 
 
31
  }
32
 
33
  /**
34
  * Create REST routes.
35
  */
36
  public static function create_routes() {
 
 
37
  if ( ! class_exists( 'SP_REST_Posts_Controller' ) ) {
38
  require_once dirname( __FILE__ ) . '/class-sp-rest-posts-controller.php';
39
  }
@@ -57,6 +66,8 @@ class SP_REST_API {
57
  * Register REST fields.
58
  */
59
  public static function register_fields() {
 
 
60
  register_rest_field( 'sp_event',
61
  'teams',
62
  array(
@@ -150,6 +161,38 @@ class SP_REST_API {
150
  )
151
  );
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  register_rest_field( 'sp_event',
154
  'staff',
155
  array(
@@ -724,6 +767,8 @@ class SP_REST_API {
724
  'past_teams' => 'sp_past_team',
725
  'performance' => 'sp_players',
726
  'players' => 'sp_player',
 
 
727
  'table' => 'sp_teams',
728
  'tables' => 'sp_table',
729
  'teams' => 'sp_team',
@@ -750,6 +795,31 @@ class SP_REST_API {
750
 
751
  return $field_name;
752
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
753
  }
754
 
755
  endif;
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
28
  // Create REST routes
29
  add_action( 'rest_api_init', array( $this, 'create_routes' ) );
30
  add_action( 'rest_api_init', array( $this, 'register_fields' ), 0 );
31
+
32
+ // Add filter for post meta query
33
+ add_filter( 'rest_query_vars', array( $this, 'meta_query' ) );
34
+
35
+ // Add filters to query scheduled events
36
+ add_filter( 'rest_sp_event_query', array( $this, 'event_query' ) );
37
+ add_filter( 'rest_query_vars', array( $this, 'query_vars' ) );
38
  }
39
 
40
  /**
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
  }
66
  * Register REST fields.
67
  */
68
  public static function register_fields() {
69
+ if ( ! function_exists( 'register_rest_field' ) ) return;
70
+
71
  register_rest_field( 'sp_event',
72
  'teams',
73
  array(
161
  )
162
  );
163
 
164
+ register_rest_field( 'sp_event',
165
+ 'offense',
166
+ array(
167
+ 'get_callback' => 'SP_REST_API::get_post_meta_recursive',
168
+ 'update_callback' => 'SP_REST_API::update_post_meta_recursive',
169
+ 'schema' => array(
170
+ 'description' => __( 'Offense', 'sportspress' ),
171
+ 'type' => 'array',
172
+ 'context' => array( 'view', 'edit' ),
173
+ 'arg_options' => array(
174
+ 'sanitize_callback' => 'rest_sanitize_request_arg',
175
+ ),
176
+ ),
177
+ )
178
+ );
179
+
180
+ register_rest_field( 'sp_event',
181
+ 'defense',
182
+ array(
183
+ 'get_callback' => 'SP_REST_API::get_post_meta_recursive',
184
+ 'update_callback' => 'SP_REST_API::update_post_meta_recursive',
185
+ 'schema' => array(
186
+ 'description' => __( 'Defense', 'sportspress' ),
187
+ 'type' => 'array',
188
+ 'context' => array( 'view', 'edit' ),
189
+ 'arg_options' => array(
190
+ 'sanitize_callback' => 'rest_sanitize_request_arg',
191
+ ),
192
+ ),
193
+ )
194
+ );
195
+
196
  register_rest_field( 'sp_event',
197
  'staff',
198
  array(
767
  'past_teams' => 'sp_past_team',
768
  'performance' => 'sp_players',
769
  'players' => 'sp_player',
770
+ 'offense' => 'sp_offense',
771
+ 'defense' => 'sp_defense',
772
  'table' => 'sp_teams',
773
  'tables' => 'sp_table',
774
  'teams' => 'sp_team',
795
 
796
  return $field_name;
797
  }
798
+
799
+ /**
800
+ * Enable meta query vars
801
+ */
802
+ public static function meta_query( $valid_vars ) {
803
+ $valid_vars = array_merge( $valid_vars, array( 'meta_key', 'meta_value', 'meta_query' ) );
804
+ return $valid_vars;
805
+ }
806
+
807
+ /**
808
+ * Add scheduled events to query
809
+ */
810
+ public static function event_query( $args ) {
811
+ $args['post_status'] = array( 'publish', 'future' );
812
+ return $args;
813
+ }
814
+
815
+ /**
816
+ * Enable post status in events query
817
+ */
818
+ public static function query_vars( $vars ) {
819
+ global $wp;
820
+ $vars[] = 'post_status';
821
+ return $vars;
822
+ }
823
  }
824
 
825
  endif;
includes/class-sp-ajax.php CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
  * AJAX Event Handler
9
  *
10
  * @class SP_AJAX
11
- * @version 2.0
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
@@ -269,6 +269,12 @@ class SP_AJAX {
269
  ?>
270
  </label>
271
  </p>
 
 
 
 
 
 
272
  <p>
273
  <label>
274
  <?php _e( 'Display link to view all events', 'sportspress' ); ?>
@@ -391,6 +397,12 @@ class SP_AJAX {
391
  </select>
392
  </label>
393
  </p>
 
 
 
 
 
 
394
  <p>
395
  <label>
396
  <?php _e( 'Number of events to show:', 'sportspress' ); ?>
@@ -548,12 +560,28 @@ class SP_AJAX {
548
  </select>
549
  </label>
550
  </p>
 
 
 
 
 
 
551
  <p>
552
  <label>
553
  <?php _e( 'Number of events to show:', 'sportspress' ); ?>
554
  <input type="text" size="3" name="number" id="number" value="5">
555
  </label>
556
  </p>
 
 
 
 
 
 
 
 
 
 
557
  <p>
558
  <label>
559
  <?php _e( 'Sort Order:', 'sportspress' ); ?>
@@ -760,6 +788,9 @@ class SP_AJAX {
760
  $field_name = 'columns[]';
761
  $field_id = 'columns';
762
  ?>
 
 
 
763
  <?php foreach ( $the_columns as $column ): ?>
764
  <label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>" checked="checked"><?php echo $column->post_title; ?></label>
765
  <?php endforeach; ?>
@@ -912,6 +943,7 @@ class SP_AJAX {
912
  args.season = $div.find('[name=season]').val();
913
  args.venue = $div.find('[name=venue]').val();
914
  args.status = $div.find('[name=status]').val();
 
915
  args.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length;
916
  } else if ( 'event_list' == type ) {
917
  args.title = $div.find('[name=title]').val();
@@ -921,6 +953,7 @@ class SP_AJAX {
921
  args.venue = $div.find('[name=venue]').val();
922
  args.status = $div.find('[name=status]').val();
923
  args.date = $div.find('[name=date]').val();
 
924
  args.number = $div.find('[name=number]').val();
925
  args.order = $div.find('[name=order]').val();
926
  args.columns = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(',');
@@ -933,7 +966,9 @@ class SP_AJAX {
933
  args.venue = $div.find('[name=venue]').val();
934
  args.status = $div.find('[name=status]').val();
935
  args.date = $div.find('[name=date]').val();
 
936
  args.number = $div.find('[name=number]').val();
 
937
  args.order = $div.find('[name=order]').val();
938
  args.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length;
939
  } else if ( 'league_table' == type ) {
8
  * AJAX Event Handler
9
  *
10
  * @class SP_AJAX
11
+ * @version 2.1.3
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
269
  ?>
270
  </label>
271
  </p>
272
+ <p>
273
+ <label>
274
+ <?php _e( 'Match Day:', 'sportspress' ); ?>
275
+ <input type="text" size="3" name="day" id="day" placeholder="<?php _e( 'All', 'sportspress' ); ?>">
276
+ </label>
277
+ </p>
278
  <p>
279
  <label>
280
  <?php _e( 'Display link to view all events', 'sportspress' ); ?>
397
  </select>
398
  </label>
399
  </p>
400
+ <p>
401
+ <label>
402
+ <?php _e( 'Match Day:', 'sportspress' ); ?>
403
+ <input type="text" size="3" name="day" id="day" placeholder="<?php _e( 'All', 'sportspress' ); ?>">
404
+ </label>
405
+ </p>
406
  <p>
407
  <label>
408
  <?php _e( 'Number of events to show:', 'sportspress' ); ?>
560
  </select>
561
  </label>
562
  </p>
563
+ <p>
564
+ <label>
565
+ <?php _e( 'Match Day:', 'sportspress' ); ?>
566
+ <input type="text" size="3" name="day" id="day" placeholder="<?php _e( 'All', 'sportspress' ); ?>">
567
+ </label>
568
+ </p>
569
  <p>
570
  <label>
571
  <?php _e( 'Number of events to show:', 'sportspress' ); ?>
572
  <input type="text" size="3" name="number" id="number" value="5">
573
  </label>
574
  </p>
575
+ <p>
576
+ <label>
577
+ <?php _e( 'Sort by:', 'sportspress' ); ?>
578
+ <select id="orderby" name="orderby">
579
+ <option value="default"><?php _e( 'Default', 'sportspress' ); ?></option>
580
+ <option value="date"><?php _e( 'Date', 'sportspress' ); ?></option>
581
+ <option value="day"><?php _e( 'Match Day', 'sportspress' ); ?></option>
582
+ </select>
583
+ </label>
584
+ </p>
585
  <p>
586
  <label>
587
  <?php _e( 'Sort Order:', 'sportspress' ); ?>
788
  $field_name = 'columns[]';
789
  $field_id = 'columns';
790
  ?>
791
+ <label class="button"><input name="columns[]" type="checkbox" id="columns-number" value="number" checked="checked"><?php _e( '#', 'sportspress' ); ?></label>
792
+ <label class="button"><input name="columns[]" type="checkbox" id="columns-team" value="team" checked="checked"><?php _e( 'Team', 'sportspress' ); ?></label>
793
+ <label class="button"><input name="columns[]" type="checkbox" id="columns-position" value="position" checked="checked"><?php _e( 'Position', 'sportspress' ); ?></label>
794
  <?php foreach ( $the_columns as $column ): ?>
795
  <label class="button"><input name="<?php echo $field_name; ?>" type="checkbox" id="<?php echo $field_id . '-' . $column->post_name; ?>" value="<?php echo $column->post_name; ?>" checked="checked"><?php echo $column->post_title; ?></label>
796
  <?php endforeach; ?>
943
  args.season = $div.find('[name=season]').val();
944
  args.venue = $div.find('[name=venue]').val();
945
  args.status = $div.find('[name=status]').val();
946
+ args.day = $div.find('[name=day]').val();
947
  args.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length;
948
  } else if ( 'event_list' == type ) {
949
  args.title = $div.find('[name=title]').val();
953
  args.venue = $div.find('[name=venue]').val();
954
  args.status = $div.find('[name=status]').val();
955
  args.date = $div.find('[name=date]').val();
956
+ args.day = $div.find('[name=day]').val();
957
  args.number = $div.find('[name=number]').val();
958
  args.order = $div.find('[name=order]').val();
959
  args.columns = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(',');
966
  args.venue = $div.find('[name=venue]').val();
967
  args.status = $div.find('[name=status]').val();
968
  args.date = $div.find('[name=date]').val();
969
+ args.day = $div.find('[name=day]').val();
970
  args.number = $div.find('[name=number]').val();
971
+ args.orderby = $div.find('[name=orderby]').val();
972
  args.order = $div.find('[name=order]').val();
973
  args.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length;
974
  } else if ( 'league_table' == type ) {
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.0.13
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -22,12 +22,18 @@ class SP_Calendar extends SP_Custom_Post {
22
  /** @var string The events order. */
23
  public $order;
24
 
 
 
 
25
  /** @var string The date to range from. */
26
  public $from;
27
 
28
  /** @var string The date to range to. */
29
  public $to;
30
 
 
 
 
31
  /** @var int The competition ID. */
32
  public $league;
33
 
@@ -63,6 +69,7 @@ class SP_Calendar extends SP_Custom_Post {
63
 
64
  $this->status = $this->__get( 'status' );
65
  $this->date = $this->__get( 'date' );
 
66
  $this->order = $this->__get( 'order' );
67
  $this->number = $this->__get( 'number' );
68
 
@@ -75,12 +82,18 @@ class SP_Calendar extends SP_Custom_Post {
75
  if ( ! $this->order )
76
  $this->order = 'ASC';
77
 
 
 
 
78
  if ( ! $this->from )
79
  $this->from = get_post_meta( $this->ID, 'sp_date_from', true );
80
 
81
  if ( ! $this->to )
82
  $this->to = get_post_meta( $this->ID, 'sp_date_to', true );
83
 
 
 
 
84
  if ( ! $this->number )
85
  $this->number = 500;
86
  }
@@ -97,7 +110,7 @@ class SP_Calendar extends SP_Custom_Post {
97
  $args = array(
98
  'post_type' => 'sp_event',
99
  'posts_per_page' => $this->number,
100
- 'orderby' => 'date',
101
  'order' => $this->order,
102
  'post_status' => $this->status,
103
  'meta_query' => array(
@@ -149,6 +162,18 @@ class SP_Calendar extends SP_Custom_Post {
149
  );
150
  endif;
151
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  if ( $pagenow != 'post-new.php' ):
153
  if ( $this->ID ):
154
  $leagues = get_the_terms( $this->ID, 'sp_league' );
@@ -178,7 +203,6 @@ class SP_Calendar extends SP_Custom_Post {
178
  endforeach;
179
  endif;
180
  endif;
181
-
182
 
183
  if ( isset( $league_ids ) ) {
184
  $args['tax_query'][] = array(
@@ -214,21 +238,19 @@ class SP_Calendar extends SP_Custom_Post {
214
  );
215
  }
216
 
217
- if ( 'auto' === $this->date ) {
218
- if ( 'any' === $this->status ) {
219
- $args['post_status'] = 'publish';
220
- $args['order'] = 'DESC';
221
- $args['posts_per_page'] = ceil( $this->number / 2 );
222
- $results = get_posts( $args );
223
- $results = array_reverse( $results, true );
224
-
225
- $args['post_status'] = 'future';
226
- $args['order'] = 'ASC';
227
- $args['posts_per_page'] = floor( $this->number / 2 );
228
- $fixtures = get_posts( $args );
229
-
230
- $events = array_merge_recursive( $results, $fixtures );
231
- }
232
  } else {
233
  $events = get_posts( $args );
234
  }
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
22
  /** @var string The events order. */
23
  public $order;
24
 
25
+ /** @var string The events orderby. */
26
+ public $orderby;
27
+
28
  /** @var string The date to range from. */
29
  public $from;
30
 
31
  /** @var string The date to range to. */
32
  public $to;
33
 
34
+ /** @var string The match day. */
35
+ public $day;
36
+
37
  /** @var int The competition ID. */
38
  public $league;
39
 
69
 
70
  $this->status = $this->__get( 'status' );
71
  $this->date = $this->__get( 'date' );
72
+ $this->orderby = $this->__get( 'orderby' );
73
  $this->order = $this->__get( 'order' );
74
  $this->number = $this->__get( 'number' );
75
 
82
  if ( ! $this->order )
83
  $this->order = 'ASC';
84
 
85
+ if ( ! $this->orderby )
86
+ $this->orderby = 'post_date';
87
+
88
  if ( ! $this->from )
89
  $this->from = get_post_meta( $this->ID, 'sp_date_from', true );
90
 
91
  if ( ! $this->to )
92
  $this->to = get_post_meta( $this->ID, 'sp_date_to', true );
93
 
94
+ if ( ! $this->day )
95
+ $this->day = get_post_meta( $this->ID, 'sp_day', true );
96
+
97
  if ( ! $this->number )
98
  $this->number = 500;
99
  }
110
  $args = array(
111
  'post_type' => 'sp_event',
112
  'posts_per_page' => $this->number,
113
+ 'orderby' => $this->orderby,
114
  'order' => $this->order,
115
  'post_status' => $this->status,
116
  'meta_query' => array(
162
  );
163
  endif;
164
 
165
+ if ( $this->day ):
166
+ $args['meta_query'][] = array(
167
+ 'key' => 'sp_day',
168
+ 'value' => $this->day,
169
+ );
170
+ endif;
171
+
172
+ if ( 'day' == $this->orderby ):
173
+ $args['orderby'] = 'meta_value_num';
174
+ $args['meta_key'] = 'sp_day';
175
+ endif;
176
+
177
  if ( $pagenow != 'post-new.php' ):
178
  if ( $this->ID ):
179
  $leagues = get_the_terms( $this->ID, 'sp_league' );
203
  endforeach;
204
  endif;
205
  endif;
 
206
 
207
  if ( isset( $league_ids ) ) {
208
  $args['tax_query'][] = array(
238
  );
239
  }
240
 
241
+ if ( 'auto' === $this->date && 'any' === $this->status ) {
242
+ $args['post_status'] = 'publish';
243
+ $args['order'] = 'DESC';
244
+ $args['posts_per_page'] = ceil( $this->number / 2 );
245
+ $results = get_posts( $args );
246
+ $results = array_reverse( $results, true );
247
+
248
+ $args['post_status'] = 'future';
249
+ $args['order'] = 'ASC';
250
+ $args['posts_per_page'] = floor( $this->number / 2 );
251
+ $fixtures = get_posts( $args );
252
+
253
+ $events = array_merge_recursive( $results, $fixtures );
 
 
254
  } else {
255
  $events = get_posts( $args );
256
  }
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.0.7
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -97,6 +97,8 @@ class SP_Event extends SP_Custom_Post{
97
  $vars = get_posts( $args );
98
 
99
  $labels = array();
 
 
100
  foreach ( $vars as $var ) {
101
  $labels[ $var->post_name ] = $var->post_title;
102
  $format = get_post_meta( $var->ID, 'sp_format', true );
@@ -104,6 +106,19 @@ class SP_Event extends SP_Custom_Post{
104
  $format = 'number';
105
  }
106
  $formats[ $var->post_name ] = $format;
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
 
109
  $order = (array)get_post_meta( $this->ID, 'sp_order', true );
@@ -121,6 +136,8 @@ class SP_Event extends SP_Custom_Post{
121
  endforeach;
122
 
123
  foreach( $data as $player_id => $player_performance ):
 
 
124
  foreach( $labels as $key => $label ):
125
  if ( array_key_exists( $key, $totals ) ):
126
  $totals[ $key ] += sp_array_value( $player_performance, $key, 0 );
@@ -140,6 +157,7 @@ class SP_Event extends SP_Custom_Post{
140
  $totals[ $key ] = $manual_total;
141
  endif;
142
  endforeach;
 
143
  endforeach;
144
  endif;
145
 
@@ -164,10 +182,66 @@ class SP_Event extends SP_Custom_Post{
164
  if ( 'no' == get_option( 'sportspress_event_show_player_numbers', 'yes' ) ):
165
  unset( $labels['number'] );
166
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  $performance[0] = $labels;
 
168
  return apply_filters( 'sportspress_get_event_performance', $performance );
169
  endif;
170
  }
 
 
 
 
171
 
172
  public function main_results() {
173
  // Get main result option
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
97
  $vars = get_posts( $args );
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 );
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
+
114
+ if ( empty( $equation ) ) $equation = 0;
115
+ if ( empty( $precision ) ) $precision = 0;
116
+
117
+ $equations[ $var->post_name ] = array(
118
+ 'equation' => $equation,
119
+ 'precision' => $precision,
120
+ );
121
+ }
122
  }
123
 
124
  $order = (array)get_post_meta( $this->ID, 'sp_order', true );
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 );
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
 
182
  if ( 'no' == get_option( 'sportspress_event_show_player_numbers', 'yes' ) ):
183
  unset( $labels['number'] );
184
  endif;
185
+
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;
195
+ $vars = array_merge( $vars, array( 'eventsplayed' => 1 ) );
196
+
197
+ foreach ( $equations as $key => $equation ):
198
+ $performance[ $team ][ $player ][ $key ] = sp_solve( $equation['equation'], $vars, $equation['precision'] );
199
+ endforeach;
200
+ endforeach;
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 ):
209
+
210
+ // Get team timeline
211
+ $team_timeline = sp_array_value( $timeline, $team, array() );
212
+ if ( empty( $team_timeline ) ) continue;
213
+
214
+ foreach ( $players as $player => $player_performance ):
215
+ if ( ! $player ) continue;
216
+
217
+ // Get player timeline
218
+ $player_timeline = sp_array_value( $team_timeline, $player, array() );
219
+ if ( empty( $player_timeline ) ) continue;
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 );
226
+ if ( empty( $times ) ) continue;
227
+
228
+ $performance[ $team ][ $player ][ $performance_key ] .= ' (' . implode( '\', ', $times ) . '\')';
229
+ endforeach;
230
+ endforeach;
231
+ endforeach;
232
+ endif;
233
+ endif;
234
+
235
+ // Add labels to box score
236
  $performance[0] = $labels;
237
+
238
  return apply_filters( 'sportspress_get_event_performance', $performance );
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() {
247
  // Get main result option
includes/class-sp-install.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Classes
8
- * @version 2.0.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -406,8 +406,22 @@ class SP_Install {
406
  }
407
 
408
  if ( version_compare( $version, '2.1', '<' ) ) {
409
- $option = get_option( 'sportspress_event_results_reverse_teams', 'no' );
410
- update_option( 'sportspress_event_reverse_teams', $option );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  }
412
  }
413
 
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
406
  }
407
 
408
  if ( version_compare( $version, '2.1', '<' ) ) {
409
+ update_option( 'sportspress_player_show_selector', 'no' );
410
+ update_option( 'sportspress_event_performance_show_minutes', 'no' );
411
+ }
412
+
413
+ if ( version_compare( $version, '2.1.3', '<' ) ) {
414
+ $layout = get_option( 'sportspress_player_template_order' );
415
+ if ( is_array( $layout ) ) {
416
+ array_unshift( $layout, 'selector' );
417
+ update_option( 'sportspress_player_template_order', $layout );
418
+ }
419
+
420
+ $layout = get_option( 'sportspress_staff_template_order' );
421
+ if ( is_array( $layout ) ) {
422
+ array_unshift( $layout, 'selector' );
423
+ update_option( 'sportspress_staff_template_order', $layout );
424
+ }
425
  }
426
  }
427
 
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.0.13
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -39,6 +39,7 @@ class SP_Player_List extends SP_Custom_Post {
39
  $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );
40
  $position_ids = sp_get_the_term_ids( $this->ID, 'sp_position' );
41
  $team = get_post_meta( $this->ID, 'sp_team', true );
 
42
  $list_stats = (array)get_post_meta( $this->ID, 'sp_players', true );
43
  $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true );
44
  $orderby = get_post_meta( $this->ID, 'sp_orderby', true );
@@ -95,9 +96,18 @@ class SP_Player_List extends SP_Custom_Post {
95
  endif;
96
 
97
  if ( $team && apply_filters( 'sportspress_has_teams', true ) ):
 
 
 
 
 
 
 
 
 
98
  $args['meta_query'] = array(
99
  array(
100
- 'key' => 'sp_team',
101
  'value' => $team
102
  ),
103
  );
@@ -426,7 +436,20 @@ class SP_Player_List extends SP_Custom_Post {
426
  'numberposts' => -1,
427
  'posts_per_page' => -1,
428
  'orderby' => 'menu_order',
429
- 'order' => 'ASC'
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  );
431
  $stats = get_posts( $args );
432
 
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
39
  $season_ids = sp_get_the_term_ids( $this->ID, 'sp_season' );
40
  $position_ids = sp_get_the_term_ids( $this->ID, 'sp_position' );
41
  $team = get_post_meta( $this->ID, 'sp_team', true );
42
+ $era = get_post_meta( $this->ID, 'sp_era', true );
43
  $list_stats = (array)get_post_meta( $this->ID, 'sp_players', true );
44
  $adjustments = get_post_meta( $this->ID, 'sp_adjustments', true );
45
  $orderby = get_post_meta( $this->ID, 'sp_orderby', true );
96
  endif;
97
 
98
  if ( $team && apply_filters( 'sportspress_has_teams', true ) ):
99
+ $team_key = 'sp_team';
100
+ switch ( $era ):
101
+ case 'current':
102
+ $team_key = 'sp_current_team';
103
+ break;
104
+ case 'past':
105
+ $team_key = 'sp_past_team';
106
+ break;
107
+ endswitch;
108
  $args['meta_query'] = array(
109
  array(
110
+ 'key' => $team_key,
111
  'value' => $team
112
  ),
113
  );
436
  'numberposts' => -1,
437
  'posts_per_page' => -1,
438
  'orderby' => 'menu_order',
439
+ 'order' => 'ASC',
440
+ 'meta_query' => array(
441
+ 'relation' => 'OR',
442
+ array(
443
+ 'key' => 'sp_format',
444
+ 'value' => 'number',
445
+ 'compare' => 'NOT EXISTS',
446
+ ),
447
+ array(
448
+ 'key' => 'sp_format',
449
+ 'value' => array( 'equation', 'text' ),
450
+ 'compare' => 'NOT IN',
451
+ ),
452
+ ),
453
  );
454
  $stats = get_posts( $args );
455
 
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.0.13
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -125,6 +125,19 @@ class SP_Player extends SP_Custom_Post {
125
  'posts_per_page' => 100,
126
  'orderby' => 'menu_order',
127
  'order' => 'ASC',
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  );
129
 
130
  $posts = get_posts( $args );
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
125
  'posts_per_page' => 100,
126
  'orderby' => 'menu_order',
127
  'order' => 'ASC',
128
+ 'meta_query' => array(
129
+ 'relation' => 'OR',
130
+ array(
131
+ 'key' => 'sp_format',
132
+ 'value' => 'number',
133
+ 'compare' => 'NOT EXISTS',
134
+ ),
135
+ array(
136
+ 'key' => 'sp_format',
137
+ 'value' => array( 'equation', 'text' ),
138
+ 'compare' => 'NOT IN',
139
+ ),
140
+ ),
141
  );
142
 
143
  $posts = get_posts( $args );
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.0
13
  * @package SportsPress/Classes
14
  * @category Class
15
  * @author ThemeBoy
@@ -31,6 +31,8 @@ class SP_Post_types {
31
  */
32
  public static function register_taxonomies() {
33
  do_action( 'sportspress_register_taxonomy' );
 
 
34
 
35
  if ( apply_filters( 'sportspress_has_leagues', true ) ):
36
  $labels = array(
@@ -51,6 +53,8 @@ class SP_Post_types {
51
  'label' => __( 'Competitions', 'sportspress' ),
52
  'labels' => $labels,
53
  'public' => true,
 
 
54
  'show_in_nav_menus' => false,
55
  'show_tagcloud' => false,
56
  'hierarchical' => true,
@@ -85,6 +89,8 @@ class SP_Post_types {
85
  'label' => __( 'Seasons', 'sportspress' ),
86
  'labels' => $labels,
87
  'public' => true,
 
 
88
  'show_in_nav_menus' => false,
89
  'show_tagcloud' => false,
90
  'hierarchical' => true,
@@ -119,6 +125,8 @@ class SP_Post_types {
119
  'label' => __( 'Venues', 'sportspress' ),
120
  'labels' => $labels,
121
  'public' => true,
 
 
122
  'show_in_nav_menus' => false,
123
  'show_tagcloud' => false,
124
  'hierarchical' => true,
@@ -153,6 +161,8 @@ class SP_Post_types {
153
  'label' => __( 'Positions', 'sportspress' ),
154
  'labels' => $labels,
155
  'public' => true,
 
 
156
  'show_in_nav_menus' => false,
157
  'show_tagcloud' => false,
158
  'hierarchical' => true,
@@ -187,6 +197,8 @@ class SP_Post_types {
187
  'label' => __( 'Jobs', 'sportspress' ),
188
  'labels' => $labels,
189
  'public' => true,
 
 
190
  'show_in_nav_menus' => false,
191
  'show_tagcloud' => false,
192
  'hierarchical' => true,
@@ -345,6 +357,10 @@ class SP_Post_types {
345
  'search_items' => __( 'Search', 'sportspress' ),
346
  'not_found' => __( 'No results found.', 'sportspress' ),
347
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
 
 
 
 
348
  ),
349
  'public' => false,
350
  'show_ui' => true,
@@ -441,6 +457,10 @@ class SP_Post_types {
441
  'search_items' => __( 'Search', 'sportspress' ),
442
  'not_found' => __( 'No results found.', 'sportspress' ),
443
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
 
 
 
 
444
  ),
445
  'public' => true,
446
  'show_ui' => true,
@@ -474,6 +494,10 @@ class SP_Post_types {
474
  'search_items' => __( 'Search', 'sportspress' ),
475
  'not_found' => __( 'No results found.', 'sportspress' ),
476
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
 
 
 
 
477
  ),
478
  'public' => true,
479
  'show_ui' => true,
@@ -507,6 +531,10 @@ class SP_Post_types {
507
  'search_items' => __( 'Search', 'sportspress' ),
508
  'not_found' => __( 'No results found.', 'sportspress' ),
509
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
 
 
 
 
510
  ),
511
  'public' => true,
512
  'show_ui' => true,
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
31
  */
32
  public static function register_taxonomies() {
33
  do_action( 'sportspress_register_taxonomy' );
34
+
35
+ $show = current_user_can( 'edit_sp_events' );
36
 
37
  if ( apply_filters( 'sportspress_has_leagues', true ) ):
38
  $labels = array(
53
  'label' => __( 'Competitions', 'sportspress' ),
54
  'labels' => $labels,
55
  'public' => true,
56
+ 'show_ui' => $show,
57
+ 'show_in_menu' => $show,
58
  'show_in_nav_menus' => false,
59
  'show_tagcloud' => false,
60
  'hierarchical' => true,
89
  'label' => __( 'Seasons', 'sportspress' ),
90
  'labels' => $labels,
91
  'public' => true,
92
+ 'show_ui' => $show,
93
+ 'show_in_menu' => $show,
94
  'show_in_nav_menus' => false,
95
  'show_tagcloud' => false,
96
  'hierarchical' => true,
125
  'label' => __( 'Venues', 'sportspress' ),
126
  'labels' => $labels,
127
  'public' => true,
128
+ 'show_ui' => $show,
129
+ 'show_in_menu' => $show,
130
  'show_in_nav_menus' => false,
131
  'show_tagcloud' => false,
132
  'hierarchical' => true,
161
  'label' => __( 'Positions', 'sportspress' ),
162
  'labels' => $labels,
163
  'public' => true,
164
+ 'show_ui' => $show,
165
+ 'show_in_menu' => $show,
166
  'show_in_nav_menus' => false,
167
  'show_tagcloud' => false,
168
  'hierarchical' => true,
197
  'label' => __( 'Jobs', 'sportspress' ),
198
  'labels' => $labels,
199
  'public' => true,
200
+ 'show_ui' => $show,
201
+ 'show_in_menu' => $show,
202
  'show_in_nav_menus' => false,
203
  'show_tagcloud' => false,
204
  'hierarchical' => true,
357
  'search_items' => __( 'Search', 'sportspress' ),
358
  'not_found' => __( 'No results found.', 'sportspress' ),
359
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
360
+ 'featured_image' => __( 'Icon', 'sportspress' ),
361
+ 'set_featured_image' => __( 'Select Icon', 'sportspress' ),
362
+ 'remove_featured_image' => __( 'Remove icon', 'sportspress' ),
363
+ 'use_featured_image' => __( 'Add icon', 'sportspress' ),
364
  ),
365
  'public' => false,
366
  'show_ui' => true,
457
  'search_items' => __( 'Search', 'sportspress' ),
458
  'not_found' => __( 'No results found.', 'sportspress' ),
459
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
460
+ 'featured_image' => __( 'Logo', 'sportspress' ),
461
+ 'set_featured_image' => __( 'Select Logo', 'sportspress' ),
462
+ 'remove_featured_image' => __( 'Remove Logo', 'sportspress' ),
463
+ 'use_featured_image' => __( 'Select Logo', 'sportspress' ),
464
  ),
465
  'public' => true,
466
  'show_ui' => true,
494
  'search_items' => __( 'Search', 'sportspress' ),
495
  'not_found' => __( 'No results found.', 'sportspress' ),
496
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
497
+ 'featured_image' => __( 'Photo', 'sportspress' ),
498
+ 'set_featured_image' => __( 'Select Photo', 'sportspress' ),
499
+ 'remove_featured_image' => __( 'Remove Photo', 'sportspress' ),
500
+ 'use_featured_image' => __( 'Select Photo', 'sportspress' ),
501
  ),
502
  'public' => true,
503
  'show_ui' => true,
531
  'search_items' => __( 'Search', 'sportspress' ),
532
  'not_found' => __( 'No results found.', 'sportspress' ),
533
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
534
+ 'featured_image' => __( 'Photo', 'sportspress' ),
535
+ 'set_featured_image' => __( 'Select Photo', 'sportspress' ),
536
+ 'remove_featured_image' => __( 'Remove Photo', 'sportspress' ),
537
+ 'use_featured_image' => __( 'Select Photo', 'sportspress' ),
538
  ),
539
  'public' => true,
540
  'show_ui' => true,
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.0.13
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
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
includes/class-sp-template-loader.php CHANGED
@@ -3,7 +3,7 @@
3
  * Template Loader
4
  *
5
  * @class SP_Template_Loader
6
- * @version 2.0.7
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
@@ -69,29 +69,98 @@ class SP_Template_Loader {
69
  // Get layout setting
70
  $layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );
71
 
 
 
 
72
  // Combine layout setting with available templates
73
- $templates = array_merge( array_flip( $layout ), SP()->templates->$type );
74
 
75
  $templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );
76
 
 
 
 
 
 
 
 
 
 
 
77
  ob_start();
78
 
79
- // Loop through templates
80
- foreach ( $templates as $key => $template ) {
81
- // Ignore templates that are unavailable or that have been turned off
82
- if ( ! is_array( $template ) ) continue;
83
- if ( ! isset( $template['option'] ) ) continue;
84
- if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) continue;
85
-
86
- // Render the template
87
- if ( 'content' === $key ) {
88
- echo $content;
89
- } else {
90
- call_user_func( $template['action'] );
 
 
 
 
91
  }
92
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
- return ob_get_clean();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
96
 
97
  public function event_content( $content ) {
3
  * Template Loader
4
  *
5
  * @class SP_Template_Loader
6
+ * @version 2.1.4
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
69
  // Get layout setting
70
  $layout = (array) get_option( 'sportspress_' . $type . '_template_order', array() );
71
 
72
+ // Get templates
73
+ $templates = SP()->templates->$type;
74
+
75
  // Combine layout setting with available templates
76
+ $templates = array_merge( array_flip( $layout ), $templates );
77
 
78
  $templates = apply_filters( 'sportspress_' . $type . '_templates', $templates );
79
 
80
+ // Split templates into sections and tabs
81
+ $slice = array_search( 'tabs', array_keys( $templates ) );
82
+ if ( $slice ) {
83
+ $section_templates = array_slice( $templates, 0, $slice );
84
+ $tab_templates = array_slice( $templates, $slice );
85
+ } else {
86
+ $section_templates = $templates;
87
+ $tab_templates = array();
88
+ }
89
+
90
  ob_start();
91
 
92
+ // Loop through sections
93
+ if ( ! empty( $section_templates ) ) {
94
+ foreach ( $section_templates as $key => $template ) {
95
+ // Ignore templates that are unavailable or that have been turned off
96
+ if ( ! is_array( $template ) ) continue;
97
+ if ( ! isset( $template['option'] ) ) continue;
98
+ if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) continue;
99
+
100
+ // Render the template
101
+ echo '<div class="sp-section-content sp-section-content-' . $key . '">';
102
+ if ( 'content' === $key ) {
103
+ echo $content;
104
+ } else {
105
+ call_user_func( $template['action'] );
106
+ }
107
+ echo '</div>';
108
  }
109
  }
110
+
111
+ $ob = ob_get_clean();
112
+
113
+ $tabs = '';
114
+
115
+ if ( ! empty( $tab_templates ) ) {
116
+ $i = 0;
117
+ $tab_content = '';
118
+
119
+ foreach ( $tab_templates as $key => $template ) {
120
+ // Ignore templates that are unavailable or that have been turned off
121
+ if ( ! is_array( $template ) ) continue;
122
+ if ( ! isset( $template['option'] ) ) continue;
123
+ if ( 'yes' !== get_option( $template['option'], sp_array_value( $template, 'default', 'yes' ) ) ) continue;
124
+
125
+ // Put tab content into buffer
126
+ ob_start();
127
+ if ( 'content' === $key ) {
128
+ echo $content;
129
+ } else {
130
+ call_user_func( $template['action'] );
131
+ }
132
+ $buffer = ob_get_clean();
133
 
134
+ // Trim whitespace from buffer
135
+ $buffer = trim( $buffer );
136
+
137
+ // Continue if tab content is empty
138
+ if ( empty( $buffer ) ) continue;
139
+
140
+ // Get template label
141
+ $label = sp_array_value( $template, 'label', $template['title'] );
142
+
143
+ // Add to tabs
144
+ $tabs .= '<li class="sp-tab-menu-item' . ( 0 === $i ? ' sp-tab-menu-item-active' : '' ) . '"><a href="#sp-tab-content-' . $key . '" data-sp-tab="' . $key . '">' . apply_filters( 'gettext', $label, $label, 'sportspress' ) . '</a></li>';
145
+
146
+ // Render the template
147
+ $tab_content .= '<div class="sp-tab-content sp-tab-content-' . $key . '" id="sp-tab-content-' . $key . '"' . ( 0 === $i ? ' style="display: block;"' : '' ) . '>' . $buffer . '</div>';
148
+
149
+ $i++;
150
+ }
151
+
152
+ $ob .= '<div class="sp-tab-group">';
153
+
154
+ if ( ! empty( $tabs ) ) {
155
+ $ob .= '<ul class="sp-tab-menu">' . $tabs . '</ul>';
156
+ }
157
+
158
+ $ob .= $tab_content;
159
+
160
+ $ob .= '</div>';
161
+ }
162
+
163
+ return $ob;
164
  }
165
 
166
  public function event_content( $content ) {
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.0
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -130,6 +130,7 @@ class SP_Templates {
130
  apply_filters( 'sportspress_after_team_template', array(
131
  'link' => array(
132
  'title' => __( 'Visit Site', 'sportspress' ),
 
133
  'option' => 'sportspress_team_show_link',
134
  'action' => 'sportspress_output_team_link',
135
  'default' => 'no',
@@ -171,6 +172,13 @@ class SP_Templates {
171
  ),
172
  'player' => array_merge(
173
  apply_filters( 'sportspress_before_player_template', array(
 
 
 
 
 
 
 
174
  'photo' => array(
175
  'title' => __( 'Photo', 'sportspress' ),
176
  'option' => 'sportspress_player_show_photo',
@@ -232,6 +240,13 @@ class SP_Templates {
232
  ),
233
  'staff' => array_merge(
234
  apply_filters( 'sportspress_before_staff_template', array(
 
 
 
 
 
 
 
235
  'photo' => array(
236
  'title' => __( 'Photo', 'sportspress' ),
237
  'option' => 'sportspress_staff_show_photo',
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
130
  apply_filters( 'sportspress_after_team_template', array(
131
  'link' => array(
132
  'title' => __( 'Visit Site', 'sportspress' ),
133
+ 'label' => __( 'Link', 'sportspress' ),
134
  'option' => 'sportspress_team_show_link',
135
  'action' => 'sportspress_output_team_link',
136
  'default' => 'no',
172
  ),
173
  'player' => array_merge(
174
  apply_filters( 'sportspress_before_player_template', array(
175
+ 'selector' => array(
176
+ 'title' => __( 'Dropdown', 'sportspress' ),
177
+ 'label' => __( 'Players', 'sportspress' ),
178
+ 'option' => 'sportspress_player_show_selector',
179
+ 'action' => 'sportspress_output_player_selector',
180
+ 'default' => 'yes',
181
+ ),
182
  'photo' => array(
183
  'title' => __( 'Photo', 'sportspress' ),
184
  'option' => 'sportspress_player_show_photo',
240
  ),
241
  'staff' => array_merge(
242
  apply_filters( 'sportspress_before_staff_template', array(
243
+ 'selector' => array(
244
+ 'title' => __( 'Dropdown', 'sportspress' ),
245
+ 'label' => __( 'Staff', 'sportspress' ),
246
+ 'option' => 'sportspress_staff_show_selector',
247
+ 'action' => 'sportspress_output_staff_selector',
248
+ 'default' => 'yes',
249
+ ),
250
  'photo' => array(
251
  'title' => __( 'Photo', 'sportspress' ),
252
  'option' => 'sportspress_staff_show_photo',
includes/sp-core-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.0.9
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' ), 'time' => __( 'Time', 'sportspress' ), 'text' => __( 'Text', 'sportspress' ) ) );
469
  return sp_array_value( $options, $format, __( 'Number', 'sportspress' ) );
470
  else:
471
  return __( 'Number', 'sportspress' );
@@ -845,7 +845,7 @@ if ( !function_exists( 'sp_post_checklist' ) ) {
845
  if ( ! isset( $slug ) )
846
  $slug = $meta;
847
  ?>
848
- <div id="<?php echo $slug; ?>-all" class="posttypediv wp-tab-panel sp-tab-panel sp-tab-filter-panel sp-select-all-range" style="display: <?php echo $display; ?>;">
849
  <input type="hidden" value="0" name="<?php echo $slug; ?><?php if ( isset( $index ) ) echo '[' . $index . ']'; ?>[]" />
850
  <ul class="categorychecklist form-no-clear">
851
  <li class="sp-select-all-container"><label class="selectit"><input type="checkbox" class="sp-select-all"> <strong><?php _e( 'Select All', 'sportspress' ); ?></strong></label></li>
@@ -929,14 +929,33 @@ if ( !function_exists( 'sp_column_checklist' ) ) {
929
  if ( ! isset( $post_id ) )
930
  global $post_id;
931
  ?>
932
- <div id="<?php echo $meta; ?>-all" class="posttypediv wp-tab-panel sp-tab-panel sp-select-all-range" style="display: <?php echo $display; ?>;">
933
  <input type="hidden" value="0" name="sp_columns[]" />
934
  <ul class="categorychecklist form-no-clear">
935
  <li class="sp-select-all-container"><label class="selectit"><input type="checkbox" class="sp-select-all"> <strong><?php _e( 'Select All', 'sportspress' ); ?></strong></label></li>
936
  <?php
937
  $posts = get_pages( array( 'post_type' => $meta, 'number' => 0 ) );
938
  if ( empty( $posts ) ):
939
- $query = array( 'post_type' => $meta, 'numberposts' => -1, 'post_per_page' => -1, 'order' => 'ASC', 'orderby' => 'menu_order' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
940
  $posts = get_posts( $query );
941
  endif;
942
  if ( sizeof( $posts ) ):
@@ -1331,7 +1350,9 @@ if ( !function_exists( 'sp_taxonomy_field' ) ) {
1331
  function sp_get_text_options() {
1332
  $strings = apply_filters( 'sportspress_text', array(
1333
  __( 'Article', 'sportspress' ),
 
1334
  __( 'Box Score', 'sportspress' ),
 
1335
  __( 'Career Total', 'sportspress' ),
1336
  __( 'Competition', 'sportspress' ),
1337
  __( 'Current Team', 'sportspress' ),
@@ -1339,20 +1360,32 @@ function sp_get_text_options() {
1339
  __( 'Defense', 'sportspress' ),
1340
  __( 'Details', 'sportspress' ),
1341
  __( 'Event', 'sportspress' ),
 
 
1342
  __( 'Fixtures', 'sportspress' ),
 
 
 
 
1343
  __( 'Nationality', 'sportspress' ),
1344
  __( 'Offense', 'sportspress' ),
1345
  __( 'Outcome', 'sportspress' ),
1346
  __( 'Past Teams', 'sportspress' ),
 
1347
  __( 'Player', 'sportspress' ),
 
1348
  __( 'Pos', 'sportspress' ),
1349
  __( 'Position', 'sportspress' ),
 
1350
  __( 'Preview', 'sportspress' ),
 
1351
  __( 'Rank', 'sportspress' ),
1352
  __( 'Recap', 'sportspress' ),
1353
  __( 'Results', 'sportspress' ),
1354
  __( 'Season', 'sportspress' ),
1355
  __( 'Staff', 'sportspress' ),
 
 
1356
  __( 'Team', 'sportspress' ),
1357
  __( 'Teams', 'sportspress' ),
1358
  __( 'Time', 'sportspress' ),
@@ -1363,6 +1396,7 @@ function sp_get_text_options() {
1363
  __( 'View all events', 'sportspress' ),
1364
  __( 'View all players', 'sportspress' ),
1365
  __( 'View full table', 'sportspress' ),
 
1366
  ));
1367
 
1368
  asort( $strings );
@@ -1376,7 +1410,7 @@ function sp_get_text_options() {
1376
  function sp_review_link() {
1377
  ?>
1378
  <p>
1379
- <a href="http://wordpress.org/support/view/plugin-reviews/sportspress#postform">
1380
  <?php _e( 'Love SportsPress? Help spread the word by rating us 5★ on WordPress.org', 'sportspress' ); ?>
1381
  </a>
1382
  </p>
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
  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' );
845
  if ( ! isset( $slug ) )
846
  $slug = $meta;
847
  ?>
848
+ <div id="<?php echo $slug; ?>-all" class="posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-tab-filter-panel sp-select-all-range" style="display: <?php echo $display; ?>;">
849
  <input type="hidden" value="0" name="<?php echo $slug; ?><?php if ( isset( $index ) ) echo '[' . $index . ']'; ?>[]" />
850
  <ul class="categorychecklist form-no-clear">
851
  <li class="sp-select-all-container"><label class="selectit"><input type="checkbox" class="sp-select-all"> <strong><?php _e( 'Select All', 'sportspress' ); ?></strong></label></li>
929
  if ( ! isset( $post_id ) )
930
  global $post_id;
931
  ?>
932
+ <div id="<?php echo $meta; ?>-all" class="posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-select-all-range" style="display: <?php echo $display; ?>;">
933
  <input type="hidden" value="0" name="sp_columns[]" />
934
  <ul class="categorychecklist form-no-clear">
935
  <li class="sp-select-all-container"><label class="selectit"><input type="checkbox" class="sp-select-all"> <strong><?php _e( 'Select All', 'sportspress' ); ?></strong></label></li>
936
  <?php
937
  $posts = get_pages( array( 'post_type' => $meta, 'number' => 0 ) );
938
  if ( empty( $posts ) ):
939
+ $query = array(
940
+ 'post_type' => $meta,
941
+ 'numberposts' => -1,
942
+ 'post_per_page' => -1,
943
+ 'order' => 'ASC',
944
+ 'orderby' => 'menu_order',
945
+ 'meta_query' => array(
946
+ 'relation' => 'OR',
947
+ array(
948
+ 'key' => 'sp_format',
949
+ 'value' => 'number',
950
+ 'compare' => 'NOT EXISTS',
951
+ ),
952
+ array(
953
+ 'key' => 'sp_format',
954
+ 'value' => array( 'equation', 'text' ),
955
+ 'compare' => 'NOT IN',
956
+ ),
957
+ ),
958
+ );
959
  $posts = get_posts( $query );
960
  endif;
961
  if ( sizeof( $posts ) ):
1350
  function sp_get_text_options() {
1351
  $strings = apply_filters( 'sportspress_text', array(
1352
  __( 'Article', 'sportspress' ),
1353
+ __( 'Away', 'sportspress' ),
1354
  __( 'Box Score', 'sportspress' ),
1355
+ __( 'Cancelled', 'sportspress' ),
1356
  __( 'Career Total', 'sportspress' ),
1357
  __( 'Competition', 'sportspress' ),
1358
  __( 'Current Team', 'sportspress' ),
1360
  __( 'Defense', 'sportspress' ),
1361
  __( 'Details', 'sportspress' ),
1362
  __( 'Event', 'sportspress' ),
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' ),
1372
  __( 'Outcome', 'sportspress' ),
1373
  __( 'Past Teams', 'sportspress' ),
1374
+ __( 'Photo', 'sportspress' ),
1375
  __( 'Player', 'sportspress' ),
1376
+ __( 'Players', 'sportspress' ),
1377
  __( 'Pos', 'sportspress' ),
1378
  __( 'Position', 'sportspress' ),
1379
+ __( 'Postponed', 'sportspress' ),
1380
  __( 'Preview', 'sportspress' ),
1381
+ __( 'Profile', 'sportspress' ),
1382
  __( 'Rank', 'sportspress' ),
1383
  __( 'Recap', 'sportspress' ),
1384
  __( 'Results', 'sportspress' ),
1385
  __( 'Season', 'sportspress' ),
1386
  __( 'Staff', 'sportspress' ),
1387
+ __( 'Statistics', 'sportspress' ),
1388
+ __( 'TBD', 'sportspress' ),
1389
  __( 'Team', 'sportspress' ),
1390
  __( 'Teams', 'sportspress' ),
1391
  __( 'Time', 'sportspress' ),
1396
  __( 'View all events', 'sportspress' ),
1397
  __( 'View all players', 'sportspress' ),
1398
  __( 'View full table', 'sportspress' ),
1399
+ __( 'Visit Site', 'sportspress' ),
1400
  ));
1401
 
1402
  asort( $strings );
1410
  function sp_review_link() {
1411
  ?>
1412
  <p>
1413
+ <a href="https://wordpress.org/support/plugin/sportspress/reviews/?rate=5#new-post">
1414
  <?php _e( 'Love SportsPress? Help spread the word by rating us 5★ on WordPress.org', 'sportspress' ); ?>
1415
  </a>
1416
  </p>
includes/sp-template-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
@@ -335,6 +335,19 @@ if ( ! function_exists( 'sportspress_output_league_table' ) ) {
335
 
336
  /** Single Player ********************************************************/
337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  if ( ! function_exists( 'sportspress_output_player_photo' ) ) {
339
 
340
  /**
@@ -398,6 +411,19 @@ if ( ! function_exists( 'sportspress_output_player_list' ) ) {
398
 
399
  /** Single Staff ********************************************************/
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  if ( ! function_exists( 'sportspress_output_staff_photo' ) ) {
402
 
403
  /**
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
335
 
336
  /** Single Player ********************************************************/
337
 
338
+ if ( ! function_exists( 'sportspress_output_player_selector' ) ) {
339
+
340
+ /**
341
+ * Output the player dropdown.
342
+ *
343
+ * @access public
344
+ * @subpackage Player/Dropdown
345
+ * @return void
346
+ */
347
+ function sportspress_output_player_selector() {
348
+ sp_get_template( 'player-selector.php' );
349
+ }
350
+ }
351
  if ( ! function_exists( 'sportspress_output_player_photo' ) ) {
352
 
353
  /**
411
 
412
  /** Single Staff ********************************************************/
413
 
414
+ if ( ! function_exists( 'sportspress_output_staff_selector' ) ) {
415
+
416
+ /**
417
+ * Output the staff dropdown.
418
+ *
419
+ * @access public
420
+ * @subpackage Staff/Dropdown
421
+ * @return void
422
+ */
423
+ function sportspress_output_staff_selector() {
424
+ sp_get_template( 'staff-selector.php' );
425
+ }
426
+ }
427
  if ( ! function_exists( 'sportspress_output_staff_photo' ) ) {
428
 
429
  /**
includes/sp-template-hooks.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 1.9.13
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -173,18 +173,6 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain = nu
173
  case 'Slug':
174
  $translated_text = ( in_array( $typenow, array( 'sp_column', 'sp_statistic' ) ) ) ? __( 'Key', 'sportspress' ) : __( 'Variable', 'sportspress' );
175
  break;
176
- case 'Featured Image':
177
- $translated_text = __( 'Icon', 'sportspress' );
178
- break;
179
- case 'Set Featured Image':
180
- $translated_text = __( 'Select Icon', 'sportspress' );
181
- break;
182
- case 'Set featured image':
183
- $translated_text = __( 'Add icon', 'sportspress' );
184
- break;
185
- case 'Remove featured image':
186
- $translated_text = __( 'Remove icon', 'sportspress' );
187
- break;
188
  endswitch;
189
  endif;
190
 
@@ -196,40 +184,6 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain = nu
196
  endswitch;
197
  endif;
198
 
199
- if ( in_array( $typenow, array( 'sp_player', 'sp_staff' ) ) ):
200
- switch ( $untranslated_text ):
201
- case 'Featured Image':
202
- $translated_text = __( 'Photo', 'sportspress' );
203
- break;
204
- case 'Set Featured Image':
205
- $translated_text = __( 'Select Photo', 'sportspress' );
206
- break;
207
- case 'Set featured image':
208
- $translated_text = __( 'Add photo', 'sportspress' );
209
- break;
210
- case 'Remove featured image':
211
- $translated_text = __( 'Remove photo', 'sportspress' );
212
- break;
213
- endswitch;
214
- endif;
215
-
216
- if ( in_array( $typenow, array( 'sp_team' ) ) ):
217
- switch ( $untranslated_text ):
218
- case 'Featured Image':
219
- $translated_text = __( 'Logo', 'sportspress' );
220
- break;
221
- case 'Set Featured Image':
222
- $translated_text = __( 'Select Logo', 'sportspress' );
223
- break;
224
- case 'Set featured image':
225
- $translated_text = __( 'Add logo', 'sportspress' );
226
- break;
227
- case 'Remove featured image':
228
- $translated_text = __( 'Remove logo', 'sportspress' );
229
- break;
230
- endswitch;
231
- endif;
232
-
233
  if ( in_array( $typenow, array( 'sp_event' ) ) ):
234
  switch ( $untranslated_text ):
235
  case 'Publish <b>immediately</b>':
@@ -326,6 +280,28 @@ function sportspress_show_future_posts( $where, $that ) {
326
  }
327
  add_filter( 'posts_where', 'sportspress_show_future_posts', 2, 10 );
328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  function sportspress_sanitize_title( $title ) {
330
 
331
  if ( isset( $_POST ) && array_key_exists( 'taxonomy', $_POST ) ):
@@ -344,15 +320,6 @@ function sportspress_sanitize_title( $title ) {
344
 
345
  $title = sp_get_eos_safe_slug( $key, $id );
346
 
347
- elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && $_POST['post_type'] == 'sp_event' ):
348
-
349
- // Auto slug generation
350
- if ( $_POST['post_title'] == '' && ( $_POST['post_name'] == '' || is_int( $_POST['post_name'] ) ) ):
351
-
352
- $title = '';
353
-
354
- endif;
355
-
356
  endif;
357
 
358
  return $title;
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
173
  case 'Slug':
174
  $translated_text = ( in_array( $typenow, array( 'sp_column', 'sp_statistic' ) ) ) ? __( 'Key', 'sportspress' ) : __( 'Variable', 'sportspress' );
175
  break;
 
 
 
 
 
 
 
 
 
 
 
 
176
  endswitch;
177
  endif;
178
 
184
  endswitch;
185
  endif;
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  if ( in_array( $typenow, array( 'sp_event' ) ) ):
188
  switch ( $untranslated_text ):
189
  case 'Publish <b>immediately</b>':
280
  }
281
  add_filter( 'posts_where', 'sportspress_show_future_posts', 2, 10 );
282
 
283
+ function sportspress_give_event_read_permissions( $allcaps, $caps, $args ) {
284
+
285
+ // Bail out if we're not asking about viewing an event
286
+ if ( 'read_sp_event' !== $args[0] )
287
+ return $allcaps;
288
+
289
+ // Load the post data
290
+ $post = get_post( $args[2] );
291
+
292
+ // Bail out if the event isn't scheduled
293
+ if ( 'future' != $post->post_status )
294
+ return $allcaps;
295
+
296
+ // Add post capabilities
297
+ foreach ( $caps as $cap ) {
298
+ $allcaps[ $cap ] = true;
299
+ }
300
+
301
+ return $allcaps;
302
+ }
303
+ add_filter( 'user_has_cap', 'sportspress_give_event_read_permissions', 10, 3 );
304
+
305
  function sportspress_sanitize_title( $title ) {
306
 
307
  if ( isset( $_POST ) && array_key_exists( 'taxonomy', $_POST ) ):
320
 
321
  $title = sp_get_eos_safe_slug( $key, $id );
322
 
 
 
 
 
 
 
 
 
 
323
  endif;
324
 
325
  return $title;
includes/widgets/class-sp-widget-event-blocks.php CHANGED
@@ -21,6 +21,7 @@ class SP_Widget_Event_Blocks extends WP_Widget {
21
  $date = empty($instance['date']) ? 'default' : $instance['date'];
22
  $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
23
  $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
 
24
  $number = empty($instance['number']) ? null : $instance['number'];
25
  $order = empty($instance['order']) ? 'default' : $instance['order'];
26
  $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link'];
@@ -34,7 +35,7 @@ class SP_Widget_Event_Blocks extends WP_Widget {
34
  // Action to hook into
35
  do_action( 'sportspress_before_widget_template', $args, $instance, 'event-blocks' );
36
 
37
- sp_get_template( 'event-blocks.php', array( 'id' => $id, 'title' => $caption, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'number' => $number, 'order' => $order, 'show_all_events_link' => $show_all_events_link ) );
38
 
39
  // Action to hook into
40
  do_action( 'sportspress_after_widget_template', $args, $instance, 'event-blocks' );
@@ -52,6 +53,7 @@ class SP_Widget_Event_Blocks extends WP_Widget {
52
  $instance['date'] = $new_instance['date'];
53
  $instance['date_from'] = $new_instance['date_from'];
54
  $instance['date_to'] = $new_instance['date_to'];
 
55
  $instance['number'] = intval($new_instance['number']);
56
  $instance['order'] = strip_tags($new_instance['order']);
57
  $instance['show_all_events_link'] = $new_instance['show_all_events_link'];
@@ -63,7 +65,7 @@ class SP_Widget_Event_Blocks extends WP_Widget {
63
  }
64
 
65
  function form( $instance ) {
66
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'caption' => '', 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'number' => 5, 'order' => 'default', 'show_all_events_link' => true ) );
67
  $title = strip_tags($instance['title']);
68
  $id = intval($instance['id']);
69
  $caption = strip_tags($instance['caption']);
@@ -71,6 +73,7 @@ class SP_Widget_Event_Blocks extends WP_Widget {
71
  $date = $instance['date'];
72
  $date_from = $instance['date_from'];
73
  $date_to = $instance['date_to'];
 
74
  $number = intval($instance['number']);
75
  $order = strip_tags($instance['order']);
76
  $show_all_events_link = $instance['show_all_events_link'];
@@ -134,6 +137,9 @@ class SP_Widget_Event_Blocks extends WP_Widget {
134
  </p>
135
  </div>
136
 
 
 
 
137
  <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
138
  <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo esc_attr($number); ?>" size="3"></p>
139
 
21
  $date = empty($instance['date']) ? 'default' : $instance['date'];
22
  $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
23
  $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
24
+ $day = empty($instance['day']) ? 'default' : $instance['day'];
25
  $number = empty($instance['number']) ? null : $instance['number'];
26
  $order = empty($instance['order']) ? 'default' : $instance['order'];
27
  $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link'];
35
  // Action to hook into
36
  do_action( 'sportspress_before_widget_template', $args, $instance, 'event-blocks' );
37
 
38
+ sp_get_template( 'event-blocks.php', array( 'id' => $id, 'title' => $caption, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'day' => $day, 'number' => $number, 'order' => $order, 'show_all_events_link' => $show_all_events_link ) );
39
 
40
  // Action to hook into
41
  do_action( 'sportspress_after_widget_template', $args, $instance, 'event-blocks' );
53
  $instance['date'] = $new_instance['date'];
54
  $instance['date_from'] = $new_instance['date_from'];
55
  $instance['date_to'] = $new_instance['date_to'];
56
+ $instance['day'] = $new_instance['day'];
57
  $instance['number'] = intval($new_instance['number']);
58
  $instance['order'] = strip_tags($new_instance['order']);
59
  $instance['show_all_events_link'] = $new_instance['show_all_events_link'];
65
  }
66
 
67
  function form( $instance ) {
68
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'caption' => '', 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'day' => '', 'number' => 5, 'order' => 'default', 'show_all_events_link' => true ) );
69
  $title = strip_tags($instance['title']);
70
  $id = intval($instance['id']);
71
  $caption = strip_tags($instance['caption']);
73
  $date = $instance['date'];
74
  $date_from = $instance['date_from'];
75
  $date_to = $instance['date_to'];
76
+ $day = $instance['day'];
77
  $number = intval($instance['number']);
78
  $order = strip_tags($instance['order']);
79
  $show_all_events_link = $instance['show_all_events_link'];
137
  </p>
138
  </div>
139
 
140
+ <p><label for="<?php echo $this->get_field_id('day'); ?>"><?php _e( 'Match Day:', 'sportspress' ); ?></label>
141
+ <input id="<?php echo $this->get_field_id('day'); ?>" name="<?php echo $this->get_field_name('day'); ?>" type="text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr($day); ?>" size="10"></p>
142
+
143
  <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
144
  <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo esc_attr($number); ?>" size="3"></p>
145
 
includes/widgets/class-sp-widget-event-calendar.php CHANGED
@@ -20,6 +20,7 @@ class SP_Widget_Event_Calendar extends WP_Widget {
20
  $date = empty($instance['date']) ? 'default' : $instance['date'];
21
  $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
22
  $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
 
23
  $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link'];
24
 
25
  do_action( 'sportspress_before_widget', $args, $instance, 'event-calendar' );
@@ -31,7 +32,7 @@ class SP_Widget_Event_Calendar extends WP_Widget {
31
  // Action to hook into
32
  do_action( 'sportspress_before_widget_template', $args, $instance, 'event-calendar' );
33
 
34
- sp_get_template( 'event-calendar.php', array( 'id' => $id, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'caption_tag' => 'caption', 'show_all_events_link' => $show_all_events_link ) );
35
 
36
  // Action to hook into
37
  do_action( 'sportspress_after_widget_template', $args, $instance, 'event-calendar' );
@@ -48,6 +49,7 @@ class SP_Widget_Event_Calendar extends WP_Widget {
48
  $instance['date'] = $new_instance['date'];
49
  $instance['date_from'] = $new_instance['date_from'];
50
  $instance['date_to'] = $new_instance['date_to'];
 
51
  $instance['show_all_events_link'] = $new_instance['show_all_events_link'];
52
 
53
  // Filter to hook into
@@ -57,13 +59,14 @@ class SP_Widget_Event_Calendar extends WP_Widget {
57
  }
58
 
59
  function form( $instance ) {
60
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'show_all_events_link' => false ) );
61
  $title = strip_tags($instance['title']);
62
  $id = intval($instance['id']);
63
  $status = $instance['status'];
64
  $date = $instance['date'];
65
  $date_from = $instance['date_from'];
66
  $date_to = $instance['date_to'];
 
67
  $show_all_events_link = $instance['show_all_events_link'];
68
 
69
  // Action to hook into
@@ -122,6 +125,9 @@ class SP_Widget_Event_Calendar extends WP_Widget {
122
  </p>
123
  </div>
124
 
 
 
 
125
  <p class="sp-event-calendar-show-all-toggle<?php if ( ! $id ): ?> hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_all_events_link'); ?>" name="<?php echo $this->get_field_name('show_all_events_link'); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
126
  <label for="<?php echo $this->get_field_id('show_all_events_link'); ?>"><?php _e( 'Display link to view all events', 'sportspress' ); ?></label></p>
127
 
20
  $date = empty($instance['date']) ? 'default' : $instance['date'];
21
  $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
22
  $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
23
+ $day = empty($instance['day']) ? 'default' : $instance['day'];
24
  $show_all_events_link = empty($instance['show_all_events_link']) ? false : $instance['show_all_events_link'];
25
 
26
  do_action( 'sportspress_before_widget', $args, $instance, 'event-calendar' );
32
  // Action to hook into
33
  do_action( 'sportspress_before_widget_template', $args, $instance, 'event-calendar' );
34
 
35
+ sp_get_template( 'event-calendar.php', array( 'id' => $id, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'caption_tag' => 'caption', 'day' => $day, 'show_all_events_link' => $show_all_events_link ) );
36
 
37
  // Action to hook into
38
  do_action( 'sportspress_after_widget_template', $args, $instance, 'event-calendar' );
49
  $instance['date'] = $new_instance['date'];
50
  $instance['date_from'] = $new_instance['date_from'];
51
  $instance['date_to'] = $new_instance['date_to'];
52
+ $instance['day'] = $new_instance['day'];
53
  $instance['show_all_events_link'] = $new_instance['show_all_events_link'];
54
 
55
  // Filter to hook into
59
  }
60
 
61
  function form( $instance ) {
62
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'day' => '', 'show_all_events_link' => false ) );
63
  $title = strip_tags($instance['title']);
64
  $id = intval($instance['id']);
65
  $status = $instance['status'];
66
  $date = $instance['date'];
67
  $date_from = $instance['date_from'];
68
  $date_to = $instance['date_to'];
69
+ $day = $instance['day'];
70
  $show_all_events_link = $instance['show_all_events_link'];
71
 
72
  // Action to hook into
125
  </p>
126
  </div>
127
 
128
+ <p><label for="<?php echo $this->get_field_id('day'); ?>"><?php _e( 'Match Day:', 'sportspress' ); ?></label>
129
+ <input id="<?php echo $this->get_field_id('day'); ?>" name="<?php echo $this->get_field_name('day'); ?>" type="text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr($day); ?>" size="10"></p>
130
+
131
  <p class="sp-event-calendar-show-all-toggle<?php if ( ! $id ): ?> hidden<?php endif; ?>"><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_all_events_link'); ?>" name="<?php echo $this->get_field_name('show_all_events_link'); ?>" value="1" <?php checked( $show_all_events_link, 1 ); ?>>
132
  <label for="<?php echo $this->get_field_id('show_all_events_link'); ?>"><?php _e( 'Display link to view all events', 'sportspress' ); ?></label></p>
133
 
includes/widgets/class-sp-widget-event-list.php CHANGED
@@ -21,6 +21,7 @@ class SP_Widget_Event_List extends WP_Widget {
21
  $date = empty($instance['date']) ? 'default' : $instance['date'];
22
  $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
23
  $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
 
24
  $number = empty($instance['number']) ? null : $instance['number'];
25
  $columns = empty($instance['columns']) ? null : $instance['columns'];
26
  $order = empty($instance['order']) ? 'default' : $instance['order'];
@@ -35,7 +36,7 @@ class SP_Widget_Event_List extends WP_Widget {
35
  // Action to hook into
36
  do_action( 'sportspress_before_widget_template', $args, $instance, 'event-list' );
37
 
38
- sp_get_template( 'event-list.php', array( 'id' => $id, 'title' => $caption, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'number' => $number, 'columns' => $columns, 'order' => $order, 'show_all_events_link' => $show_all_events_link ) );
39
 
40
  // Action to hook into
41
  do_action( 'sportspress_after_widget_template', $args, $instance, 'event-list' );
@@ -53,6 +54,7 @@ class SP_Widget_Event_List extends WP_Widget {
53
  $instance['date'] = $new_instance['date'];
54
  $instance['date_from'] = $new_instance['date_from'];
55
  $instance['date_to'] = $new_instance['date_to'];
 
56
  $instance['number'] = intval($new_instance['number']);
57
  $instance['columns'] = (array)$new_instance['columns'];
58
  $instance['order'] = strip_tags($new_instance['order']);
@@ -65,7 +67,7 @@ class SP_Widget_Event_List extends WP_Widget {
65
  }
66
 
67
  function form( $instance ) {
68
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'caption' => '', 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'number' => 5, 'columns' => null, 'order' => 'default', 'show_all_events_link' => true ) );
69
  $title = strip_tags($instance['title']);
70
  $id = intval($instance['id']);
71
  $caption = strip_tags($instance['caption']);
@@ -73,6 +75,7 @@ class SP_Widget_Event_List extends WP_Widget {
73
  $date = $instance['date'];
74
  $date_from = $instance['date_from'];
75
  $date_to = $instance['date_to'];
 
76
  $number = intval($instance['number']);
77
  $columns = $instance['columns'];
78
  $order = strip_tags($instance['order']);
@@ -137,6 +140,9 @@ class SP_Widget_Event_List extends WP_Widget {
137
  </p>
138
  </div>
139
 
 
 
 
140
  <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
141
  <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo esc_attr($number); ?>" size="3"></p>
142
 
21
  $date = empty($instance['date']) ? 'default' : $instance['date'];
22
  $date_from = empty($instance['date_from']) ? 'default' : $instance['date_from'];
23
  $date_to = empty($instance['date_to']) ? 'default' : $instance['date_to'];
24
+ $day = empty($instance['day']) ? 'default' : $instance['day'];
25
  $number = empty($instance['number']) ? null : $instance['number'];
26
  $columns = empty($instance['columns']) ? null : $instance['columns'];
27
  $order = empty($instance['order']) ? 'default' : $instance['order'];
36
  // Action to hook into
37
  do_action( 'sportspress_before_widget_template', $args, $instance, 'event-list' );
38
 
39
+ sp_get_template( 'event-list.php', array( 'id' => $id, 'title' => $caption, 'status' => $status, 'date' => $date, 'date_from' => $date_from, 'date_to' => $date_to, 'day' => $day, 'number' => $number, 'columns' => $columns, 'order' => $order, 'show_all_events_link' => $show_all_events_link ) );
40
 
41
  // Action to hook into
42
  do_action( 'sportspress_after_widget_template', $args, $instance, 'event-list' );
54
  $instance['date'] = $new_instance['date'];
55
  $instance['date_from'] = $new_instance['date_from'];
56
  $instance['date_to'] = $new_instance['date_to'];
57
+ $instance['day'] = $new_instance['day'];
58
  $instance['number'] = intval($new_instance['number']);
59
  $instance['columns'] = (array)$new_instance['columns'];
60
  $instance['order'] = strip_tags($new_instance['order']);
67
  }
68
 
69
  function form( $instance ) {
70
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => null, 'caption' => '', 'status' => 'default', 'date' => 'default', 'date_from' => date_i18n( 'Y-m-d' ), 'date_to' => date_i18n( 'Y-m-d' ), 'day' => '', 'number' => 5, 'columns' => null, 'order' => 'default', 'show_all_events_link' => true ) );
71
  $title = strip_tags($instance['title']);
72
  $id = intval($instance['id']);
73
  $caption = strip_tags($instance['caption']);
75
  $date = $instance['date'];
76
  $date_from = $instance['date_from'];
77
  $date_to = $instance['date_to'];
78
+ $day = $instance['day'];
79
  $number = intval($instance['number']);
80
  $columns = $instance['columns'];
81
  $order = strip_tags($instance['order']);
140
  </p>
141
  </div>
142
 
143
+ <p><label for="<?php echo $this->get_field_id('day'); ?>"><?php _e( 'Match Day:', 'sportspress' ); ?></label>
144
+ <input id="<?php echo $this->get_field_id('day'); ?>" name="<?php echo $this->get_field_name('day'); ?>" type="text" placeholder="<?php _e( 'All', 'sportspress' ); ?>" value="<?php echo esc_attr($day); ?>" size="10"></p>
145
+
146
  <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
147
  <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo esc_attr($number); ?>" size="3"></p>
148
 
modules/sportspress-birthdays.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add birthdays to players and staff.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.0.8
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Birthdays' ) ) :
17
  * Main SportsPress Birthdays Class
18
  *
19
  * @class SportsPress_Birthdays
20
- * @version 2.0.8
21
  */
22
  class SportsPress_Birthdays {
23
 
@@ -43,7 +43,7 @@ class SportsPress_Birthdays {
43
  */
44
  private function define_constants() {
45
  if ( !defined( 'SP_BIRTHDAYS_VERSION' ) )
46
- define( 'SP_BIRTHDAYS_VERSION', '2.0.8' );
47
 
48
  if ( !defined( 'SP_BIRTHDAYS_URL' ) )
49
  define( 'SP_BIRTHDAYS_URL', plugin_dir_url( __FILE__ ) );
@@ -158,7 +158,7 @@ class SportsPress_Birthdays {
158
  }
159
 
160
  if ( 'yes' == get_option( 'sportspress_player_show_age', 'no' ) ) {
161
- $data[ __( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y' ) );
162
  }
163
 
164
  return $data;
@@ -175,7 +175,7 @@ class SportsPress_Birthdays {
175
  }
176
 
177
  if ( 'yes' == get_option( 'sportspress_staff_show_age', 'no' ) ) {
178
- $data[ __( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y' ) );
179
  }
180
 
181
  return $data;
5
  Description: Add birthdays to players and staff.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.1.4
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Birthdays Class
18
  *
19
  * @class SportsPress_Birthdays
20
+ * @version 2.1.4
21
  */
22
  class SportsPress_Birthdays {
23
 
43
  */
44
  private function define_constants() {
45
  if ( !defined( 'SP_BIRTHDAYS_VERSION' ) )
46
+ define( 'SP_BIRTHDAYS_VERSION', '2.1.4' );
47
 
48
  if ( !defined( 'SP_BIRTHDAYS_URL' ) )
49
  define( 'SP_BIRTHDAYS_URL', plugin_dir_url( __FILE__ ) );
158
  }
159
 
160
  if ( 'yes' == get_option( 'sportspress_player_show_age', 'no' ) ) {
161
+ $data[ __( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y', $post_id ) );
162
  }
163
 
164
  return $data;
175
  }
176
 
177
  if ( 'yes' == get_option( 'sportspress_staff_show_age', 'no' ) ) {
178
+ $data[ __( 'Age', 'sportspress' ) ] = $this->get_age( get_the_date( 'm-d-Y', $post_id ) );
179
  }
180
 
181
  return $data;
modules/sportspress-event-status.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: SportsPress Event Status
4
+ Plugin URI: http://themeboy.com/
5
+ Description: Add a status option to SportsPress events.
6
+ Author: ThemeBoy
7
+ Author URI: http://themeboy.com/
8
+ Version: 2.1
9
+ */
10
+
11
+ // Exit if accessed directly
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'SportsPress_Event_Status' ) ) :
15
+
16
+ /**
17
+ * Main SportsPress Event Status Class
18
+ *
19
+ * @class SportsPress_Event_Status
20
+ * @version 2.1
21
+ */
22
+ class SportsPress_Event_Status {
23
+
24
+ /**
25
+ * @var array
26
+ */
27
+ public $statuses = array();
28
+
29
+ /**
30
+ * Constructor
31
+ */
32
+ public function __construct() {
33
+ // Define constants
34
+ $this->define_constants();
35
+
36
+ add_action( 'init', array( $this, 'get_statuses' ) );
37
+ add_action( 'post_submitbox_misc_actions', array( $this, 'section' ) );
38
+ add_action( 'sportspress_process_sp_event_meta', array( $this, 'save' ), 10, 1 );
39
+ add_filter( 'sportspress_event_time', array( $this, 'filter' ), 10, 2 );
40
+ add_filter( 'sportspress_event_time_admin', array( $this, 'filter' ), 10, 2 );
41
+ add_filter( 'sportspress_main_results_or_time', array( $this, 'filter_array' ), 10, 2 );
42
+ add_filter( 'sportspress_event_blocks_team_result_or_time', array( $this, 'filter_array' ), 10, 2 );
43
+ }
44
+
45
+ /**
46
+ * Define constants.
47
+ */
48
+ private function define_constants() {
49
+ if ( !defined( 'SP_EVENT_STATUS_VERSION' ) )
50
+ define( 'SP_EVENT_STATUS_VERSION', '2.1' );
51
+
52
+ if ( !defined( 'SP_EVENT_STATUS_URL' ) )
53
+ define( 'SP_EVENT_STATUS_URL', plugin_dir_url( __FILE__ ) );
54
+
55
+ if ( !defined( 'SP_EVENT_STATUS_DIR' ) )
56
+ define( 'SP_EVENT_STATUS_DIR', plugin_dir_path( __FILE__ ) );
57
+ }
58
+
59
+ /**
60
+ * Define statuses.
61
+ */
62
+ public function get_statuses() {
63
+ $this->statuses = apply_filters( 'sportspress_event_statuses', array(
64
+ 'ok' => __( 'On time', 'sportspress' ),
65
+ 'tbd' => __( 'TBD', 'sportspress' ),
66
+ 'postponed' => __( 'Postponed', 'sportspress' ),
67
+ 'cancelled' => __( 'Cancelled', 'sportspress' ),
68
+ ) );
69
+ }
70
+
71
+ /**
72
+ * Add status section to submit box.
73
+ */
74
+ public function section() {
75
+ if ( 'sp_event' !== get_post_type() ) return;
76
+ $status = get_post_meta( get_the_ID(), 'sp_status', true );
77
+ if ( ! $status ) $status = 'ok';
78
+ ?>
79
+ <div class="misc-pub-section sp-pub-event-status">
80
+ <span class="sp-event-status"><?php _e( 'Time:', 'sportspress' ); ?> <strong class="sp-event-status-display" data-sp-event-status="<?php echo $status; ?>"><?php echo $this->statuses[ $status ]; ?></strong></span>
81
+ <a href="#" class="sp-edit-event-status hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit', 'sportspress' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
82
+ <div class="sp-event-status-select hide-if-js">
83
+ <?php foreach ( $this->statuses as $value => $label ) { ?>
84
+ <label><input type="radio" name="sp_status" value="<?php echo $value; ?>" data-sp-event-status="<?php echo $label; ?>" <?php checked( $status, $value ); ?>> <?php echo $label; ?></label><br>
85
+ <?php } ?>
86
+ <p>
87
+ <a href="#" class="sp-save-event-status hide-if-no-js button">OK</a>
88
+ <a href="#" class="sp-cancel-event-status hide-if-no-js button-cancel">Cancel</a>
89
+ </p>
90
+ </div>
91
+ </div>
92
+ <?php
93
+ }
94
+
95
+ /**
96
+ * Save status option.
97
+ */
98
+ public function save( $post_id ) {
99
+ update_post_meta( $post_id, 'sp_status', sp_array_value( $_POST, 'sp_status', 'ok' ) );
100
+ }
101
+
102
+ /**
103
+ * Event time filter.
104
+ */
105
+ public function filter( $time, $post_id = 0 ) {
106
+ if ( ! $post_id ) $post_id = get_the_ID();
107
+ $status = get_post_meta( $post_id, 'sp_status', true );
108
+ if ( ! $status || 'ok' === $status || ! array_key_exists( $status, $this->statuses ) ) return $time;
109
+ return $this->statuses[ $status ];
110
+ }
111
+
112
+ /**
113
+ * Event time array filter.
114
+ */
115
+ public function filter_array( $array, $post_id = 0 ) {
116
+ if ( ! $post_id ) $post_id = get_the_ID();
117
+ $status = get_post_meta( $post_id, 'sp_status', true );
118
+ if ( ! $status || 'ok' === $status || ! array_key_exists( $status, $this->statuses ) ) return $array;
119
+ return array( $this->statuses[ $status ] );
120
+ }
121
+ }
122
+
123
+ endif;
124
+
125
+ new SportsPress_Event_Status();
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: 1.9
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 1.9
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', '1.9' );
52
 
53
  if ( !defined( 'SP_ICONS_URL' ) )
54
  define( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) );
@@ -106,7 +106,12 @@ class SportsPress_Icons {
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
- $icons = str_repeat( '<i class="sp-icon-' . $icon . '" title="' . $title . '" style="color:' . $color . '"></i>' . ' ', $value );
 
 
 
 
 
110
  }
111
  return $icons;
112
  }
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
  * Main SportsPress Icons Class
18
  *
19
  * @class SportsPress_Icons
20
+ * @version 2.1
21
  */
22
  class SportsPress_Icons {
23
 
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__ ) );
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;
117
  }
modules/sportspress-lazy-loading.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://tboy.co/pro
5
  Description: Load players using Ajax to speed up the event edit screen.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com
8
- Version: 2.0.13
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Lazy_Loading' ) ) :
17
  * Main SportsPress Lazy Loading Class
18
  *
19
  * @class SportsPress_Lazy_Loading
20
- * @version 2.0.13
21
  */
22
  class SportsPress_Lazy_Loading {
23
 
@@ -175,7 +175,7 @@ class SportsPress_Lazy_Loading {
175
  $diff = array_diff( $post_ids, $selected );
176
  $selected = array_flip( $selected );
177
  ?>
178
- <div id="<?php echo $slug; ?>-all" class="posttypediv wp-tab-panel sp-tab-panel sp-ajax-checklist sp-select-all-range" style="display: <?php echo $display; ?>;">
179
  <input type="hidden" value="0" name="<?php echo $slug; ?><?php if ( isset( $index ) ) echo '[' . $index . ']'; ?>[]" />
180
  <ul class="categorychecklist form-no-clear">
181
  <?php if ( is_array( $posts ) && sizeof( $posts ) ) { ?>
5
  Description: Load players using Ajax to speed up the event edit screen.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com
8
+ Version: 2.1
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Lazy Loading Class
18
  *
19
  * @class SportsPress_Lazy_Loading
20
+ * @version 2.1
21
  */
22
  class SportsPress_Lazy_Loading {
23
 
175
  $diff = array_diff( $post_ids, $selected );
176
  $selected = array_flip( $selected );
177
  ?>
178
+ <div id="<?php echo $slug; ?>-all" class="posttypediv tabs-panel wp-tab-panel sp-tab-panel sp-ajax-checklist sp-select-all-range" style="display: <?php echo $display; ?>;">
179
  <input type="hidden" value="0" name="<?php echo $slug; ?><?php if ( isset( $index ) ) echo '[' . $index . ']'; ?>[]" />
180
  <ul class="categorychecklist form-no-clear">
181
  <?php if ( is_array( $posts ) && sizeof( $posts ) ) { ?>
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.0
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.0
21
  */
22
  class SportsPress_League_Tables {
23
 
@@ -49,7 +49,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.0' );
53
 
54
  if ( !defined( 'SP_LEAGUE_TABLES_URL' ) )
55
  define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );
@@ -299,6 +299,7 @@ class SportsPress_League_Tables {
299
  return array_merge( $templates, array(
300
  'tables' => array(
301
  'title' => __( 'League Tables', 'sportspress' ),
 
302
  'option' => 'sportspress_team_show_tables',
303
  'action' => 'sportspress_output_team_tables',
304
  'default' => 'yes',
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
  * Main SportsPress League Tables Class
18
  *
19
  * @class SportsPress_League_Tables
20
+ * @version 2.1.4
21
  */
22
  class SportsPress_League_Tables {
23
 
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__ ) );
299
  return array_merge( $templates, array(
300
  'tables' => array(
301
  'title' => __( 'League Tables', 'sportspress' ),
302
+ 'label' => __( 'League Table', 'sportspress' ),
303
  'option' => 'sportspress_team_show_tables',
304
  'action' => 'sportspress_output_team_tables',
305
  'default' => 'yes',
modules/sportspress-player-lists.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add player lists to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.0
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Player_Lists' ) ) :
17
  * Main SportsPress Player Lists Class
18
  *
19
  * @class SportsPress_Player_Lists
20
- * @version 2.0
21
  */
22
  class SportsPress_Player_Lists {
23
 
@@ -48,7 +48,7 @@ class SportsPress_Player_Lists {
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_PLAYER_LISTS_VERSION' ) )
51
- define( 'SP_PLAYER_LISTS_VERSION', '2.0' );
52
 
53
  if ( !defined( 'SP_PLAYER_LISTS_URL' ) )
54
  define( 'SP_PLAYER_LISTS_URL', plugin_dir_url( __FILE__ ) );
@@ -304,6 +304,7 @@ class SportsPress_Player_Lists {
304
  return array_merge( $templates, array(
305
  'lists' => array(
306
  'title' => __( 'Player Lists', 'sportspress' ),
 
307
  'option' => 'sportspress_team_show_lists',
308
  'action' => 'sportspress_output_team_lists',
309
  'default' => 'yes',
5
  Description: Add player lists to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.1.4
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Player Lists Class
18
  *
19
  * @class SportsPress_Player_Lists
20
+ * @version 2.1.4
21
  */
22
  class SportsPress_Player_Lists {
23
 
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_PLAYER_LISTS_VERSION' ) )
51
+ define( 'SP_PLAYER_LISTS_VERSION', '2.1.4' );
52
 
53
  if ( !defined( 'SP_PLAYER_LISTS_URL' ) )
54
  define( 'SP_PLAYER_LISTS_URL', plugin_dir_url( __FILE__ ) );
304
  return array_merge( $templates, array(
305
  'lists' => array(
306
  'title' => __( 'Player Lists', 'sportspress' ),
307
+ 'label' => __( 'Players', 'sportspress' ),
308
  'option' => 'sportspress_team_show_lists',
309
  'action' => 'sportspress_output_team_lists',
310
  'default' => 'yes',
modules/sportspress-tutorials.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Display SportsPress video tutorials.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.0
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Tutorials' ) ) :
17
  * Main SportsPress Tutorials Class
18
  *
19
  * @class SportsPress_Tutorials
20
- * @version 2.0
21
  */
22
  class SportsPress_Tutorials {
23
 
@@ -35,16 +35,26 @@ class SportsPress_Tutorials {
35
 
36
  add_action( 'init', array( $this, 'get_video_ids' ) );
37
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 10 );
 
38
  add_action( 'sportspress_screen_ids', array( $this, 'screen_ids' ) );
39
  add_filter( 'sportspress_next_steps', array( $this, 'next_steps' ) );
40
  }
41
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Define constants.
44
  */
45
  private function define_constants() {
46
  if ( !defined( 'SP_TUTORIALS_VERSION' ) )
47
- define( 'SP_TUTORIALS_VERSION', '2.0' );
48
 
49
  if ( !defined( 'SP_TUTORIALS_URL' ) )
50
  define( 'SP_TUTORIALS_URL', plugin_dir_url( __FILE__ ) );
@@ -119,7 +129,11 @@ class SportsPress_Tutorials {
119
  * Add menu item
120
  */
121
  public function admin_menu() {
122
- add_submenu_page( 'sportspress', __( 'Tutorials', 'sportspress' ), __( 'Tutorials', 'sportspress' ), 'manage_sportspress', 'sportspress-tutorials', array( $this, 'tutorials_page' ) );
 
 
 
 
123
  }
124
 
125
  /**
5
  Description: Display SportsPress video tutorials.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.1
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Tutorials Class
18
  *
19
  * @class SportsPress_Tutorials
20
+ * @version 2.1
21
  */
22
  class SportsPress_Tutorials {
23
 
35
 
36
  add_action( 'init', array( $this, 'get_video_ids' ) );
37
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 10 );
38
+ add_action( 'sportspress_admin_css', array( $this, 'admin_styles' ) );
39
  add_action( 'sportspress_screen_ids', array( $this, 'screen_ids' ) );
40
  add_filter( 'sportspress_next_steps', array( $this, 'next_steps' ) );
41
  }
42
 
43
+ /**
44
+ * Enqueue styles
45
+ */
46
+ public function admin_styles( $screen ) {
47
+ if ( strpos( $screen->id, 'sportspress-tutorials' ) !== false ) {
48
+ wp_enqueue_style( 'sportspress-admin', SP()->plugin_url() . '/assets/css/admin.css', array(), SP_VERSION );
49
+ }
50
+ }
51
+
52
  /**
53
  * Define constants.
54
  */
55
  private function define_constants() {
56
  if ( !defined( 'SP_TUTORIALS_VERSION' ) )
57
+ define( 'SP_TUTORIALS_VERSION', '2.1' );
58
 
59
  if ( !defined( 'SP_TUTORIALS_URL' ) )
60
  define( 'SP_TUTORIALS_URL', plugin_dir_url( __FILE__ ) );
129
  * Add menu item
130
  */
131
  public function admin_menu() {
132
+ if ( current_user_can( 'manage_sportspress' ) ) {
133
+ add_submenu_page( 'sportspress', __( 'Tutorials', 'sportspress' ), __( 'Tutorials', 'sportspress' ), 'manage_sportspress', 'sportspress-tutorials', array( $this, 'tutorials_page' ) );
134
+ } else {
135
+ add_menu_page( __( 'Tutorials', 'sportspress' ), __( 'Tutorials', 'sportspress' ), 'edit_sp_players', 'sportspress-tutorials', array( $this, 'tutorials_page' ), 'dashicons-video-alt3' );
136
+ }
137
  }
138
 
139
  /**
presets/team-sports/basketball.json CHANGED
@@ -20,50 +20,53 @@
20
  { "name" : "T", "id" : "points", "description" : "Total points", "primary" : 1 }
21
  ],
22
  "performance": [
23
- { "name" : "MIN", "description" : "Minutes" },
 
 
 
 
24
  { "name" : "FGM", "description" : "Field goals made" },
25
  { "name" : "FGA", "description" : "Field goals attempted" },
26
- { "name" : "FTM", "description" : "Free throws made" },
27
- { "name" : "FTA", "description" : "Free throws attempted" },
28
  { "name" : "3PM", "description" : "3-pointers made" },
29
  { "name" : "3PA", "description" : "3-pointers attempted" },
30
- { "name" : "OFF REB", "description" : "Offensive rebounds" },
31
- { "name" : "DEF REB", "description" : "Defensive rebounds" },
32
- { "name" : "AST", "description" : "Assists" },
33
- { "name" : "PF", "description" : "Personal fouls" },
34
- { "name" : "TF", "description" : "Technical fouls" },
35
- { "name" : "STL", "description" : "Steals" },
36
  { "name" : "TO", "description" : "Turnovers" },
37
- { "name" : "BLK", "description" : "Blocks" },
38
- { "name" : "PTS", "description" : "Points" }
39
  ],
40
  "columns": [
41
  { "name" : "W", "equation" : "$win", "description" : "Wins" },
42
  { "name" : "L", "equation" : "$loss", "description" : "Losses" },
43
  { "name" : "PCT", "equation" : "$win / $eventsplayed", "precision" : 3, "priority" : 1, "description" : "Win percentage" },
44
  { "name" : "GB", "equation" : "$gamesback", "precision" : 1, "description" : "Games back" },
 
 
 
 
45
  { "name" : "PF", "equation" : "$pointsfor / $eventsplayed", "priority" : 3, "description" : "Average points for" },
46
  { "name" : "PA", "equation" : "$pointsagainst / $eventsplayed", "description" : "Average points against" },
47
- { "name" : "DIFF", "equation" : "( $pointsfor - $pointsagainst ) / $eventsplayed", "priority" : 2, "description" : "Average point differential" },
48
- { "name" : "L10", "equation" : "$last10", "description" : "Last 10 games" },
49
- { "name" : "STRK", "equation" : "$streak", "description" : "Current streak" }
50
  ],
51
  "metrics": [
52
  "Height",
53
  "Weight"
54
  ],
55
  "statistics": [
56
- { "name" : "G", "equation" : "$eventsplayed", "description" : "Games played" },
57
  { "name" : "GS", "equation" : "$eventsstarted", "description" : "Games started" },
58
- { "name" : "MPG", "equation" : "$min / $eventsplayed", "precision" : 1, "description" : "Minutes per game" },
59
- { "name" : "FG%", "equation" : "$fgm / $fga", "precision" : 3, "description" : "Field goal percentage" },
60
- { "name" : "FT%", "equation" : "$ftm / $fta", "precision" : 3, "description" : "Free throw percentage" },
61
- { "name" : "3P%", "equation" : "$threepm / $threepa", "precision" : 3, "description" : "3-pointer percentage" },
62
- { "name" : "RPG", "equation" : "( $offreb + $defreb ) / $eventsplayed", "precision" : 1, "description" : "Rebounds per game" },
63
  { "name" : "APG", "equation" : "$ast / $eventsplayed", "precision" : 1, "description" : "Assists per game" },
64
  { "name" : "SPG", "equation" : "$stl / $eventsplayed", "precision" : 1, "description" : "Steals per game" },
65
  { "name" : "BPG", "equation" : "$blk / $eventsplayed", "precision" : 1, "description" : "Blocks per game" },
66
  { "name" : "PPG", "equation" : "$pts / $eventsplayed", "precision" : 1, "description" : "Points per game" },
67
- { "name" : "EFF", "equation" : "$pts + $offreb + $defreb + $ast + $stl + $blk - $fga + $fgm - $fta + $ftm + $to", "description" : "Efficiency rating" }
68
  ]
69
  }
20
  { "name" : "T", "id" : "points", "description" : "Total points", "primary" : 1 }
21
  ],
22
  "performance": [
23
+ { "name" : "PTS", "description" : "Points" },
24
+ { "name" : "REB", "format" : "equation", "equation" : "$off + $def", "description" : "Rebounds" },
25
+ { "name" : "AST", "description" : "Assists" },
26
+ { "name" : "STL", "description" : "Steals" },
27
+ { "name" : "BLK", "description" : "Blocks" },
28
  { "name" : "FGM", "description" : "Field goals made" },
29
  { "name" : "FGA", "description" : "Field goals attempted" },
30
+ { "name" : "FG%", "format" : "equation", "precision" : 1, "equation" : "( $fgm / $fga ) * 100", "description" : "Field goal percentage" },
 
31
  { "name" : "3PM", "description" : "3-pointers made" },
32
  { "name" : "3PA", "description" : "3-pointers attempted" },
33
+ { "name" : "3P%", "format" : "equation", "precision" : 1, "equation" : "( $threepm / $threepa ) * 100", "description" : "3-pointer percentage" },
34
+ { "name" : "FTM", "description" : "Free throws made" },
35
+ { "name" : "FTA", "description" : "Free throws attempted" },
36
+ { "name" : "FT%", "format" : "equation", "precision" : 1, "equation" : "( $ftm / $fta ) * 100", "description" : "Free throw percentage" },
37
+ { "name" : "OFF", "description" : "Offensive rebounds" },
38
+ { "name" : "DEF", "description" : "Defensive rebounds" },
39
  { "name" : "TO", "description" : "Turnovers" },
40
+ { "name" : "PF", "description" : "Personal fouls" }
 
41
  ],
42
  "columns": [
43
  { "name" : "W", "equation" : "$win", "description" : "Wins" },
44
  { "name" : "L", "equation" : "$loss", "description" : "Losses" },
45
  { "name" : "PCT", "equation" : "$win / $eventsplayed", "precision" : 3, "priority" : 1, "description" : "Win percentage" },
46
  { "name" : "GB", "equation" : "$gamesback", "precision" : 1, "description" : "Games back" },
47
+ { "name" : "Home", "equation" : "$homerecord", "description" : "Home record" },
48
+ { "name" : "Road", "equation" : "$awayrecord", "description" : "Road record" },
49
+ { "name" : "L10", "equation" : "$last10", "description" : "Last 10 games" },
50
+ { "name" : "STRK", "equation" : "$streak", "description" : "Current streak" },
51
  { "name" : "PF", "equation" : "$pointsfor / $eventsplayed", "priority" : 3, "description" : "Average points for" },
52
  { "name" : "PA", "equation" : "$pointsagainst / $eventsplayed", "description" : "Average points against" },
53
+ { "name" : "DIFF", "equation" : "( $pointsfor - $pointsagainst ) / $eventsplayed", "priority" : 2, "description" : "Average point differential" }
 
 
54
  ],
55
  "metrics": [
56
  "Height",
57
  "Weight"
58
  ],
59
  "statistics": [
60
+ { "name" : "G", "equation" : "$eventsattended", "description" : "Games played" },
61
  { "name" : "GS", "equation" : "$eventsstarted", "description" : "Games started" },
62
+ { "name" : "FG%", "equation" : "( $fgm / $fga ) * 100", "precision" : 3, "description" : "Field goal percentage" },
63
+ { "name" : "FT%", "equation" : "( $ftm / $fta ) * 100", "precision" : 3, "description" : "Free throw percentage" },
64
+ { "name" : "3P%", "equation" : "( $threepm / $threepa ) * 100", "precision" : 3, "description" : "3-pointer percentage" },
65
+ { "name" : "RPG", "equation" : "( $off + $def ) / $eventsplayed", "precision" : 1, "description" : "Rebounds per game" },
 
66
  { "name" : "APG", "equation" : "$ast / $eventsplayed", "precision" : 1, "description" : "Assists per game" },
67
  { "name" : "SPG", "equation" : "$stl / $eventsplayed", "precision" : 1, "description" : "Steals per game" },
68
  { "name" : "BPG", "equation" : "$blk / $eventsplayed", "precision" : 1, "description" : "Blocks per game" },
69
  { "name" : "PPG", "equation" : "$pts / $eventsplayed", "precision" : 1, "description" : "Points per game" },
70
+ { "name" : "EFF", "equation" : "$pts + $off + $def + $ast + $stl + $blk - $fga + $fgm - $fta + $ftm + $to", "description" : "Efficiency rating" }
71
  ]
72
  }
presets/team-sports/cricket.json CHANGED
@@ -37,7 +37,7 @@
37
  { "name" : "NR", "equation" : "$noresult", "description" : "No results" },
38
  { "name" : "BP", "equation" : "$bpfor", "description" : "Bonus points" },
39
  { "name" : "Points", "equation" : "$win * 2 + $draw", "priority" : 1, "description" : "Total points" },
40
- { "name" : "NRR", "equation" : "( $runsfor / $oversfor ) - ( $runsagainst / $oversagainst )", "priority" : 2, "precision" : 3, "description" : "Net run rate" }
41
  ],
42
  "metrics": [
43
  "Height",
37
  { "name" : "NR", "equation" : "$noresult", "description" : "No results" },
38
  { "name" : "BP", "equation" : "$bpfor", "description" : "Bonus points" },
39
  { "name" : "Points", "equation" : "$win * 2 + $draw", "priority" : 1, "description" : "Total points" },
40
+ { "name" : "NRR", "equation" : "( $runsfor / $oversfor ) - ( $runsagainst / $oversagainst )", "priority" : 3, "precision" : 3, "description" : "Net run rate" }
41
  ],
42
  "metrics": [
43
  "Height",
presets/team-sports/soccer.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "name": "Association Football",
3
  "positions": [
4
  "Goalkeeper",
5
  "Defender",
1
  {
2
+ "name": "Football",
3
  "positions": [
4
  "Goalkeeper",
5
  "Defender",
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === SportsPress - Sports Club & League Manager ===
2
  Contributors: ThemeBoy, brianmiyaji, aylaview, rochesterj
3
- Tags: sport, sports, club, clubs, teams, statistics, stats, metrics, data, fixtures, results, standings, league tables, leagues, shortcodes, sports data, sports club, themeboy, esports, wordpress sports, equations, calculations, events, calendars, players, profiles, staff, seasons, countdowns, club management, football, nfl, footy, afl, baseball, basketball, cricket, darts, handball, hockey, netball, rugby, snooker, soccer, squash, tennis, volleyball, dota 2, league of legends, golf
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
- Tested up to: 4.6
7
- Stable tag: 2.0.16
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -210,7 +210,7 @@ The plugin comes preinstalled with several different sports presets to help you
210
 
211
  = Can I import teams/players/staff/matches? =
212
 
213
- Yes, CSV importers are included with the plugin. Go to Tools > Import and choose from one of the SportsPress CSV importers.
214
 
215
  = What's the difference between the free and Pro plugin? =
216
 
@@ -239,6 +239,81 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
239
 
240
  == Changelog ==
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  = 2.0.16 =
243
  * Tweak - Add shortcode parameter to override global date in event calendar.
244
 
@@ -325,1021 +400,5 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
325
  * Fix - Avoid loading countdown widget if no events are available.
326
  * Preset - Update baseball, cricket, floorball, handball, ice hockey, and softball presets.
327
 
328
- = 1.9.20 =
329
- * Tweak - Expand event title section for team logos in countdown widget.
330
- * Tweak - Center align team logo images in event.
331
- * Tweak - Add iCal feed venue name and description.
332
- * Fix - Escape address, summary, and description in iCal feed.
333
- * Preset - Add ties and defense/offense definition to baseball preset.
334
- * Localization - Add West Indies to nationality options.
335
- * Localization - Update strings.
336
-
337
- = 1.9.19 =
338
- * Feature - Add Birthdays module.
339
- * Feature - Add Lazy Loading module.
340
- * Feature - Add separate offense and defense categories to player performance and box score.
341
- * Feature - Add format setting to player performance with the options Number and Text.
342
- * Feature - Add option to show and hide date and time in events.
343
- * Tweak - Improve compatibility between custom color settings and theme options.
344
- * Tweak - Add light shade to substitute rows in box score.
345
- * Tweak - Prevent box score section from appearing when event is set in the future.
346
- * Fix - Display icon setting in editor.
347
- * Fix - Empty variable button appearing in equation builder when equation is empty.
348
- * Preset - Update cricket preset with batting and bowling categories.
349
-
350
- = 1.9.15 =
351
- * Tweak - Add medium crop image size to ensure gallery images are square.
352
- * Tweak - Add shortcut icon to admin bar.
353
- * Fix - Mobile admin table cell width.
354
- * Fix - Tutorial tab styling.
355
- * Localization - Update Norwegian Bokmål and Turkish translations.
356
-
357
- = 1.9.14 =
358
- * Fix - Error appearing on team page in some cases when there are no competitions or seasons.
359
- * Localization - Update source language file.
360
-
361
- = 1.9.13 =
362
- * Feature - Add option to display positions in player lists.
363
- * Feature - Add option to show or hide player squad number and rank column.
364
- * Feature - Add ability to display staff members in team page.
365
- * Feature - Unique widget option added to hide widget when same as content.
366
- * Tweak - Get auto and manual league tables in team page.
367
- * Tweak - Add row numbers to league table and event list.
368
- * Tweak - Allow searching from middle of sport preset names.
369
- * Tweak - Remove deprecated settings from admin.
370
- * Tweak - Prevent unnecessary scrollbar from appearing under scrollable tables.
371
- * Tweak - Add spaces between results in event blocks widget.
372
- * Tweak - Default template positions adjusted to render main content first.
373
- * Tweak - Adjust checkbox column padding in admin.
374
- * Tweak - Prevent positions and jobs from automatically linking to archives.
375
- * Tweak - Adjust capabilities to allow team managers to edit venues.
376
- * Fix - Player gallery thumbnail size too small in some cases.
377
- * Fix - Competitive event icon in edit screen.
378
- * Fix - SportsPress widget icons not appearing in 4.4 admin.
379
- * Localization - Add demoyer to translation team.
380
- * Localization - Update Dutch translations.
381
-
382
- = 1.9.12 =
383
- * Tweak - Display team names and score template without logos.
384
- * Tweak - Validate hex color input.
385
- * Tweak - Add sp prefix to TGMPA notice to avoid conflict with other plugins.
386
- * Fix - Empty seasons displaying in player profiles.
387
- * Fix - Error on pages with no screen objects.
388
- * Localization - Add Tandor, muhahmetkara, elarequi, diego.battistella, and tkausch to translation team.
389
- * Localization - Update Polish, Tamil, German, Turkish, Spanish, Dutch, and Portuguese translations.
390
-
391
- = 1.9.10 =
392
- * Fix - Automatic event results calculating without player performance.
393
- * Localization - Update Turkish translation.
394
-
395
- = 1.9.9 =
396
- * Feature - Enable presets to define result equations.
397
- * Tweak - Move event logo settings to new section in admin.
398
- * Tweak - Disable custom colors by default.
399
- * Tweak - Display league tables and player lists as auto when not manual.
400
- * Fix - Prevent teams containing quotes to duplicate during import.
401
- * Fix - Enable importing with special characters in team and player names.
402
- * Fix - Check for zero in equation denominator contained within parenthesis.
403
- * Fix - Placeholder in admin indicating automatic result.
404
- * Preset - Update cricket preset.
405
- * Localization - Update Tamil translation.
406
-
407
- = 1.9.8 =
408
- * Feature - Option to add custom table headings to calendars, league tables, and player lists.
409
- * Tweak - Revert automatically hiding featured images when viewing teams, players, and staff.
410
- * Fix - Team site URL escaping links in admin.
411
-
412
- = 1.9.7 =
413
- * Fix - Escape text inputs in admin.
414
- * Localization - Update German translation.
415
-
416
- = 1.9.6 =
417
- * Feature - Venue subset to reflect statistics from a team's home venue.
418
- * Tweak - Use team order instead of venue to get home and away subset.
419
- * Tweak - Allow special HTML characters in player list fields.
420
- * Tweak - Relabel box score to scorecard.
421
- * Fix - Player list sorting by ascending squad number.
422
- * Localization - Add Ales70, Elmister, and chinnz25 to translation team.
423
- * Localization - Add Tamil (India) translations.
424
- * Localization - Update Persian, Finnish, Italian, Czech, Greek, Slovenian, and Polish translations.
425
-
426
- = 1.9.5 =
427
- * Fix - Streaks calculation in league tables.
428
-
429
- = 1.9.4 =
430
- * Feature - Add Home and Away subset options to table column equation builder.
431
- * Tweak - Display player and team checklists in admin only when Manual mode is enabled to improve performance.
432
- * Localization - Add mahdi12 to translation team.
433
- * Localization - Update Persian and Polish translation.
434
-
435
- = 1.9.3 =
436
- * Fix - Event results skipping some players in player list.
437
-
438
- = 1.9.2 =
439
- * Fix - Dynamic stats not being reflected in player lists.
440
-
441
- = 1.9.1 =
442
- * Fix - Add up statistics from multiple competitions and seasons in player list.
443
- * Fix - Use player metrics as default in player list.
444
- * Localization - Update Spanish translation.
445
-
446
- = 1.9 =
447
- * Feature - New Icons module containing vector icon options for player performance.
448
- * Feature - Add event results to equation builder.
449
- * Feature - Allow different page templates to be selected for each post type.
450
- * Feature - Add equation builder to automate event results based on player performance.
451
- * Feature - Allow Event Managers to edit venues.
452
- * Feature - Display post excerpts in templates.
453
- * Feature - Hide featured image if photo or logo is displayed.
454
- * Feature - Add default outcome condition for events with more than 2 teams.
455
- * Feature - Add option to display competition and season in player details.
456
- * Feature - Add Google map zoom option.
457
- * Feature - Add national flag option to player list.
458
- * Feature - Add competition and season filter to manually inserted calendar shortcodes.
459
- * Refactor - Move cricket functionality to free extension.
460
- * Tweak - Improve individual mode admin screens and functionality.
461
- * Tweak - Add styling to default event teams template.
462
- * Tweak - Add cell padding to admin edit table.
463
- * Tweak - Display position column only if positions exist.
464
- * Tweak - Display Performance as Box Score in all occurrences.
465
- * Tweak - Simplify sample data team names.
466
- * Tweak - Move League Table module to Teams section.
467
- * Tweak - Display column labels for time and results in split team mode.
468
- * Tweak - Lock variable names once published to prevent equations from breaking.
469
- * Tweak - Rename featured image meta boxes to reflect image type.
470
- * Tweak - Improve readability of equations in admin.
471
- * Tweak - Trim delimiter example when limit is more than 3 teams.
472
- * Tweak - Allow a team limit of 0 for unlimited teams per event.
473
- * Fix - Sample data generator for individual mode.
474
- * Fix - Overview hierarchy in individual mode.
475
- * Fix - Event delimiter sample output.
476
- * Fix - Error in league table when stats are empty.
477
- * Fix - Check if teams exist in countdown.
478
- * Preset - Add golf preset.
479
- * Preset - Recommend sport-specific extensions for cricket, golf, and football (soccer).
480
- * Localization - Update Greek and French translations.
481
-
482
- = 1.8.9 =
483
- * Feature - Enable multiple nationalities for players and staff.
484
- * Feature - Enable multiple seasons and competitions for league tables.
485
- * Feature - Enable multiple seasons, competitions, and positions for player lists.
486
- * Feature - Add custom title field and widget alignment option to shortcodes.
487
- * Feature - Add option to always increment league table position.
488
- * Fix - Import button on admin pages.
489
- * Fix - Update jQuery DataTables to version 1.10.8 props devilsaces.
490
- * Localization - Group translation team by language and display stats.
491
- * Localization - Add albpower, elgolden, mobking, wah826, iojvan, eifelstudio, deckerweb, denkuhn, green_big_frog, Flubber89, sododesign, webby1973, Laislebai, slappfiskene.no, AugustoNeto, lfrodines, GonerSTUDIO, cofeman.sl, i1m3a7n92, opticadeharo, and ViktoriaRuzhylo to translation team.
492
- * Localization - Update Polish, Finnish, Armenian, German, Slovenian, Italian, Czech, Dutch, Spanish, Romanian, and French translations.
493
-
494
- = 1.8.8 =
495
- * Feature - Add option to hide player and staff details.
496
- * Tweak - Ability to display multiple current teams in staff profile.
497
-
498
- = 1.8.7 =
499
- * Feature - Add custom table heading option to widgets.
500
- * Feature - Add random sorting to player gallery.
501
- * Feature - Add option to hide player list and league table titles.
502
- * Feature - Add heading option to player positions.
503
- * Tweak - Display Soccer (Association Football) as Football.
504
- * Tweak - Flush permalinks automatically when saving modules.
505
- * Tweak - Separate scrollable and responsive table options.
506
- * Tweak - Display event performance icon tables in 2 columns.
507
- * Fix - Duplicate league table captions in team page.
508
- * Preset - Add softball preset.
509
- * Localization - Add FollowCandyPanda to translation team.
510
- * Localization - Update Polish, Spanish, German, Norwegian, Dutch, Finnish, Russian, Armenian, and Czech translations.
511
-
512
- = 1.8.6 =
513
- * Tweak - Update modules page to reflect a change in offered features.
514
- * Fix - Team dropdowns disappearing when none found in the competition and season assigned to an event.
515
- * Localization - Update Russian translations.
516
-
517
- = 1.8.5 =
518
- * Fix - Error merging option arrays.
519
- * Localization - Add m4rsal to translation team.
520
- * Localization - Update Polish, Spanish, German, Norwegian, Dutch, and Finnish translations.
521
-
522
- = 1.8.4 =
523
- * Fix - Installation screen notice related to default color scheme.
524
- * Localization - Add vetsmi, ceyhunulas, pgbenini, paulcoppen, fernandori, wolforg, and chr86 to translation team.
525
- * Localization - Update Dutch, Spanish, Portuguese (Brazil), French, and German translations.
526
-
527
- = 1.8.3 =
528
- * Tweak - Settings page styling updated.
529
- * Tweak - New modules category added for admin-related dashboard modules.
530
- * Fix - Widget floating issue in some themes.
531
- * Fix - Timezones added to calendar feeds using blog timezone setting.
532
- * Fix - Event filters generating redundant queries.
533
- * Localization - Update Finnish, Norwegian, Turkish, Polish, Portuguese (Brazil), and Portuguese (Portugal) translations.
534
-
535
- = 1.8.2 =
536
- * Tweak - Make scrollable tables fill content width.
537
- * Tweak - Improve widget alignment precision.
538
- * Tweak - Remove paginate link default color.
539
- * Fix - Future event post permalinks not found.
540
-
541
- = 1.8.1 =
542
- * Feature - Ability to display multiple widgets on one line by aligning left and right.
543
- * Tweak - Increase league table row height only when logos are displayed.
544
- * Fix - Taxonomy selection not displaying in admin after WordPress 4.2 update.
545
- * Localization - Add nagashitw, jikji96, and edesl to translation team.
546
- * Localization - Update Czech, German, Finnish, Portuguese, Korean, Italian, and Spanish translations.
547
-
548
- = 1.8 =
549
- * Feature - Games Behind calculation added to equation builder.
550
- * Feature - Home Record and Away Record calculation added to equation builder.
551
- * Feature - Add option to reverse team order in events.
552
- * Tweak - Allow inline results editing only if user has permissions.
553
- * Tweak - Allow underscore in equation variable names.
554
- * Tweak - Update welcome page with free Rookie theme link.
555
- * Tweak - Group sport presets into more descriptive categories.
556
- * Tweak - Display module descriptions in admin.
557
- * Tweak - Combine player and staff modules.
558
- * Tweak - Move mode setting to event page.
559
- * Tweak - Add option to show only top-level positions in events.
560
- * Tweak - Change Rounding to Decimal Places for clarity.
561
- * Tweak - Change Player Performance to Box Score.
562
- * Tweak - Add proper editing capabilities to Team Manager role.
563
- * Fix - Empty positions hidden in box score.
564
- * Preset - Update baseball preset.
565
- * Localization - Add Kosovo to countries list.
566
- * Localization - Use standard localization functions to improve translatability.
567
- * Localization - Update Spanish and Japanese translations.
568
-
569
- = 1.7.7 =
570
- * Tweak - Add option to filter teams in event by competition and season with no filter as default setting.
571
-
572
- = 1.7.6 =
573
- * Fix - Modules sidebar not displaying in admin.
574
-
575
- = 1.7.5 =
576
- * Fix - Calendars empty when no teams selected.
577
-
578
- = 1.7.4 =
579
- * Feature - Filter teams by competition and season on page load when editing event.
580
- * Feature - Enable multiple team selection in calendars.
581
- * Feature - Ability to install free starter theme from modules page.
582
- * Tweak - Use YouTube for tutorials instead of Vimeo.
583
- * Localization - Update Finnish, Dutch, Czech, Italian, and Polish translations.
584
-
585
- = 1.7.3 =
586
- * Tweak - Add option to hide/show player statistics.
587
- * Tweak - Always load overview, widgets, and importers.
588
- * Fix - Notice displaying in player statistics when no players available.
589
- * Localization - Update Greek, Polish, Finnish, Dutch, and Icelandic translations.
590
-
591
- = 1.7.2 =
592
- * Fix - Player positions disappearing in event page.
593
- * Fix - Individual mode automatically loading by default.
594
- * Localization - Update Polish translation.
595
-
596
- = 1.7.1 =
597
- * Fix - Activation error related to server limitations.
598
- * Localization - Update Greek translation.
599
-
600
- = 1.7 =
601
- * Feature - Enable multiple seasons and competitions to be selected for events, calendars, player lists, and league tables.
602
- * Feature - Enable primary performance selection.
603
- * Feature - Enable event result columns to be displayed automatically.
604
- * Feature - Enable switching overview, widgets, and importers on and off via modules.
605
- * Feature - New color scheme selector.
606
- * Feature - New video tutorials module.
607
- * Feature - Allow event performance tables to be split by team and by player position.
608
- * Feature - Allow extras row to be displayed in event performance.
609
- * Tweak - Display event venue address below map.
610
- * Tweak - Display plugin and theme recommendations only to network admins.
611
- * Tweak - Hide player details section if none available.
612
- * Tweak - Link module request to form instead of email.
613
- * Fix - Responsive table scrollbar causing horizontal page scrolling.
614
- * Fix - Misplaced config meta boxes.
615
- * Fix - Scrollbar appearing in countdown widget.
616
- * Fix - Event blocks template not honoring link events setting.
617
- * Fix - League table position calculations for tied teams.
618
- * Fix - Filter out empty results when viewing events in admin list view.
619
- * Fix - Invalid array issue when viewing league tables.
620
- * Preset - Enable sport presets to define plugin options.
621
- * Preset - Update cricket and ice hockey presets.
622
- * Localization - Number changed to Squad Number.
623
- * Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, Swedish, German, Russian, Greek, Portuguese, and Japanese translations.
624
-
625
- = 1.6.1 =
626
- * Feature - Countdown moved to module and now able to display team logos.
627
- * Feature - Add option to show or hide event list titles.
628
- * Tweak - Display latitude and longitude fields when adding venues.
629
- * Fix - Calculating equations with nested parentheses.
630
- * Fix - Minor meta box mislabeling.
631
- * Preset - Add Lacrosse preset.
632
- * Localization - Update Polish, French, Czech, Dutch, Kannada, Finnish, and Swedish translations.
633
-
634
- = 1.6 =
635
- * Feature - New modules page to quickly toggle additional features.
636
- * Feature - Option to automatically populate player list and league table based on criteria.
637
- * Feature - Display link to CSV importer at the top of admin list pages.
638
- * Feature - Update jQuery dataTables to version 1.10.4.
639
- * Feature - Wrap responsive tables via script.
640
- * Feature - New API functions for team abbreviations.
641
- * Feature - Enable searching team names in event edit screen.
642
- * Refactor - Enable global setting to use plugin as team-vs-team or player-vs-player (beta).
643
- * Refactor - Use 3-letter FIFA country codes with fallback for 2-letter codes.
644
- * Refactor - Merge scrollable and responsive settings.
645
- * Tweak - Make AJAX shortcodes hookable for extensions and modules.
646
- * Tweak - Mode maps setting to events tab.
647
- * Tweak - Highlight jobs link in admin menu when editing a job.
648
- * Tweak - Hide theme notice from welcome pages.
649
- * Tweak - Prepend prefix to frontend CSS selectors.
650
- * Tweak - Change Team Results to Event Results.
651
- * Tweak - Display result rows only for teams that have been selected.
652
- * Fix - League table displaying zeroes when competition is selected and season is set to all.
653
- * Fix - Notice when players don't exist in event.
654
- * Fix - Career totals not displaying in player profiles.
655
- * Fix - Player performance displaying rows when no team is selected.
656
- * Fix - Events linking in countdown widget and event list when option is turned off.
657
- * Fix - Option to hide event blocks title.
658
- * Fix - Event logos displaying different images when teams are not selected.
659
- * Preset - Add default labels for overtime in baseball and basketball presets.
660
- * Preset - Add Counter-Strike: Global Offensive preset.
661
- * Localization - Update list of countries for nationality selection.
662
-
663
- = 1.5 =
664
- * Feature - New inline quick result editing for events.
665
- * Feature - Automatically detect event outcome based on user-defined conditions.
666
- * Feature - Enable individual players to compete in events.
667
- * Feature - Add new API functions for theme developers.
668
- * Feature - Add event list time/results formatting options.
669
- * Feature - Add option to display player career totals.
670
- * Feature - Add option to display team logos in event lists.
671
- * Feature - Add option to display venue in event blocks.
672
- * Feature - Split iCal feed links for Apple Calendar, Google, and Outlook.
673
- * Refactor - Move Staff to dedicated menu link.
674
- * Refactor - Load sportspress.php template as a fallback only.
675
- * Tweak - Add caption header to event blocks.
676
- * Tweak - Add selector classes to event venue rows.
677
- * Tweak - Remove line breaks after template output.
678
- * Tweak - Disable responsive event performance when icons are shown.
679
- * Tweak - Update default color scheme.
680
- * Tweak - Update player gallery thumbnail markup.
681
- * Tweak - Sort Player positions dropdown by slug.
682
- * Tweak - Frontend styling to add margins and fix overflows.
683
- * Fix - Countdown datetime format.
684
- * Fix - Page slug conflict with SendPress.
685
- * Fix - Missing sample event video link.
686
- * Fix - iCal feed formatting when venue location is not set.
687
- * Preset - Update presets to include automatic outcome conditions.
688
- * Localization - Add Puerto Rico to countries list.
689
- * Localization - Update Polish, German, Spanish, Russian, Finnish, Italian, Armenian, Greek, Dutch, Turkish, French, and Bengali translations.
690
-
691
- = 1.4.7 =
692
- * Feature - New staff shortcode and widget to display staff photo and details.
693
- * Tweak - Display player photo in player details shortcode.
694
- * Tweak - Sample event csv to reflect soccer preset.
695
- * Fix - Saving a manual offset timezone.
696
- * Preset - Add player positions to volleyball preset.
697
- * Localization - Update Turkish, Italian, Polish, Finnish, and French translations.
698
-
699
- = 1.4.6 =
700
- * Tweak - Include all events that have results in league table calculations.
701
- * Fix - Duplicate Jobs selector in Edit Staff page.
702
- * Preset - Update basketball preset column priorities.
703
- * Localization - Update Finnish, Polish, Italian, Greek, Dutch, Turkish, and Russian translations.
704
-
705
- = 1.4.5 =
706
- * Fix - Away team players not being displayed without players in home team.
707
- * Fix - Primary team results always using default setting.
708
- * Localization - Update Finnish and Spanish translations.
709
-
710
- = 1.4.4 =
711
- * Feature - Automatically select event venue based on home team.
712
- * Fix - Featured images not displaying in some themes.
713
- * Preset - New Floorball preset.
714
- * Localization - Update Finnish and Armenian translations.
715
-
716
- = 1.4.3 =
717
- * Tweak - Update API functions for events and teams.
718
- * Tweak - Update sample video links.
719
- * Fix - Remove calendar link background color for more consistent styling.
720
- * Localization - Update Finnish, Italian, Russian, and Spanish translations.
721
-
722
- = 1.4.2 =
723
- * Tweak - Remove solid color from base stylesheet to improve integration.
724
-
725
- = 1.4.1 =
726
- * Fix - League table positions not sorting by sort order.
727
-
728
- = 1.4 =
729
- * Feature - New welcome page with intro video and separate tabs.
730
- * Feature - New iCal feeds for event calendars.
731
- * Feature - Add date range selector to event calendars.
732
- * Feature - Ability to insert sample data during installation.
733
- * Feature - Assign teams same position in league table when all values are tied.
734
- * Feature - Display time/results between home and away teams in event list.
735
- * Feature - Theme-specific stylesheets to apply when third-party theme is active.
736
- * Feature - Make event lists sortable.
737
- * Feature - Add team and event logo templates.
738
- * Feature - Add player and staff photo templates.
739
- * Feature - Option to hide Rank column in player lists.
740
- * Feature - Option to toggle frontend templates per post type.
741
- * Feature - Option to use abbreviated team names.
742
- * Feature - Option to enable comments in events articles.
743
- * Refactor - Change label for League to Competition.
744
- * Tweak - Bold and apply class to highlighted team name in league table.
745
- * Tweak - Remove team from venue hierarchy in overview.
746
- * Tweak - Admin editor styles to match WordPress 4.0 inline editor.
747
- * Tweak - Display performance icons in admin.
748
- * Tweak - Change default sport to Custom.
749
- * Tweak - Display none when no team available for player.
750
- * Tweak - Permanently delete config post types when sent to trash.
751
- * Tweak - Add hooks to widgets, shortcodes, and templates for integration.
752
- * Fix - Display team checkbox only once in player admin.
753
- * Fix - CSV team importer not saving all fields.
754
- * Preset - Adjust player positions in sport presets.
755
- * Preset - Add Bats / Throws metric to Baseball preset.
756
- * Preset - Add Bat brand metric to Cricket preset.
757
- * Localization - Make Video and Current Teams translatable.
758
- * Localization - Auto-load RTL stylesheet.
759
- * Localization - Include only compiled languages to reduce overall size.
760
- * Localization - Apply text options to translations.
761
- * Localization - Update Dutch, French, Armenian, Russian, Croatian, German, Greek, Thai, Japanese, Bosnian, Turkish, Spanish, Arabic, Italian, and Polish translations.
762
-
763
- = 1.3.2 =
764
- * Integration - WPML compatibility.
765
- * Feature - Option to set number of columns in player gallery.
766
- * Tweak - Remove line break after templates.
767
- * Tweak - Update plugin icon.
768
- * Tweak - Update welcome screen badge.
769
- * Tweak - Display admin menu label as Players & Staff.
770
- * Fix - Typo in sample CSV import file.
771
- * Fix - Apply default color scheme when left blank.
772
- * Fix - Notices where taxonomies or posts not found.
773
- * Localization - Update source strings.
774
- * Localization - Update French and Dutch translations.
775
-
776
- = 1.3.1 =
777
- * Fix - Player list shortcode meta displayed on league table edit page.
778
- * Localization - Update Dutch translation.
779
-
780
- = 1.3 =
781
- * Feature - New overview page with interactive sitemap.
782
- * Feature - New and improved CSV import tools for bulk adding.
783
- * Feature - New full time minutes setting in events for statistics calculation.
784
- * Feature - New roles taxonomy for staff.
785
- * Feature - Option to display home/away teams in event lists.
786
- * Feature - Option to display league and season in event blocks.
787
- * Feature - Option to choose all leagues and seasons in league table.
788
- * Feature - Option to choose all leagues and seasons in player list.
789
- * Feature - Choose between displaying values and icons in event player performance.
790
- * Feature - Option to display photos in player list.
791
- * Feature - Filter players by league and season in admin.
792
- * Feature - Select a team to highlight in league tables.
793
- * Feature - Display league tables in team pages.
794
- * Feature - Display total statistics per player.
795
- * Feature - Add team option to countdown widget.
796
- * Feature - Add scrollable tables option.
797
- * Feature - Ability to adjust overall table columns per team.
798
- * Refactor - Remove individual mode in favor of upcoming hybrid.
799
- * Refactor - Use global linking options per post type.
800
- * Refactor - Display player position in profile.
801
- * Tweak - Reorganize settings options.
802
- * Tweak - Update SportsPress icon.
803
- * Tweak - Rename widgets for better usability.
804
- * Tweak - Add div wrappers to templates for easier targeting.
805
- * Tweak - Show or hide admin checkboxes based on event format.
806
- * Tweak - Make event list and blocks pagination independent.
807
- * Tweak - Trim admin table padding.
808
- * Tweak - Display all event performance columns by default.
809
- * Fix - Event list results column not always displaying.
810
- * Preset - New Rugby Union preset.
811
- * Preset - New League of Legends preset.
812
- * Preset - New DotA 2 preset.
813
- * Preset - Group into traditional sports and esports.
814
- * Preset - Add missing primary results and column priorities.
815
- * Localization - Fix multilingual post linking.
816
- * Localization - Thai translation by Xyteton.
817
- * Localization - Add Xyteton, tyby94, & SilverXp to translation team.
818
- * Localization - Update translations from Transifex.
819
-
820
- = 1.2.8 =
821
- * Preset - Add water polo preset.
822
- * Localization - Add Macedonian translations.
823
- * Localization - Update Armenian, Bulgarian, Finnish, German, Greek, Japanese, & Norwegian translations.
824
-
825
- = 1.2.7 =
826
- * Fix - Responsive table columns hidden when script active.
827
- * Localization - Update Finnish & German translations.
828
-
829
- = 1.2.6 =
830
- * Fix - Number format rounding issue.
831
-
832
- = 1.2.5 =
833
- * Fix - Data calculations for values above 1000.
834
- * Localization - Update French, Finnish, Dutch, Greek, & Armenian translations.
835
-
836
- = 1.2.4 =
837
- * Fix - Team URL and abbreviation not saving when adding new team.
838
- * Localization - Update Armenian, Finnish, French, & German translations.
839
-
840
- = 1.2.3 =
841
- * Feature - Display event results in admin teams columns.
842
- * Tweak - Ensure teams are in order in event results.
843
- * Fix - Streaks calculator in league tables.
844
- * Fix - Streaks calculator in team columns.
845
- * Localization - Update German, Greek, & Norwegian translations.
846
-
847
- = 1.2.2 =
848
- * Tweak - Display link to docs instead of themes.
849
- * Fix - Enable hide theme support notice.
850
- * Fix - Typo in table caption classes.
851
-
852
- = 1.2.1 =
853
- * Feature - Enable option to display team's total player performance per event.
854
- * Tweak - Order player gallery positions by slug.
855
- * Tweak - Remove unused Played column setting from Player List widget.
856
- * Fix - League Table widget columns setting independent from post setting.
857
- * Fix - Event List widget columns setting not being applied.
858
- * Fix - Row limits in League Table, Player List, & Event List shortcodes.
859
- * Localization - Update Armenian, Finnish, & French translations.
860
-
861
- = 1.2 =
862
- * Feature - Shortcode dropdown menu added to page and post editor.
863
- * Feature - New shortcodes added to individual player profiles.
864
- * Tweak - Add timezone setting in place of base country.
865
- * Localization - Update translations.
866
-
867
- = 1.1.8 =
868
- * Tweak - Order player list positions by slug.
869
- * Tweak - Wrap templates with div for frontend styling.
870
- * Fix - Date format in sample events CSV.
871
- * Localization - Fix WPML duplicate posts.
872
- * Localization - Update Armenian, Finnish, French, German, Norwegian, & Spanish translations.
873
-
874
- = 1.1.7 =
875
- * Fix - Inconsistent country code for Wales.
876
- * Fix - Localize post date month names.
877
- * Fix - Warning message when changing mode on welcome page.
878
- * Localization - Update Armenian, French, Italian & Norwegian translations.
879
-
880
- = 1.1.6 =
881
- * Fix - Maps not loading in admin.
882
-
883
- = 1.1.5 =
884
- * Tweak - Wrap post content with div for easier templating.
885
- * Localization - Update French translation.
886
- * Localization - Update Spanish translation.
887
-
888
- = 1.1.4 =
889
- * Feature - Add home venue option in team admin.
890
- * Tweak - Move editor meta boxes to bottom of post edit page.
891
- * Tweak - Remove link to league and season archives.
892
- * Fix - Previous and next post function in some themes.
893
- * Fix - Duplicate team checkboxes in player.
894
- * Preset - Add table tennis preset.
895
- * Preset - Update ice hockey preset.
896
-
897
- = 1.1.3 =
898
- * Fix - Display all event result columns by default.
899
-
900
- = 1.1.2 =
901
- * Feature - Event outcome abbreviation for streak column.
902
- * Fix - League table calculations for constants with 2 or more digits.
903
- * Preset - Add ice hockey preset.
904
- * Preset - Add volleyball preset.
905
- * Localization - Update Armenian translation.
906
- * Localization - Update Finnish translation.
907
- * Localization - Update German translation.
908
-
909
- = 1.1.1 =
910
- * Tweak - Check if equation is attempting to divide by zero to prevent errors.
911
- * Fix - Player statistics meta box message.
912
- * Preset - Make baseball preset appear in dropdown.
913
-
914
- = 1.1 =
915
- * Feature - Enable individual sport mode.
916
- * Feature - Enable displaying player lists on team pages.
917
- * Feature - Enable player performance reordering in events.
918
- * Feature - Enable changing player numbers and positions per event.
919
- * Feature - Add date selector to display today's events and this week's events in calendar.
920
- * Feature - Option to redirect team permalinks to official team website instead of team page.
921
- * Feature - Display staff in event performance section.
922
- * Feature - Add column selector to player profiles and player lists.
923
- * Feature - Add option to show or hide player performance section in events.
924
- * Feature - Add global padding option to SportsPress settings.
925
- * Tweak - Force decimals to display when precision is set.
926
- * Tweak - Add SportsPress post types to At a Glance section in dashboard.
927
- * Tweak - Filter checklists by league and season.
928
- * Tweak - Display layout type in admin.
929
- * Tweak - Improve roles and permissions.
930
- * Fix - Some select all checkboxes defaulted to being checked.
931
- * Refactor - Use gettext filter to alter frontend text.
932
- * Preset - Add American Football preset.
933
- * Preset - Add Australian Rules Football preset.
934
- * Preset - Add baseball preset.
935
- * Preset - Add cricket preset.
936
- * Preset - Add darts preset.
937
- * Preset - Add handball preset.
938
- * Preset - Add netball preset.
939
- * Preset - Add Rugby League preset.
940
- * Preset - Add squash preset.
941
- * Preset - Add tennis preset.
942
- * Preset - Update soccer preset.
943
- * Localization - Armenian translation by ArtakEVN.
944
- * Localization - Update translations.
945
-
946
- = 1.0.4 =
947
- * Fix - Shorthand php notation removed for better compatibility.
948
- * Localization - Update Finnish translation.
949
- * Localization - Update Greek translation.
950
-
951
- = 1.0.3 =
952
- * Tweak - Hide theme integration notice.
953
-
954
- = 1.0.2 =
955
- * Fix - Initialize columns array in player list class.
956
-
957
- = 1.0.1 =
958
- * Fix - Conditional install error relating to post types function.
959
-
960
- = 1.0 =
961
- * Feature - New drag and drop equation builder.
962
- * Feature - Add team website link in admin.
963
- * Feature - Enable searching for post user when there are more than 10.
964
- * Feature - New event manager role that can publish and manage events only.
965
- * Tweak - Fix league table alignment and responsive height.
966
- * Tweak - Set maximum size of event blocks logos.
967
- * Tweak - Add option to link venues in event list.
968
- * Tweak - Remove margin between table and scrollbar.
969
- * Tweak - Display delimiter between team logos under event title.
970
- * Tweak - Hide media, comments, and tools from feature limited users.
971
- * Tweak - Hide previous and next post links for custom post types.
972
- * Tweak - Rounding explicitly displays all decimal places.
973
- * Refactor - Combine players and staff in admin menu.
974
- * Fix - Duplicate team logos in event blocks.
975
- * Fix - Query future events for next team event.
976
- * Fix - Live countdown in admin dashboard.
977
- * Fix - Display all current teams in player profile.
978
- * Localization - Norwegian Bokmål translation by sijo.
979
- * Localization - Update translations.
980
-
981
- = 0.9.4 =
982
- * Tweak - Force delete preset variables when switching sports in settings.
983
- * Fix - Apply player gallery limit.
984
- * Fix - Display localized team results string.
985
- * Refactor - Use more common thumbnail sizes.
986
- * Localization - Portuguese (Portugal) translation by Andrew_Melim.
987
-
988
- = 0.9.3 =
989
- * Fix - Player list columns not displaying.
990
-
991
- = 0.9.2 =
992
- * Fix - Duplicate editor fields in team edit screen.
993
-
994
- = 0.9.1 =
995
- * Tweak - Add text domain to configure descriptions.
996
- * Tweak - Change default country to US.
997
- * Fix - Event block results display for teams without logos.
998
-
999
- = 0.9 =
1000
- * Feature - Import tool added for importing staff from CSV file.
1001
- * Feature - Add checkboxes to select player statistics columns.
1002
- * Feature - Add option to select Google Map type.
1003
- * Feature - Add option to display team logos under event title.
1004
- * Feature - Enable player metrics and statistics selection in player list widget.
1005
- * Feature - Enable linking event blocks and event list to team pages.
1006
- * Tweak - Move leagues and seasons to SportsPress submenu.
1007
- * Tweak - Use singular post type slugs by default for consistency with WP core.
1008
- * Tweak - Remove alternate color in favor of link color setting.
1009
- * Tweak - Enable scrollable tables to prevent overflow.
1010
- * Tweak - Add helper text to venue location picker.
1011
- * Tweak - Adjust markup and remove link in league table caption.
1012
- * Tweak - Insert group name anchors to player list.
1013
- * Tweak - Display post type counts in system status.
1014
- * Fix - Event list results calculation when team column unchecked.
1015
- * Fix - Display player group names.
1016
- * Preset - Add snooker preset.
1017
- * Localization - Finnish translation by JuKi and hanro.
1018
- * Localization - Chinese translation by dic_2008.
1019
- * Localization - Dutch translation by valentijnreza.
1020
-
1021
- = 0.8.6 =
1022
- * Fix - Issue adding teams to events.
1023
-
1024
- = 0.8.5 =
1025
- * Fix - Issue saving new venues.
1026
-
1027
- = 0.8.4 =
1028
- * Feature - Add option to limit number of teams per event.
1029
- * Feature - Show venue option in Countdown widget.
1030
- * Feature - Enable multiple current teams per player.
1031
- * Feature - Format performance data for use in templates.
1032
- * Feature - Add next event function to team for template.
1033
- * Refactor - Adjust theme template loader for venues and seasons.
1034
- * Tweak - Replace featured image text in admin.
1035
- * Tweak - Use wider map zoom setting.
1036
- * Tweak - Make SportsPress tables full width by default.
1037
- * Fix - Team filter in admin.
1038
- * Fix - Displaying 1 view as plural.
1039
-
1040
- = 0.8.3 =
1041
- * Feature - Enable using events started and substituted in statistics equations.
1042
- * Tweak - Remove deprecated MySQL version function from System Status page.
1043
- * Fix - Adjust styling to display select boxes in admin.
1044
-
1045
- = 0.8.2 =
1046
- * Fix - Add content in main loop only.
1047
-
1048
- = 0.8.1 =
1049
- * Tweak - Output player statistics in system status.
1050
- * Tweak - Prepend templates to content instead of outputting directly.
1051
- * Fix - Enable metrics usage in individual player statistics.
1052
-
1053
- = 0.8 =
1054
- * Feature - New shortcode event_results.
1055
- * Feature - New shortcode event_details.
1056
- * Feature - New shortcode event_performance.
1057
- * Feature - New blocks layout to display calendars in fixtures/results style.
1058
- * Feature - New player statistics calculate values using performance and metrics.
1059
- * Feature - New staff profiles.
1060
- * Feature - New System Status screen in admin.
1061
- * Feature - Add status selector to calendars and event widgets.
1062
- * Feature - Add ability to display statistics and metrics in player lists.
1063
- * Feature - Add time/results column to event list.
1064
- * Feature - Link WP user roles with players and staff.
1065
- * Feature - Display player substitutions in event page.
1066
- * Feature - Option to group player lists by position.
1067
- * Feature - Option to display outcomes in event results.
1068
- * Refactor - Player profiles now use statistics and performance.
1069
- * Refactor - Split admin CSS files for better performance.
1070
- * Tweak - Display player numbers in admin.
1071
- * Tweak - Move SportsPress settings to top-level page.
1072
- * Tweak - Link date to event page in event list.
1073
- * Tweak - Load Google Maps script only when needed.
1074
- * Tweak - Add descriptions to configure screen for clarity.
1075
- * Tweak - Create dedicated settings tab for text settings.
1076
- * Tweak - Remove redundant border from pagination table.
1077
- * Tweak - Display players and teams as total count in admin.
1078
- * Fix - Display player number when 0 or 00.
1079
- * Fix - Enable changing variable name or key from quick edit.
1080
- * Fix - Team data saving issue.
1081
- * Fix - Display all future events in venue archive.
1082
- * Fix - Display all metrics instead of filtering by position.
1083
- * Localization - Croatian translation by i__k.
1084
- * Localization - Greek translation by Spirossmil.
1085
- * Localization - Portuguese (Brazil) translation by rochester.
1086
- * Localization - Russian translation by Selskei.
1087
- * Localization - Slovenian translation by BOCo.
1088
- * Localization - Update translations.
1089
-
1090
- = 0.7.4 =
1091
- * Feature - Shortcode added to display single event content.
1092
- * Tweak - Display default shortcode format when editing a calendar or player list.
1093
- * Tweak - Add backwards compatibility for shortcodes prior to version 0.7.
1094
- * Fix - Template hook to change display strings in admin.
1095
-
1096
- = 0.7.3 =
1097
- * Feature - Enable editing Key field in Metrics and Performance.
1098
- * Tweak - Lighter default color scheme.
1099
-
1100
- = 0.7.2 =
1101
- * Fix - Update missing assets.
1102
-
1103
- = 0.7.1 =
1104
- * Fix - Activation error preventing new installation.
1105
-
1106
- = 0.7 =
1107
- * Feature - Welcome page to display on activation.
1108
- * Feature - Frontend color scheme selection.
1109
- * Feature - Custom CSS option.
1110
- * Feature - Add venue column to event list.
1111
- * Feature - Manual point adjustments added to league tables.
1112
- * Feature - Enable table pagination.
1113
- * Feature - Enable live countdown setting.
1114
- * Refactor - Only load required classes to improve performance.
1115
- * Refactor - Change statistic to performance.
1116
- * Refactor - Soft deprecate sportspress prefixed functions in favor of sp prefix.
1117
- * Tweak - Filter players in events by current team.
1118
- * Tweak - Separate admin styles to improve load times.
1119
- * Tweak - Add margin above view all link in widgets.
1120
- * Tweak - Group text options by context.
1121
- * Tweak - Display event details in standard table markup for style consistency.
1122
- * Tweak - Display venue as a table for style consistency.
1123
- * Tweak - Hide individual player performance when players not selected.
1124
- * Fix - Responsive league table glitch.
1125
- * Fix - Warning messages when adding new team, player, or event.
1126
- * Fix - Countdown widget when event is selected.
1127
- * Fix - Multiple select box height glitch in some browsers fixed.
1128
- * Localization - Arabic translation by Abdulelah.
1129
- * Localization - German translation by Bhelpful2.
1130
- * Localization - Update Swedish translation by JensZ.
1131
-
1132
- = 0.6.2 =
1133
- * Feature - Add options to make tables responsive and sortable.
1134
- * Feature - Use consistent shortcode naming with backwards compatibility.
1135
-
1136
- = 0.6.1 =
1137
- * Feature - Display full event results on hover over main team result in admin.
1138
- * Feature - Add option to choose delimiter to use between team names in event titles.
1139
- * Tweak - Adjust text options to modify front-end only.
1140
- * Fix - Responsive league table output and styling.
1141
-
1142
- = 0.6 =
1143
- * Feature - New events shortcodes: countdown, events-calendar, and events-list.
1144
- * Feature - New teams shortcode: league-table.
1145
- * Feature - New players shortcodes: player-list and player-gallery.
1146
- * Feature - Display available shortcodes in post edit screen.
1147
- * Feature - Add new settings page to change default text output.
1148
- * Feature - Add new section to permalinks settings to change post and term slugs.
1149
- * Tweak - Display teams as link list in admin page for league table teams columns.
1150
- * Tweak - Vertically align team logos in league table.
1151
- * Fix - Check if player belongs to leagues to avoid warnings in player profile.
1152
- * Fix - Total player statistics calculation in events.
1153
- * Fix - Responsive tables in event details and outcomes.
1154
- * Fix - Display players from all seasons or leagues when none have been created.
1155
-
1156
- = 0.5 =
1157
- * Feature - Import tool added for importing events from CSV file.
1158
- * Feature - New post type Calendar added.
1159
- * Feature - League and Friendly format options added to events.
1160
- * Feature - List and Gallery format options added to player lists.
1161
- * Feature - Calendar and List format options added to calendars.
1162
- * Feature - Options added to turn on and off player list columns.
1163
- * Feature - Options added to player list widget to limit rows and display link to view all players.
1164
- * Feature - Options added to calendar widget to filter events.
1165
- * Feature - New widget Events List added.
1166
- * Feature - New widget Player Gallery added.
1167
- * Refactor - Use singular slugs for secondary post types.
1168
- * Tweak - Add tooltips to icons in admin table headings.
1169
- * Tweak - Style event results in admin events list.
1170
- * Tweak - Separate event date and time in admin events list.
1171
- * Fix - Enable custom post type sorting in admin.
1172
- * Fix - Added check before displaying deleted posts in league tables and player lists.
1173
- * Fix - Adjust Select All filter in player lists and league tables.
1174
-
1175
- = 0.4.3 =
1176
- * Feature - Enable selecting multiple outcomes per team per event.
1177
- * Tweak - Use icons in dashboard column labels for teams and roster.
1178
- * Tweak - Mark current team with check icon in admin player table.
1179
- * Fix - Check that selected columns are in array to avoid warning.
1180
- * Localization - Add Czech translation.
1181
- * Localization - Add Slovak translation.
1182
- * Localization - Add Polish translation by karimjarro.
1183
-
1184
- = 0.4.2 =
1185
- * Feature - Enable selecting columns to display in single league table.
1186
- * Feature - Add options to limit rows, display logos, and display full table link.
1187
- * Feature - Add option to display national flags in player profiles.
1188
- * Refactor - Group Players and Staff under Roster menu group.
1189
- * Tweak - Reorder default player profile content.
1190
- * Tweak - Display player number before page title instead of metrics section.
1191
- * Tweak - Display player metrics as definition list instead of table.
1192
- * Fix - Check if static player list is array to avoid warning message.
1193
-
1194
- = 0.4.1 =
1195
- * Tweak - Activate checkbox when all players are added to player list.
1196
- * Fix - Function date_diff added for PHP < 5.3.
1197
- * Localization - Swedish translation by JensZ.
1198
-
1199
- = 0.4 =
1200
- * Feature - SportsPress Status dashboard widget added to display number of events and countdown in admin.
1201
- * Feature - New dashboard menu icons.
1202
- * Feature - More intuitive player edit screen.
1203
- * Feature - Enable spreadsheet style keyboard navigation in admin data tables.
1204
- * Feature - Add hover action on league table team names to edit display name.
1205
- * Refactor - Remove min and max outcome options from column equation.
1206
- * Refactor - Change Rounding precision to default to 0.
1207
- * Tweak - Used jQuery Chosen for inputs where useful.
1208
- * Tweak - Prepend plugin name to widget titles.
1209
- * Tweak - Highlight settings in admin menu when adding new config post type.
1210
- * Tweak - Display Events as Schedule in admin sidebar menu.
1211
- * Tweak - Update widget descriptions.
1212
- * Tweak - Remove unused external class eqGraph.
1213
- * Tweak - Display sort order priority options for number of columns available.
1214
- * Fix - Apply table column rounding when precision is set.
1215
- * Fix - Display event results on events page when available.
1216
- * Fix - Check that event results are available before displaying a warning under certain conditions.
1217
- * Fix - Namespace eqEOS class to avoid conflict with other plugins.
1218
- * Localization - Use specific strings instead of dynamic ones for more accurate translations.
1219
- * Localization - Use generic strings where appropriate.
1220
- * Localization - Update German translation.
1221
- * Localization - Update Spanish translation.
1222
- * Localization - Update French translation.
1223
- * Localization - Update Italian translation.
1224
- * Localization - Update Japanese translation.
1225
-
1226
- = 0.3.3 =
1227
- * Feature - Add default sorting options per player list.
1228
- * Feature - Add option to sort player list alphabetically by name or by default.
1229
-
1230
- = 0.3.2 =
1231
- * Feature - Add England, Scotland, Northern Ireland, and Wales to countries selector.
1232
- * Feature - Enable searching for countries in dropdown.
1233
-
1234
- = 0.3.1 =
1235
- * Feature - Import tool added for importing teams from CSV file.
1236
- * Tweak - Added option to select custom sport and enter sport name.
1237
- * Tweak - Display player number under photo in admin screen.
1238
- * Tweak - Positions, Leagues, and Seasons columns added to player import tool.
1239
- * Tweak - Styled SportsPress setup notice.
1240
- * Refactor - Sum changed to Total in player statistic calculation settings.
1241
-
1242
- = 0.3 =
1243
- * Feature - Import tool added for importing players from CSV file.
1244
- * Feature - Add ability to select
1245
- * Tweak - Display current team indicator in players admin screen.
1246
-
1247
- = 0.2.10 =
1248
- * Fix - Team filtering in events, tables, players, and lists.
1249
- * Tweak - Display statistics for all league/season events played in player profiles and player lists.
1250
- * Tweak - Count events as played when in starting lineup or made substitution.
1251
- * Tweak - Display player metrics only when value is set.
1252
-
1253
- = 0.2.9 =
1254
- * Feature - Ability to select players from all teams in player list.
1255
- * Fix - Decimal sorting in league tables and player lists.
1256
-
1257
- = 0.2.8 =
1258
- * Feature - Add player list widget.
1259
- * Localization - Add German translations.
1260
- * Localization - Add Spanish translations.
1261
- * Localization - Add Italian translations.
1262
-
1263
- = 0.2.7 =
1264
- * Feature - Select columns to display in league table widget.
1265
- * Tweak - Start league table positions at 1 instead of 0.
1266
-
1267
- = 0.2.6 =
1268
- * Localization - Add French translations.
1269
- * Preset - Update soccer preset.
1270
-
1271
- = 0.2.5 =
1272
- * Fix - Update deprecated function to prevent error in Player Lists.
1273
-
1274
- = 0.2.4 =
1275
- * Feature - Display venue map on event page and venue archive.
1276
- * Fix - Add checks to prevent league table dividing by zero when no events have been played.
1277
- * Fix - Flush rewrite rules for taxonomies on activation.
1278
- * Tweak - Sort sports presets alphabetically by localized name.
1279
-
1280
- = 0.2.3 =
1281
- * Feature - Enable selecting main event result.
1282
- * Feature - Add Last 5 counter to table columns.
1283
- * Localization - Update Japanese translations.
1284
- * Preset - Complete American Football preset.
1285
-
1286
- = 0.2.2 =
1287
- * Feature - League Table widget added.
1288
- * Feature - Recent Events widget added.
1289
- * Feature - Future Events widget added.
1290
- * Feature - Countdown widget added.
1291
- * Fix - Syntax error fixed for PHP version 5.2 and below.
1292
- * Tweak - Editor section added to League Tables and Player Lists.
1293
-
1294
- = 0.2.1 =
1295
- * Feature - Events Calendar widget added.
1296
- * Fix - Player settings table markup fixed.
1297
- * Tweak - Refine custom post type capabilities for user roles.
1298
-
1299
- = 0.2 =
1300
- * Feature - Add option to select whether statistics are calculated as a sum or average.
1301
- * Feature - Enable pageview tracking for posts and custom post types.
1302
- * Feature - Responsive datatables.
1303
- * Fix - Add site admin capabilities for multisite.
1304
- * Fix - Force numerical sorting of number column.
1305
- * Tweak - Enable SportsPress content functions to be called without explicit ID.
1306
- * Tweak - Remove redundant admin menu links via filter.
1307
-
1308
- = 0.1.7 =
1309
- * Feature - Enable selecting venues to use uploaded images.
1310
-
1311
- = 0.1.6 =
1312
- * Tweak - Activate per post type permissions.
1313
- * Tweak - Give admin all permissions for custom posts.
1314
-
1315
- = 0.1.5 =
1316
- * Tweak - Remove flag images to lighten download size.
1317
-
1318
- = 0.1.4 =
1319
- * Fix - All Plugin-Check warnings.
1320
- * Tweak - Split templates into files in subdirectory.
1321
- * Tweak - Simplify gettext filters.
1322
-
1323
- = 0.1.3 =
1324
- * Fix - Style conflict with Foundation framework in table columns.
1325
- * Feature - HTML output added to custom post types with data table sorting.
1326
- * Feature - Enable metrics and statistics per player position.
1327
- * Feature - Save team played per season per league in player edit screen.
1328
- * Feature - Give teams the option to show and hide past seasons.
1329
- * Feature - Venues, Seasons, and Leagues added as taxonomies.
1330
- * Feature - Add L10 counter to report last 10 outcomes.
1331
- * Feature - Add STRK counter to report current outcome streak.
1332
- * Localization - Add country names in Czech, German, Spanish, French, Italian, Japanese, Polish, Russian, and Slovak.
1333
-
1334
- = 0.1.2 =
1335
- * Tweak - Use custom post types for metrics and statistics configuration.
1336
- * Feature - Display HTML tables when viewing League Table and Player List post types.
1337
- * Feature - Link player and team names to single post pages.
1338
- * Feature - Register default configuration for soccer.
1339
- * Feature - Sort league table and player list by priority.
1340
-
1341
- = 0.1.1 =
1342
- * Tweak - Update description.
1343
-
1344
- = 0.1 =
1345
- * Alpha release for first look and testing.
1
  === SportsPress - Sports Club & League Manager ===
2
  Contributors: ThemeBoy, brianmiyaji, aylaview, rochesterj
3
+ Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
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
 
210
 
211
  = Can I import teams/players/staff/matches? =
212
 
213
+ Yes, CSV importers are included with the plugin. Go to Tools > Import and choose from one of the SportsPress CSV importers. Supports CSV files generated by [LeagueLobster](http://tboy.co/leaguelobster).
214
 
215
  = What's the difference between the free and Pro plugin? =
216
 
239
 
240
  == Changelog ==
241
 
242
+ = 2.1.7 =
243
+ * Fix - Activation error on older versions of PHP.
244
+
245
+ = 2.1.6 =
246
+ * Feature - Add equation format option to player performance.
247
+ * Tweak - Add text options to change tab labels.
248
+ * Fix - Activation errors using TGMPA.
249
+ * Fix - Empty footer column in team staff table.
250
+ * Preset - Update basketball preset.
251
+
252
+ = 2.1.5 =
253
+ * Feature - Add option to filter players by current or past team in player lists.
254
+ * Fix - Scheduled events not queried in REST API.
255
+
256
+ = 2.1.4 =
257
+ * Feature - Player and staff dropdown templates added to layout designer.
258
+ * Tweak - Default tab labels from layout designer.
259
+ * Tweak - Add "Home" and "Away" to text options.
260
+ * Tweak - Add horizontal padding to centered event list columns.
261
+ * Fix - Disable numeric slug generation for events due to permalink issues in some cases.
262
+ * Fix - Permalink issues caused by filter for scheduled events.
263
+ * Fix - Scheduled events being ignored by REST API.
264
+ * Fix - Inconsistent styling of player and staff dropdowns.
265
+ * Fix - Only include current players in player lists.
266
+ * Fix - Age calculation in BuddyPress context.
267
+
268
+ = 2.1.3 =
269
+ * Tweak - Add options to select number, team, and position columns to player list shortcode.
270
+ * Fix - Totals row offset in player statistics admin.
271
+ * Fix - Events not automatically ordered by date in some cases.
272
+ * Fix - Google Maps error when address is empty.
273
+ * Fix - Player lists for all teams not appearing in team edit screen.
274
+ * Fix - Error in player list when team no longer exists.
275
+ * Fix - Error in event logos when results are empty.
276
+ * Fix - Issue with link to future event from daily archive when multiple events are scheduled for a single day.
277
+
278
+ = 2.1.2 =
279
+ * Feature - Add offense and defense statistics to REST API.
280
+ * Tweak - Hide template tabs with no content.
281
+ * Tweak - Allow selection of player lists without teams.
282
+ * Tweak - Center-align time/results when between home and away teams in event list.
283
+ * Tweak - Increase checklist panel height in admin.
284
+ * Tweak - Update text options.
285
+ * Fix - Hidden box score columns still displaying when in offense/defense mode.
286
+ * Preset - Update cricket preset.
287
+
288
+ = 2.1.1 =
289
+ * Feature - Add substitution times in box score.
290
+ * Feature - Add text options to change template tab names.
291
+ * Tweak - Automatically align home and away columns in event lists.
292
+ * Fix - Box score minutes display issue.
293
+
294
+ = 2.1 =
295
+ * Feature - New simplified fixtures importer compatible with [LeagueLobster](http://tboy.co/leaguelobster).
296
+ * Feature - Add match day field to events.
297
+ * Feature - Add box score minutes to events.
298
+ * Feature - Add option to display full time in event details.
299
+ * Feature - Add inline and block option to event logos.
300
+ * Feature - Add squad number and name option to player details.
301
+ * Feature - Add tab options to layout designer.
302
+ * Feature - Add option to display player and staff dropdowns in profiles.
303
+ * Feature - Add option to select TBA, postponed, and cancelled event status.
304
+ * Feature - Licenses tab for third-party extensions.
305
+ * Tweak - Get player data only when needed.
306
+ * Tweak - Add capabilities to taxonomies.
307
+ * Tweak - Display tutorials in main menu if user role is not admin or league manager.
308
+ * Tweak - Use contextual strings for featured images.
309
+ * Tweak - Enable meta query vars in REST API.
310
+ * Tweak - Adopt new tab class names in admin.
311
+ * Tweak - Inherit text color for event logo team text.
312
+ * Tweak - New developers section on modules page with link to join [Slack community](http://tboy.co/slack).
313
+ * Fix - Taxonomy links appearing in admin for users that can't edit events.
314
+ * Fix - Debug error on non-standard admin pages.
315
+ * Fix - REST API notice in Jetpack.
316
+
317
  = 2.0.16 =
318
  * Tweak - Add shortcode parameter to override global date in event calendar.
319
 
400
  * Fix - Avoid loading countdown widget if no events are available.
401
  * Preset - Update baseball, cricket, floorball, handball, ice hockey, and softball presets.
402
 
403
+ = Full Changelog =
404
+ * For older versions, [view the full changelog](https://github.com/ThemeBoy/SportsPress/blob/master/changelog.txt).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
sportspress.php CHANGED
@@ -3,11 +3,11 @@
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.0.16
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
10
- * Tested up to: 4.6
11
  *
12
  * Text Domain: sportspress
13
  * Domain Path: /languages/
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
- * @version 2.0.16
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.0.16';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
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
10
+ * Tested up to: 4.7
11
  *
12
  * Text Domain: sportspress
13
  * Domain Path: /languages/
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
templates/event-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -16,6 +16,7 @@ $defaults = array(
16
  'date' => 'default',
17
  'date_from' => 'default',
18
  'date_to' => 'default',
 
19
  'league' => null,
20
  'season' => null,
21
  'venue' => null,
@@ -27,6 +28,7 @@ $defaults = array(
27
  'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,
28
  'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false,
29
  'rows' => get_option( 'sportspress_event_blocks_rows', 5 ),
 
30
  'order' => 'default',
31
  'show_all_events_link' => false,
32
  'show_title' => get_option( 'sportspress_event_blocks_show_title', 'no' ) == 'yes' ? true : false,
@@ -59,6 +61,10 @@ if ( $player )
59
  $calendar->player = $player;
60
  if ( $order != 'default' )
61
  $calendar->order = $order;
 
 
 
 
62
  $data = $calendar->data();
63
 
64
  if ( $hide_if_empty && empty( $data ) ) return;
@@ -109,6 +115,14 @@ if ( $title )
109
  endif;
110
  endforeach;
111
  endif;
 
 
 
 
 
 
 
 
112
  ?>
113
  <tr class="sp-row sp-post<?php echo ( $i % 2 == 0 ? ' alternate' : '' ); ?>">
114
  <td>
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16
  'date' => 'default',
17
  'date_from' => 'default',
18
  'date_to' => 'default',
19
+ 'day' => 'default',
20
  'league' => null,
21
  'season' => null,
22
  'venue' => null,
28
  'link_events' => get_option( 'sportspress_link_events', 'yes' ) == 'yes' ? true : false,
29
  'paginated' => get_option( 'sportspress_event_blocks_paginated', 'yes' ) == 'yes' ? true : false,
30
  'rows' => get_option( 'sportspress_event_blocks_rows', 5 ),
31
+ 'orderby' => 'default',
32
  'order' => 'default',
33
  'show_all_events_link' => false,
34
  'show_title' => get_option( 'sportspress_event_blocks_show_title', 'no' ) == 'yes' ? true : false,
61
  $calendar->player = $player;
62
  if ( $order != 'default' )
63
  $calendar->order = $order;
64
+ if ( $orderby != 'default' )
65
+ $calendar->orderby = $orderby;
66
+ if ( $day != 'default' )
67
+ $calendar->day = $day;
68
  $data = $calendar->data();
69
 
70
  if ( $hide_if_empty && empty( $data ) ) return;
115
  endif;
116
  endforeach;
117
  endif;
118
+
119
+ if ( 'day' === $calendar->orderby ):
120
+ $event_group = get_post_meta( $event->ID, 'sp_day', true );
121
+ if ( ! isset( $group ) || $event_group !== $group ):
122
+ $group = $event_group;
123
+ echo '<tr><th><strong class="sp-event-group-name">', __( 'Match Day', 'sportspress' ), ' ', $group, '</strong></th></tr>';
124
+ endif;
125
+ endif;
126
  ?>
127
  <tr class="sp-row sp-post<?php echo ( $i % 2 == 0 ? ' alternate' : '' ); ?>">
128
  <td>
templates/event-calendar.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.15
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -17,6 +17,7 @@ $defaults = array(
17
  'date' => 'default',
18
  'date_from' => 'default',
19
  'date_to' => 'default',
 
20
  'league' => null,
21
  'season' => null,
22
  'venue' => null,
@@ -39,6 +40,8 @@ if ( $date_from != 'default' )
39
  $calendar->from = $date_from;
40
  if ( $date_to != 'default' )
41
  $calendar->to = $date_to;
 
 
42
  if ( $league )
43
  $calendar->league = $league;
44
  if ( $season )
@@ -188,7 +191,7 @@ if ( $ak_post_titles ) {
188
  foreach ( (array) $ak_post_titles as $ak_post_title ) {
189
 
190
  /** This filter is documented in wp-includes/post-template.php */
191
- $post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) . ' @ ' . date_i18n( get_option( 'time_format' ), strtotime( $ak_post_title->post_date ) ) );
192
 
193
  if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
194
  $ak_titles_for_day['day_'.$ak_post_title->dom] = '';
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
  'date' => 'default',
18
  'date_from' => 'default',
19
  'date_to' => 'default',
20
+ 'day' => 'default',
21
  'league' => null,
22
  'season' => null,
23
  'venue' => null,
40
  $calendar->from = $date_from;
41
  if ( $date_to != 'default' )
42
  $calendar->to = $date_to;
43
+ if ( $day != 'default' )
44
+ $calendar->day = $day;
45
  if ( $league )
46
  $calendar->league = $league;
47
  if ( $season )
191
  foreach ( (array) $ak_post_titles as $ak_post_title ) {
192
 
193
  /** This filter is documented in wp-includes/post-template.php */
194
+ $post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) . ' @ ' . apply_filters( 'sportspress_event_time', date_i18n( get_option( 'time_format' ), strtotime( $ak_post_title->post_date ) ), $ak_post_title->ID ) );
195
 
196
  if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) )
197
  $ak_titles_for_day['day_'.$ak_post_title->dom] = '';
templates/event-details.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 1.9.19
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -24,7 +24,7 @@ if ( 'yes' === get_option( 'sportspress_event_show_date', 'yes' ) ) {
24
 
25
  if ( 'yes' === get_option( 'sportspress_event_show_time', 'yes' ) ) {
26
  $time = get_the_time( get_option('time_format'), $id );
27
- $data[ __( 'Time', 'sportspress' ) ] = $time;
28
  }
29
 
30
  $taxonomies = apply_filters( 'sportspress_event_taxonomies', array( 'sp_league' => null, 'sp_season' => null ) );
@@ -38,6 +38,21 @@ foreach ( $taxonomies as $taxonomy => $post_type ):
38
  endif;
39
  endforeach;
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  $data = apply_filters( 'sportspress_event_details', $data, $id );
42
 
43
  if ( ! sizeof( $data ) ) return;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
24
 
25
  if ( 'yes' === get_option( 'sportspress_event_show_time', 'yes' ) ) {
26
  $time = get_the_time( get_option('time_format'), $id );
27
+ $data[ __( 'Time', 'sportspress' ) ] = apply_filters( 'sportspress_event_time', $time, $id );
28
  }
29
 
30
  $taxonomies = apply_filters( 'sportspress_event_taxonomies', array( 'sp_league' => null, 'sp_season' => null ) );
38
  endif;
39
  endforeach;
40
 
41
+ if ( 'yes' === get_option( 'sportspress_event_show_day', 'yes' ) ) {
42
+ $day = get_post_meta( $id, 'sp_day', true );
43
+ if ( '' !== $day ) {
44
+ $data[ __( 'Match Day', 'sportspress' ) ] = $day;
45
+ }
46
+ }
47
+
48
+ if ( 'yes' === get_option( 'sportspress_event_show_full_time', 'yes' ) ) {
49
+ $full_time = get_post_meta( $id, 'sp_minutes', true );
50
+ if ( '' === $full_time ) {
51
+ $full_time = get_option( 'sportspress_minutes', 90 );
52
+ }
53
+ $data[ __( 'Full Time', 'sportspress' ) ] = $full_time . '\'';
54
+ }
55
+
56
  $data = apply_filters( 'sportspress_event_details', $data, $id );
57
 
58
  if ( ! sizeof( $data ) ) return;
templates/event-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -16,6 +16,7 @@ $defaults = array(
16
  'date' => 'default',
17
  'date_from' => 'default',
18
  'date_to' => 'default',
 
19
  'league' => null,
20
  'season' => null,
21
  'venue' => null,
@@ -60,6 +61,8 @@ if ( $player )
60
  $calendar->player = $player;
61
  if ( $order != 'default' )
62
  $calendar->order = $order;
 
 
63
  $data = $calendar->data();
64
  $usecolumns = $calendar->columns;
65
  $title_format = get_option( 'sportspress_event_list_title_format', 'title' );
@@ -85,7 +88,7 @@ endif;
85
  <h4 class="sp-table-caption"><?php echo $title; ?></h4>
86
  <?php } ?>
87
  <div class="sp-table-wrapper">
88
- <table class="sp-event-list sp-data-table<?php if ( $paginated ) { ?> sp-paginated-table<?php } if ( $sortable ) { ?> sp-sortable-table<?php } if ( $scrollable ) { ?> sp-scrollable-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
89
  <thead>
90
  <tr>
91
  <?php
@@ -206,7 +209,7 @@ endif;
206
 
207
  echo '<tr class="sp-row sp-post' . ( $i % 2 == 0 ? ' alternate' : '' ) . ' sp-row-no-' . $i . '">';
208
 
209
- $date_html = '<date>' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '</date>' . get_post_time( get_option( 'date_format' ), false, $event, true );
210
 
211
  if ( $link_events ) $date_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '">' . $date_html . '</a>';
212
 
@@ -224,7 +227,7 @@ endif;
224
  if ( ! empty( $main_results ) ):
225
  echo implode( ' - ', $main_results );
226
  else:
227
- echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
228
  endif;
229
  if ( $link_events ) echo '</a>';
230
  echo '</td>';
@@ -246,7 +249,7 @@ endif;
246
  if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
247
  echo '<td class="data-time">';
248
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
249
- echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
250
  if ( $link_events ) echo '</a>';
251
  echo '</td>';
252
  }
@@ -268,7 +271,7 @@ endif;
268
  if ( sp_column_active( $usecolumns, 'time' ) ) {
269
  echo '<td class="data-time">';
270
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
271
- echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
272
  if ( $link_events ) echo '</a>';
273
  echo '</td>';
274
  }
@@ -288,7 +291,7 @@ endif;
288
  if ( sp_column_active( $usecolumns, 'time' ) ) {
289
  echo '<td class="data-time">';
290
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
291
- echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
292
  if ( $link_events ) echo '</a>';
293
  echo '</td>';
294
  }
@@ -313,7 +316,7 @@ endif;
313
  if ( ! empty( $main_results ) ):
314
  echo implode( ' - ', $main_results );
315
  else:
316
- echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
317
  endif;
318
  if ( $link_events ) echo '</a>';
319
  echo '</td>';
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16
  'date' => 'default',
17
  'date_from' => 'default',
18
  'date_to' => 'default',
19
+ 'day' => 'default',
20
  'league' => null,
21
  'season' => null,
22
  'venue' => null,
61
  $calendar->player = $player;
62
  if ( $order != 'default' )
63
  $calendar->order = $order;
64
+ 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' );
88
  <h4 class="sp-table-caption"><?php echo $title; ?></h4>
89
  <?php } ?>
90
  <div class="sp-table-wrapper">
91
+ <table class="sp-event-list sp-event-list-format-<?php echo $title_format; ?> sp-data-table<?php if ( $paginated ) { ?> sp-paginated-table<?php } if ( $sortable ) { ?> sp-sortable-table<?php } if ( $scrollable ) { ?> sp-scrollable-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
92
  <thead>
93
  <tr>
94
  <?php
209
 
210
  echo '<tr class="sp-row sp-post' . ( $i % 2 == 0 ? ' alternate' : '' ) . ' sp-row-no-' . $i . '">';
211
 
212
+ $date_html = '<date>' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_date', get_post_time( get_option( 'date_format' ), false, $event, true ), $event->ID );
213
 
214
  if ( $link_events ) $date_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '">' . $date_html . '</a>';
215
 
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>';
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
  }
271
  if ( sp_column_active( $usecolumns, 'time' ) ) {
272
  echo '<td class="data-time">';
273
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
274
+ echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
275
  if ( $link_events ) echo '</a>';
276
  echo '</td>';
277
  }
291
  if ( sp_column_active( $usecolumns, 'time' ) ) {
292
  echo '<td class="data-time">';
293
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '">';
294
+ echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
295
  if ( $link_events ) echo '</a>';
296
  echo '</td>';
297
  }
316
  if ( ! empty( $main_results ) ):
317
  echo implode( ' - ', $main_results );
318
  else:
319
+ echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
320
  endif;
321
  if ( $link_events ) echo '</a>';
322
  echo '</td>';
templates/event-logos-block.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Event Logos Block
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 ?>
14
+ <tbody>
15
+ <tr class="sp-row sp-post alternate">
16
+ <td>
17
+ <?php
18
+ $j = 0;
19
+ foreach( $teams as $team ):
20
+ $j++;
21
+
22
+ if ( has_post_thumbnail ( $team ) ) {
23
+ $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );
24
+ } else {
25
+ $logo = '';
26
+ }
27
+
28
+ if ( $show_team_names ) {
29
+ if ( $j % 2 ) {
30
+ $logo .= ' <strong class="sp-team-name">' . sp_get_team_name( $team, $abbreviate_teams ) . '</strong>';
31
+ } else {
32
+ $logo = '<strong class="sp-team-name">' . sp_get_team_name( $team, $abbreviate_teams ) . '</strong> ' . $logo;
33
+ }
34
+ }
35
+
36
+ if ( $link_teams ):
37
+ $logo = '<a class="team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '" href="' . get_permalink( $team, false, true ) . '" title="' . get_the_title( $team ) . '">' . $logo . '</a>';
38
+ else:
39
+ $logo = '<span class="team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) . '" title="' . get_the_title( $team ) . '">' . $logo . '</span>';
40
+ endif;
41
+
42
+ echo $logo;
43
+ endforeach;
44
+ ?>
45
+ <time class="sp-event-date" datetime="<?php echo get_the_time( 'Y-m-d H:i:s' ); ?>">
46
+ <?php echo get_the_time( get_option( 'date_format' ) ); ?>
47
+ </time>
48
+ <?php
49
+
50
+ if ( $show_time ) {
51
+ ?>
52
+ <h5 class="sp-event-results">
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 ) ) {
60
+ ?>
61
+ <h5 class="sp-event-results">
62
+ <?php echo '<span class="sp-result">' . implode( '</span> - <span class="sp-result">', apply_filters( 'sportspress_event_blocks_team_result_or_time', $results, $id ) ) . '</span>'; ?>
63
+ </h5>
64
+ <?php
65
+ $status = __( 'Full Time', 'sportspress' );
66
+ }
67
+ ?>
68
+ <span class="sp-event-status">
69
+ <?php echo apply_filters( 'sportspress_event_logos_status', $status, $id ); ?>
70
+ </span>
71
+ </td>
72
+ </tr>
73
+ </tbody>
74
+ </table>
75
+ </div>
76
+ </div>
templates/event-logos-inline.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Event Logos Inline
4
+ *
5
+ * @author ThemeBoy
6
+ * @package SportsPress/Templates
7
+ * @version 2.1
8
+ */
9
+
10
+ $team_logos = array();
11
+ $i = 0;
12
+ foreach ( $teams as $team ):
13
+ if ( ! has_post_thumbnail( $team ) ) {
14
+ $logo = '';
15
+ } else {
16
+ $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );
17
+ }
18
+
19
+ $alt = sizeof( $teams ) == 2 && $i % 2;
20
+
21
+ // Add team name
22
+ if ( $show_team_names ) {
23
+ if ( $alt ) {
24
+ $logo .= ' <strong class="sp-team-name">' . sp_get_team_name( $team, $abbreviate_teams ) . '</strong>';
25
+ } else {
26
+ $logo = '<strong class="sp-team-name">' . sp_get_team_name( $team, $abbreviate_teams ) . '</strong> ' . $logo;
27
+ }
28
+ }
29
+
30
+ // Add link
31
+ if ( $link_teams ) $logo = '<a href="' . get_post_permalink( $team ) . '">' . $logo . '</a>';
32
+
33
+ // Add result
34
+ if ( $show_results && ! empty( $results ) ) {
35
+ $team_result = array_shift( $results );
36
+ $team_result = apply_filters( 'sportspress_event_logos_team_result', $team_result, $id, $team );
37
+ if ( $alt ) {
38
+ $logo = '<strong class="sp-team-result">' . $team_result . '</strong> ' . $logo;
39
+ } else {
40
+ $logo .= ' <strong class="sp-team-result">' . $team_result . '</strong>';
41
+ }
42
+ }
43
+
44
+ // Add logo to array
45
+ if ( '' !== $logo ) {
46
+ $team_logos[] = '<span class="sp-team-logo">' . $logo . '</span>';
47
+ $i++;
48
+ }
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 ) {
56
+ $delimiter = '<strong class="sp-event-logos-time sp-team-result">' . apply_filters( 'sportspress_event_time', get_the_time( get_option('time_format'), $id ), $id ) . '</strong>';
57
+ } else {
58
+ $delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );
59
+ }
60
+
61
+ echo implode( ' ' . $delimiter . ' ', $team_logos );
62
+ echo '</div></div>';
63
+ endif;
templates/event-logos.php CHANGED
@@ -4,19 +4,27 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
  if ( get_option( 'sportspress_event_show_logos', 'yes' ) === 'no' ) return;
12
 
 
 
 
 
 
 
 
 
 
 
13
  $show_team_names = get_option( 'sportspress_event_logos_show_team_names', 'no' ) === 'yes' ? true : false;
14
  $show_time = get_option( 'sportspress_event_logos_show_time', 'no' ) === 'yes' ? true : false;
15
  $show_results = get_option( 'sportspress_event_logos_show_results', 'no' ) === 'yes' ? true : false;
16
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
17
-
18
- if ( ! isset( $id ) )
19
- $id = get_the_ID();
20
 
21
  if ( $show_results ) {
22
  $results = sp_get_main_results( $id );
@@ -25,63 +33,19 @@ if ( $show_results ) {
25
  } else {
26
  $show_time = false;
27
  }
 
 
28
  }
29
 
30
- $teams = get_post_meta( $id, 'sp_team' );
31
- $teams = array_filter( $teams, 'sp_filter_positive' );
32
- if ( $teams ):
33
- $team_logos = array();
34
- $i = 0;
35
- foreach ( $teams as $team ):
36
- if ( ! has_post_thumbnail( $team ) ) {
37
- $logo = '';
38
- } else {
39
- $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );
40
- }
41
-
42
- $alt = sizeof( $teams ) == 2 && $i % 2;
43
-
44
- // Add team name
45
- if ( $show_team_names ) {
46
- if ( $alt ) {
47
- $logo .= ' <strong class="sp-team-name">' . sp_get_team_name( $team, $abbreviate_teams ) . '</strong>';
48
- } else {
49
- $logo = '<strong class="sp-team-name">' . sp_get_team_name( $team, $abbreviate_teams ) . '</strong> ' . $logo;
50
- }
51
- }
52
-
53
- // Add link
54
- if ( get_option( 'sportspress_link_teams', 'no' ) == 'yes' ) $logo = '<a href="' . get_post_permalink( $team ) . '">' . $logo . '</a>';
55
-
56
- // Add result
57
- if ( $show_results && ! empty( $results ) ) {
58
- $team_result = array_shift( $results );
59
- $team_result = apply_filters( 'sportspress_event_logos_team_result', $team_result, $id, $team );
60
- if ( $alt ) {
61
- $logo = '<strong class="sp-team-result">' . $team_result . '</strong> ' . $logo;
62
- } else {
63
- $logo .= ' <strong class="sp-team-result">' . $team_result . '</strong>';
64
- }
65
- }
66
-
67
- // Add logo to array
68
- if ( '' !== $logo ) {
69
- $team_logos[] = '<span class="sp-team-logo">' . $logo . '</span>';
70
- $i++;
71
- }
72
- endforeach;
73
- $team_logos = array_filter( $team_logos );
74
- if ( ! empty( $team_logos ) ):
75
- echo '<div class="sp-template sp-template-event-logos"><div class="sp-event-logos sp-event-logos-' . sizeof( $teams ) . '">';
76
-
77
- // Assign delimiter
78
- if ( $show_time && sizeof( $teams ) <= 2 ) {
79
- $delimiter = '<strong class="sp-event-logos-time sp-team-result">' . get_the_time( get_option('time_format'), $id ) . '</strong>';
80
- } else {
81
- $delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );
82
- }
83
-
84
- echo implode( ' ' . $delimiter . ' ', $team_logos );
85
- echo '</div></div>';
86
- endif;
87
- endif;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
  if ( get_option( 'sportspress_event_show_logos', 'yes' ) === 'no' ) return;
12
 
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;
27
+ $link_teams = get_option( 'sportspress_link_teams', 'no' ) === 'yes' ? true : false;
 
 
28
 
29
  if ( $show_results ) {
30
  $results = sp_get_main_results( $id );
33
  } else {
34
  $show_time = false;
35
  }
36
+ } else {
37
+ $results = array();
38
  }
39
 
40
+ sp_get_template( 'event-logos-' . $layout . '.php', array(
41
+ 'id' => $id,
42
+ 'teams' => $teams,
43
+ 'results' => $results,
44
+ 'show_team_names' => $show_team_names,
45
+ 'show_time' => $show_time,
46
+ 'show_results' => $show_results,
47
+ 'abbreviate_teams' => $abbreviate_teams,
48
+ 'link_teams' => $link_teams,
49
+ ) );
50
+
51
+ do_action( 'sportspress_after_event_logos', $id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/event-performance-table-combined.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 1.9.19
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -78,7 +78,7 @@ if ( ! isset( $class ) ) $class = null;
78
  $format = sp_array_value( $formats, $key, 'number' );
79
  $placeholder = sp_get_format_placeholder( $format );
80
 
81
- $value = '&mdash;';
82
  if ( $key == 'position' ):
83
  if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
84
  $positions = array();
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
78
  $format = sp_array_value( $formats, $key, 'number' );
79
  $placeholder = sp_get_format_placeholder( $format );
80
 
81
+ $value = '-';
82
  if ( $key == 'position' ):
83
  if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
84
  $positions = array();
templates/event-performance-table.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -59,7 +59,9 @@ if ( ! isset( $subs ) ) $subs = array();
59
  foreach ( $subs as $sub_id => $sub ):
60
  if ( ! $sub_id )
61
  continue;
62
- $lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
 
 
63
  endforeach;
64
 
65
  $data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode );
@@ -91,8 +93,21 @@ if ( ! isset( $subs ) ) $subs = array();
91
 
92
  if ( array_key_exists( $player_id, $lineup_sub_relation ) ):
93
  $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>';
 
 
 
 
 
 
 
94
  elseif ( isset( $row['sub'] ) && $row['sub'] ):
95
  $name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . '</span>';
 
 
 
 
 
 
96
  endif;
97
 
98
  echo '<td class="data-name">' . $name . '</td>';
@@ -106,7 +121,7 @@ if ( ! isset( $subs ) ) $subs = array();
106
  $format = sp_array_value( $formats, $key, 'number' );
107
  $placeholder = sp_get_format_placeholder( $format );
108
 
109
- $value = '&mdash;';
110
  if ( $key == 'position' ):
111
  $positions = array();
112
  if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
@@ -136,7 +151,7 @@ if ( ! isset( $subs ) ) $subs = array();
136
  $totals[ $key ] = $placeholder;
137
  endif;
138
 
139
- if ( 'text' !== $format ) {
140
  $totals[ $key ] += $value;
141
  }
142
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
59
  foreach ( $subs as $sub_id => $sub ):
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
 
67
  $data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode );
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>';
121
  $format = sp_array_value( $formats, $key, 'number' );
122
  $placeholder = sp_get_format_placeholder( $format );
123
 
124
+ $value = '-';
125
  if ( $key == 'position' ):
126
  $positions = array();
127
  if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
151
  $totals[ $key ] = $placeholder;
152
  endif;
153
 
154
+ if ( 'number' === $format ) {
155
  $totals[ $key ] += $value;
156
  }
157
 
templates/event-performance.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.7
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -14,6 +14,7 @@ $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
  $sections = get_option( 'sportspress_event_performance_sections', -1 );
18
  $abbreviate_teams = get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false;
19
  $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
@@ -28,9 +29,7 @@ if ( ! isset( $id ) )
28
  $teams = get_post_meta( $id, 'sp_team', false );
29
 
30
  if ( is_array( $teams ) ):
31
- ?>
32
- <div class="sp-event-performance-tables sp-event-performance-teams">
33
- <?php
34
 
35
  $event = new SP_Event( $id );
36
  $performance = $event->performance();
@@ -105,6 +104,7 @@ if ( is_array( $teams ) ):
105
  'sortable' => $sortable,
106
  'show_players' => $show_players,
107
  'show_numbers' => $show_numbers,
 
108
  'show_total' => $show_total,
109
  'caption' => __( 'Box Score', 'sportspress' ),
110
  'labels' => $labels,
@@ -129,6 +129,7 @@ if ( is_array( $teams ) ):
129
  }
130
 
131
  // Initialize labels
 
132
  $labels = array( array(), array() );
133
 
134
  // Add positions if applicable
@@ -138,6 +139,7 @@ if ( is_array( $teams ) ):
138
 
139
  // Get labels by section
140
  foreach ( $columns as $column ):
 
141
  $section = get_post_meta( $column->ID, 'sp_section', true );
142
  if ( '' === $section ) {
143
  $section = -1;
@@ -212,6 +214,7 @@ if ( is_array( $teams ) ):
212
  'sortable' => $sortable,
213
  'show_players' => $show_team_players,
214
  'show_numbers' => $show_numbers,
 
215
  'show_total' => $show_total,
216
  'caption' => 0 == $s && $team_id ? sp_get_team_name( $team_id, $abbreviate_teams ) : null,
217
  'labels' => $labels[ $section_id ],
@@ -247,6 +250,7 @@ if ( is_array( $teams ) ):
247
  'sortable' => $sortable,
248
  'show_players' => $show_team_players,
249
  'show_numbers' => $show_numbers,
 
250
  'show_total' => $show_total,
251
  'caption' => $team_id ? sp_get_team_name( $team_id, $abbreviate_teams ) : null,
252
  'labels' => $labels,
@@ -271,7 +275,16 @@ if ( is_array( $teams ) ):
271
  }
272
 
273
  do_action( 'sportspress_event_performance' );
274
- ?>
275
- </div><!-- .sp-event-performance-tables -->
276
- <?php
 
 
 
 
 
 
 
 
 
277
  endif;
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
  $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;
29
  $teams = get_post_meta( $id, 'sp_team', false );
30
 
31
  if ( is_array( $teams ) ):
32
+ ob_start();
 
 
33
 
34
  $event = new SP_Event( $id );
35
  $performance = $event->performance();
104
  'sortable' => $sortable,
105
  'show_players' => $show_players,
106
  'show_numbers' => $show_numbers,
107
+ 'show_minutes' => $show_minutes,
108
  'show_total' => $show_total,
109
  'caption' => __( 'Box Score', 'sportspress' ),
110
  'labels' => $labels,
129
  }
130
 
131
  // Initialize labels
132
+ $selected = $labels;
133
  $labels = array( array(), array() );
134
 
135
  // Add positions if applicable
139
 
140
  // Get labels by section
141
  foreach ( $columns as $column ):
142
+ if ( ! array_key_exists( $column->post_name, $selected ) ) continue;
143
  $section = get_post_meta( $column->ID, 'sp_section', true );
144
  if ( '' === $section ) {
145
  $section = -1;
214
  'sortable' => $sortable,
215
  'show_players' => $show_team_players,
216
  'show_numbers' => $show_numbers,
217
+ 'show_minutes' => $show_minutes,
218
  'show_total' => $show_total,
219
  'caption' => 0 == $s && $team_id ? sp_get_team_name( $team_id, $abbreviate_teams ) : null,
220
  'labels' => $labels[ $section_id ],
250
  'sortable' => $sortable,
251
  'show_players' => $show_team_players,
252
  'show_numbers' => $show_numbers,
253
+ 'show_minutes' => $show_minutes,
254
  'show_total' => $show_total,
255
  'caption' => $team_id ? sp_get_team_name( $team_id, $abbreviate_teams ) : null,
256
  'labels' => $labels,
275
  }
276
 
277
  do_action( 'sportspress_event_performance' );
278
+
279
+ $content = ob_get_clean();
280
+
281
+ $content = trim( $content );
282
+
283
+ if ( ! empty( $content ) ):
284
+ ?>
285
+ <div class="sp-event-performance-tables sp-event-performance-teams">
286
+ <?php echo $content; ?>
287
+ </div><!-- .sp-event-performance-tables -->
288
+ <?php
289
+ endif;
290
  endif;
templates/player-details.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
@@ -14,6 +14,8 @@ if ( ! isset( $id ) )
14
  $id = get_the_ID();
15
 
16
  $defaults = array(
 
 
17
  'show_nationality' => get_option( 'sportspress_player_show_nationality', 'yes' ) == 'yes' ? true : false,
18
  'show_positions' => get_option( 'sportspress_player_show_positions', 'yes' ) == 'yes' ? true : false,
19
  'show_current_teams' => get_option( 'sportspress_player_show_current_teams', 'yes' ) == 'yes' ? true : false,
@@ -31,69 +33,90 @@ $countries = SP()->countries->countries;
31
 
32
  $player = new SP_Player( $id );
33
 
34
- $nationalities = $player->nationalities();
35
- $positions = $player->positions();
36
- $current_teams = $player->current_teams();
37
- $past_teams = $player->past_teams();
38
- $leagues = $player->leagues();
39
- $seasons = $player->seasons();
40
  $metrics_before = $player->metrics( true );
41
  $metrics_after = $player->metrics( false );
42
 
43
  $common = array();
44
- if ( $show_nationality && $nationalities && is_array( $nationalities ) ):
45
- $values = array();
46
- foreach ( $nationalities as $nationality ):
47
- $country_name = sp_array_value( $countries, $nationality, null );
48
- $values[] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '&mdash;';
49
- endforeach;
50
- $common[ __( 'Nationality', 'sportspress' ) ] = implode( '<br>', $values );
 
 
 
 
 
 
 
 
 
 
 
 
51
  endif;
52
 
53
- if ( $show_positions && $positions && is_array( $positions ) ):
54
- $position_names = array();
55
- foreach ( $positions as $position ):
56
- $position_names[] = $position->name;
57
- endforeach;
58
- $common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );
 
 
 
59
  endif;
60
 
61
  $data = array_merge( $metrics_before, $common, $metrics_after );
62
 
63
- if ( $show_current_teams && $current_teams ):
64
- $teams = array();
65
- foreach ( $current_teams as $team ):
66
- $team_name = sp_get_team_name( $team, $abbreviate_teams );
67
- if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
68
- $teams[] = $team_name;
69
- endforeach;
70
- $data[ __( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams );
 
 
 
71
  endif;
72
 
73
- if ( $show_past_teams && $past_teams ):
74
- $teams = array();
75
- foreach ( $past_teams as $team ):
76
- $team_name = sp_get_team_name( $team, $abbreviate_teams );
77
- if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
78
- $teams[] = $team_name;
79
- endforeach;
80
- $data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
 
 
 
81
  endif;
82
 
83
- if ( $show_leagues && $leagues && ! is_wp_error( $leagues ) ):
84
- $terms = array();
85
- foreach ( $leagues as $league ) {
86
- $terms[] = $league->name;
87
- }
88
- $data[ __( 'Competitions', 'sportspress' ) ] = implode( ', ', $terms );
 
 
 
89
  endif;
90
 
91
- if ( $show_seasons && $seasons && ! is_wp_error( $seasons ) ):
92
- $terms = array();
93
- foreach ( $seasons as $season ) {
94
- $terms[] = $season->name;
95
- }
96
- $data[ __( 'Seasons', 'sportspress' ) ] = implode( ', ', $terms );
 
 
 
97
  endif;
98
 
99
  $data = apply_filters( 'sportspress_player_details', $data, $id );
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
  $id = get_the_ID();
15
 
16
  $defaults = array(
17
+ 'show_number' => get_option( 'sportspress_player_show_number', 'no' ) == 'yes' ? true : false,
18
+ 'show_name' => get_option( 'sportspress_player_show_name', 'no' ) == 'yes' ? true : false,
19
  'show_nationality' => get_option( 'sportspress_player_show_nationality', 'yes' ) == 'yes' ? true : false,
20
  'show_positions' => get_option( 'sportspress_player_show_positions', 'yes' ) == 'yes' ? true : false,
21
  'show_current_teams' => get_option( 'sportspress_player_show_current_teams', 'yes' ) == 'yes' ? true : false,
33
 
34
  $player = new SP_Player( $id );
35
 
 
 
 
 
 
 
36
  $metrics_before = $player->metrics( true );
37
  $metrics_after = $player->metrics( false );
38
 
39
  $common = array();
40
+
41
+ if ( $show_number ):
42
+ $common[ '#' ] = $player->number;
43
+ endif;
44
+
45
+ if ( $show_name ):
46
+ $common[ __( 'Name', 'sportspress' ) ] = $player->post->post_title;
47
+ endif;
48
+
49
+ if ( $show_nationality ):
50
+ $nationalities = $player->nationalities();
51
+ if ( $nationalities && is_array( $nationalities ) ):
52
+ $values = array();
53
+ foreach ( $nationalities as $nationality ):
54
+ $country_name = sp_array_value( $countries, $nationality, null );
55
+ $values[] = $country_name ? ( $show_nationality_flags ? '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/flags/' . strtolower( $nationality ) . '.png" alt="' . $nationality . '"> ' : '' ) . $country_name : '&mdash;';
56
+ endforeach;
57
+ $common[ __( 'Nationality', 'sportspress' ) ] = implode( '<br>', $values );
58
+ endif;
59
  endif;
60
 
61
+ if ( $show_positions ):
62
+ $positions = $player->positions();
63
+ if ( $positions && is_array( $positions ) ):
64
+ $position_names = array();
65
+ foreach ( $positions as $position ):
66
+ $position_names[] = $position->name;
67
+ endforeach;
68
+ $common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );
69
+ endif;
70
  endif;
71
 
72
  $data = array_merge( $metrics_before, $common, $metrics_after );
73
 
74
+ if ( $show_current_teams ):
75
+ $current_teams = $player->current_teams();
76
+ if ( $current_teams ):
77
+ $teams = array();
78
+ foreach ( $current_teams as $team ):
79
+ $team_name = sp_get_team_name( $team, $abbreviate_teams );
80
+ if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
81
+ $teams[] = $team_name;
82
+ endforeach;
83
+ $data[ __( 'Current Team', 'sportspress' ) ] = implode( ', ', $teams );
84
+ endif;
85
  endif;
86
 
87
+ if ( $show_past_teams ):
88
+ $past_teams = $player->past_teams();
89
+ if ( $past_teams ):
90
+ $teams = array();
91
+ foreach ( $past_teams as $team ):
92
+ $team_name = sp_get_team_name( $team, $abbreviate_teams );
93
+ if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
94
+ $teams[] = $team_name;
95
+ endforeach;
96
+ $data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
97
+ endif;
98
  endif;
99
 
100
+ if ( $show_leagues ):
101
+ $leagues = $player->leagues();
102
+ if ( $leagues && ! is_wp_error( $leagues ) ):
103
+ $terms = array();
104
+ foreach ( $leagues as $league ) {
105
+ $terms[] = $league->name;
106
+ }
107
+ $data[ __( 'Competitions', 'sportspress' ) ] = implode( ', ', $terms );
108
+ endif;
109
  endif;
110
 
111
+ if ( $show_seasons ):
112
+ $seasons = $player->seasons();
113
+ if ( $seasons && ! is_wp_error( $seasons ) ):
114
+ $terms = array();
115
+ foreach ( $seasons as $season ) {
116
+ $terms[] = $season->name;
117
+ }
118
+ $data[ __( 'Seasons', 'sportspress' ) ] = implode( ', ', $terms );
119
+ endif;
120
  endif;
121
 
122
  $data = apply_filters( 'sportspress_player_details', $data, $id );
templates/player-list.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
@@ -172,7 +172,7 @@ foreach ( $groups as $group ):
172
  if ( array_key_exists( 'team', $labels ) ):
173
  $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_team', true ) );
174
  $team_name = sp_get_team_name( $team, $abbreviate_teams );
175
- if ( $link_teams ):
176
  $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
177
  endif;
178
  $output .= '<td class="data-team">' . $team_name . '</td>';
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
172
  if ( array_key_exists( 'team', $labels ) ):
173
  $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_team', true ) );
174
  $team_name = sp_get_team_name( $team, $abbreviate_teams );
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>';
templates/player-selector.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Player Dropdown
4
+ *
5
+ * @author ThemeBoy
6
+ * @package SportsPress/Templates
7
+ * @version 2.1.4
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
+ if ( get_option( 'sportspress_player_show_selector', 'yes' ) === 'no' ) return;
12
+
13
+ if ( ! isset( $id ) )
14
+ $id = get_the_ID();
15
+
16
+ $league_ids = sp_get_the_term_ids( $id, 'sp_league' );
17
+ $season_ids = sp_get_the_term_ids( $id, 'sp_season' );
18
+ $team = get_post_meta( $id, 'sp_current_team', true );
19
+
20
+ $args = array(
21
+ 'post_type' => 'sp_player',
22
+ 'numberposts' => 500,
23
+ 'posts_per_page' => 500,
24
+ 'meta_key' => 'sp_number',
25
+ 'orderby' => 'meta_value_num',
26
+ 'order' => 'ASC',
27
+ 'tax_query' => array(
28
+ 'relation' => 'AND',
29
+ ),
30
+ );
31
+
32
+ if ( $league_ids ):
33
+ $args['tax_query'][] = array(
34
+ 'taxonomy' => 'sp_league',
35
+ 'field' => 'term_id',
36
+ 'terms' => $league_ids
37
+ );
38
+ endif;
39
+
40
+ if ( $season_ids ):
41
+ $args['tax_query'][] = array(
42
+ 'taxonomy' => 'sp_season',
43
+ 'field' => 'term_id',
44
+ 'terms' => $season_ids
45
+ );
46
+ endif;
47
+
48
+ if ( $team && apply_filters( 'sportspress_has_teams', true ) ):
49
+ $args['meta_query'] = array(
50
+ array(
51
+ 'key' => 'sp_team',
52
+ 'value' => $team
53
+ ),
54
+ );
55
+ endif;
56
+
57
+ $players = get_posts( $args );
58
+
59
+ $options = array();
60
+
61
+ if ( $players && is_array( $players ) ):
62
+ foreach ( $players as $player ):
63
+ $name = $player->post_title;
64
+ $number = get_post_meta( $player->ID, 'sp_number', true );
65
+ if ( isset( $number ) && '' !== $number ):
66
+ $name = $number . '. ' . $name;
67
+ endif;
68
+ $options[] = '<option value="' . get_post_permalink( $player->ID ) . '" ' . selected( $player->ID, $id, false ) . '>' . $name . '</option>';
69
+ endforeach;
70
+ endif;
71
+
72
+ if ( sizeof( $options ) > 1 ):
73
+ ?>
74
+ <div class="sp-template sp-template-player-selector sp-template-profile-selector">
75
+ <select class="sp-profile-selector sp-player-selector sp-selector-redirect">
76
+ <?php echo implode( $options ); ?>
77
+ </select>
78
+ </div>
79
+ <?php
80
+ endif;
templates/staff-selector.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Staff Dropdown
4
+ *
5
+ * @author ThemeBoy
6
+ * @package SportsPress/Templates
7
+ * @version 2.1.4
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
+ if ( get_option( 'sportspress_staff_show_selector', 'yes' ) === 'no' ) return;
12
+
13
+ if ( ! isset( $id ) )
14
+ $id = get_the_ID();
15
+
16
+ $league_ids = sp_get_the_term_ids( $id, 'sp_league' );
17
+ $season_ids = sp_get_the_term_ids( $id, 'sp_season' );
18
+ $team = get_post_meta( $id, 'sp_current_team', true );
19
+
20
+ $args = array(
21
+ 'post_type' => 'sp_staff',
22
+ 'numberposts' => 500,
23
+ 'posts_per_page' => 500,
24
+ 'orderby' => 'title',
25
+ 'order' => 'ASC',
26
+ 'tax_query' => array(
27
+ 'relation' => 'AND',
28
+ ),
29
+ );
30
+
31
+ if ( $league_ids ):
32
+ $args['tax_query'][] = array(
33
+ 'taxonomy' => 'sp_league',
34
+ 'field' => 'term_id',
35
+ 'terms' => $league_ids
36
+ );
37
+ endif;
38
+
39
+ if ( $season_ids ):
40
+ $args['tax_query'][] = array(
41
+ 'taxonomy' => 'sp_season',
42
+ 'field' => 'term_id',
43
+ 'terms' => $season_ids
44
+ );
45
+ endif;
46
+
47
+ if ( $team && apply_filters( 'sportspress_has_teams', true ) ):
48
+ $args['meta_query'] = array(
49
+ array(
50
+ 'key' => 'sp_team',
51
+ 'value' => $team
52
+ ),
53
+ );
54
+ endif;
55
+
56
+ $staffs = get_posts( $args );
57
+
58
+ $options = array();
59
+
60
+ if ( $staffs && is_array( $staffs ) ):
61
+ foreach ( $staffs as $staff ):
62
+ $options[] = '<option value="' . get_post_permalink( $staff->ID ) . '" ' . selected( $staff->ID, $id, false ) . '>' . $staff->post_title . '</option>';
63
+ endforeach;
64
+ endif;
65
+
66
+ if ( sizeof( $options ) > 1 ):
67
+ ?>
68
+ <div class="sp-template sp-template-staff-selector sp-template-profile-selector">
69
+ <select class="sp-profile-selector sp-staff-selector sp-selector-redirect">
70
+ <?php echo implode( $options ); ?>
71
+ </select>
72
+ </div>
73
+ <?php
74
+ endif;
templates/venue-map.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.0.14
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -19,6 +19,8 @@ $longitude = sp_array_value( $meta, 'sp_longitude', null );
19
  $zoom = get_option( 'sportspress_map_zoom', 15 );
20
  $maptype = get_option( 'sportspress_map_type', 'roadmap' );
21
  $maptype = strtolower( $maptype );
 
 
22
  if ( 'satellite' !== $maptype ) $maptype = 'roadmap';
23
 
24
  if ( $latitude != null && $longitude != null ):
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.1.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
19
  $zoom = get_option( 'sportspress_map_zoom', 15 );
20
  $maptype = get_option( 'sportspress_map_type', 'roadmap' );
21
  $maptype = strtolower( $maptype );
22
+
23
+ if ( '' === $address ) $address = '+';
24
  if ( 'satellite' !== $maptype ) $maptype = 'roadmap';
25
 
26
  if ( $latitude != null && $longitude != null ):
wpml-config.xml CHANGED
@@ -5,28 +5,40 @@
5
  <key name="Article"/>
6
  <key name="Birthday"/>
7
  <key name="Box Score"/>
 
8
  <key name="Competition"/>
9
  <key name="Current Team"/>
10
  <key name="Current Teams"/>
11
  <key name="Date"/>
12
  <key name="Details"/>
13
  <key name="Event"/>
 
14
  <key name="Event Results"/>
 
15
  <key name="Fixtures"/>
 
 
 
16
  <key name="Nationality"/>
17
  <key name="Outcome"/>
18
  <key name="Past Teams"/>
19
  <key name="Performance"/>
 
20
  <key name="Played"/>
21
  <key name="Player"/>
 
22
  <key name="Pos"/>
23
  <key name="Position"/>
 
24
  <key name="Preview"/>
 
25
  <key name="Rank"/>
26
  <key name="Recap"/>
27
  <key name="Season"/>
28
  <key name="Staff"/>
 
29
  <key name="Substitutes"/>
 
30
  <key name="Team"/>
31
  <key name="Teams"/>
32
  <key name="Time"/>
@@ -37,6 +49,7 @@
37
  <key name="View all events"/>
38
  <key name="View all players"/>
39
  <key name="View full table"/>
 
40
  </key>
41
  </admin-texts>
42
  </wpml-config>
5
  <key name="Article"/>
6
  <key name="Birthday"/>
7
  <key name="Box Score"/>
8
+ <key name="Cancelled"/>
9
  <key name="Competition"/>
10
  <key name="Current Team"/>
11
  <key name="Current Teams"/>
12
  <key name="Date"/>
13
  <key name="Details"/>
14
  <key name="Event"/>
15
+ <key name="Events"/>
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"/>
22
  <key name="Nationality"/>
23
  <key name="Outcome"/>
24
  <key name="Past Teams"/>
25
  <key name="Performance"/>
26
+ <key name="Photo"/>
27
  <key name="Played"/>
28
  <key name="Player"/>
29
+ <key name="Player Lists"/>
30
  <key name="Pos"/>
31
  <key name="Position"/>
32
+ <key name="Postponed"/>
33
  <key name="Preview"/>
34
+ <key name="Profile"/>
35
  <key name="Rank"/>
36
  <key name="Recap"/>
37
  <key name="Season"/>
38
  <key name="Staff"/>
39
+ <key name="Statistics"/>
40
  <key name="Substitutes"/>
41
+ <key name="TBD"/>
42
  <key name="Team"/>
43
  <key name="Teams"/>
44
  <key name="Time"/>
49
  <key name="View all events"/>
50
  <key name="View all players"/>
51
  <key name="View full table"/>
52
+ <key name="Visit Site"/>
53
  </key>
54
  </admin-texts>
55
  </wpml-config>