SportsPress – Sports Club & League Manager - Version 2.6.8

Version Description

  • Feature - Ability to add icons to player statistics.
  • Feature - Ability to display matchday in event blocks.
  • Feature - Add support for commenting on scheduled events.
  • Feature - Option to filter birthdays widget by week.
  • Feature - Option to filter events by competitive or friendly.
  • Tweak - Display pin in venue map and link map to web version.
  • Tweak - Add UK as alternate to GB in countries legacy list.
  • Tweak - Remove duplicate teams from players.
  • Tweak - Improve player assignment filtering for player lists.
  • Fix - Animated countdowns when visitor and site are in a different timezones.
Download this release

Release Info

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

Code changes from version 2.6.7 to 2.6.8

Files changed (38) hide show
  1. assets/css/icons.css +19 -0
  2. assets/css/sportspress.css +14 -0
  3. assets/images/maps/pin.png +0 -0
  4. assets/js/admin/sportspress-admin.js +28 -4
  5. assets/js/sportspress.js +31 -7
  6. changelog.txt +12 -0
  7. includes/admin/class-sp-admin-assets.php +2 -5
  8. includes/admin/class-sp-admin-dashboard.php +2 -2
  9. includes/admin/importers/class-sp-importer.php +2 -2
  10. includes/admin/post-types/class-sp-admin-cpt-statistic.php +5 -1
  11. includes/admin/post-types/class-sp-admin-meta-boxes.php +4 -1
  12. includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php +12 -1
  13. includes/admin/settings/class-sp-settings-players.php +12 -1
  14. includes/admin/views/html-admin-config.php +11 -0
  15. includes/class-sp-ajax.php +29 -3
  16. includes/class-sp-calendar.php +14 -1
  17. includes/class-sp-countries.php +2 -1
  18. includes/class-sp-event.php +4 -1
  19. includes/class-sp-frontend-scripts.php +1 -2
  20. includes/class-sp-player-list.php +18 -5
  21. includes/class-sp-player.php +60 -6
  22. includes/class-sp-post-types.php +4 -1
  23. includes/sp-core-functions.php +5 -3
  24. includes/widgets/class-sp-widget-birthdays.php +1 -0
  25. modules/sportspress-calendars.php +11 -3
  26. modules/sportspress-comments-scheduled-events.php +144 -0
  27. modules/sportspress-icons.php +11 -4
  28. modules/sportspress-player-assignments.php +65 -20
  29. readme.txt +13 -1
  30. sportspress.php +3 -3
  31. templates/birthdays.php +40 -1
  32. templates/countdown.php +2 -2
  33. templates/event-blocks.php +8 -1
  34. templates/event-list.php +4 -1
  35. templates/player-details.php +3 -3
  36. templates/player-list.php +25 -19
  37. templates/player-selector.php +4 -2
  38. templates/venue-map.php +11 -8
assets/css/icons.css CHANGED
@@ -109,3 +109,22 @@
109
  .sp-icon-card:before {
110
  content: "\e801";
111
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  .sp-icon-card:before {
110
  content: "\e801";
111
  }
112
+ .sp-icon-league:before {
113
+ content: "\f332";
114
+ }
115
+ .sp-icon-shield:before {
116
+ content: "\f334";
117
+ }
118
+ .sp-icon-tshirt:before,
119
+ .sp-icon-sp_player:before {
120
+ content: "\f307";
121
+ }
122
+ .sp-icon-whistle:before {
123
+ content: "\f227";
124
+ }
125
+ .sp-icon-time:before {
126
+ content: "\f469";
127
+ }
128
+ .sp-icon-friendly:before {
129
+ content: "\f328";
130
+ }
assets/css/sportspress.css CHANGED
@@ -525,10 +525,24 @@
525
  }
526
 
527
  /* Google Maps */
 
 
 
528
  .sp-google-map {
529
  width: 100%;
530
  height: 320px;
531
  }
 
 
 
 
 
 
 
 
 
 
 
532
  .sp-google-map img {
533
  max-width: none !important;
534
  }
525
  }
526
 
527
  /* Google Maps */
528
+ .sp-google-map-container {
529
+ position: relative;
530
+ }
531
  .sp-google-map {
532
  width: 100%;
533
  height: 320px;
534
  }
535
+ .sp-google-map-link {
536
+ content: '';
537
+ display: block;
538
+ position: absolute;
539
+ top: 0;
540
+ right: 0;
541
+ bottom: 0;
542
+ left: 0;
543
+ background: url(../images/maps/pin.png) no-repeat center center;
544
+ background-size: 26px 82px;
545
+ }
546
  .sp-google-map img {
547
  max-width: none !important;
548
  }
assets/images/maps/pin.png ADDED
Binary file
assets/js/admin/sportspress-admin.js CHANGED
@@ -457,10 +457,34 @@ jQuery(document).ready(function($){
457
 
458
  // Dashboard countdown
459
  $("#sportspress_dashboard_status .sp_status_list li.countdown").each(function() {
460
- var $this = $(this), finalDate = $(this).data('countdown');
461
- $this.countdown(finalDate, function(event) {
462
- $this.find('strong').html(event.strftime("%D "+localized_strings.days+" %H:%M:%S"));
463
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  });
465
 
466
  // Event format affects data
457
 
458
  // Dashboard countdown
459
  $("#sportspress_dashboard_status .sp_status_list li.countdown").each(function() {
460
+ var $this = $(this);
461
+ // Get countdown time
462
+ var countDownDate = new Date($(this).data('countdown')).getTime();
463
+ // Iterate every second
464
+ var x = setInterval(function() {
465
+
466
+ // Get todays date and time
467
+ var now = new Date();
468
+
469
+ // Convert curent date and time to UTC
470
+ var tzDifference = now.getTimezoneOffset();
471
+ var nowutc = new Date(now.getTime() + tzDifference * 60 * 1000);
472
+
473
+ // Find the distance between now and the count down date
474
+ var distance = countDownDate - nowutc;
475
+ if ( distance < 0 ) {
476
+ distance = 0;
477
+ }
478
+
479
+ // Time calculations for days, hours, minutes and seconds
480
+ var days = Math.floor(distance / (1000 * 60 * 60 * 24));
481
+ var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
482
+ var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
483
+ var seconds = Math.floor((distance % (1000 * 60)) / 1000);
484
+
485
+ // Output the result
486
+ $this.find('strong').html(days+" "+localized_strings.days+" "+('0' + hours).slice(-2)+":"+('0' + minutes).slice(-2)+":"+('0' + seconds).slice(-2));
487
+ }, 1000);
488
  });
489
 
490
  // Event format affects data
assets/js/sportspress.js CHANGED
@@ -16,13 +16,37 @@ function sp_viewport() {
16
 
17
  /* Countdown */
18
  $("[data-countdown]").each(function() {
19
- var $this = $(this), finalDate = $(this).data('countdown');
20
- $this.countdown(finalDate, function(event) {
21
- $this.html(event.strftime("<span>%D <small>" + localized_strings.days + "</small></span> "
22
- + "<span>%H <small>" + localized_strings.hrs + "</small></span> "
23
- + "<span>%M <small>" + localized_strings.mins + "</small></span> "
24
- + "<span>%S <small>" + localized_strings.secs + "</small></span>" ));
25
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  });
27
 
28
  /* Scrollable Tables */
16
 
17
  /* Countdown */
18
  $("[data-countdown]").each(function() {
19
+ var $this = $(this);
20
+ // Get countdown time
21
+ var countDownDate = new Date($(this).data('countdown')).getTime();
22
+ // Iterate every second
23
+ var x = setInterval(function() {
24
+
25
+ // Get todays date and time
26
+ var now = new Date();
27
+
28
+ // Convert curent date and time to UTC
29
+ var tzDifference = now.getTimezoneOffset();
30
+ var nowutc = new Date(now.getTime() + tzDifference * 60 * 1000);
31
+
32
+ // Find the distance between now and the count down date
33
+ var distance = countDownDate - nowutc;
34
+ if ( distance < 0 ) {
35
+ distance = 0;
36
+ }
37
+
38
+ // Time calculations for days, hours, minutes and seconds
39
+ var days = Math.floor(distance / (1000 * 60 * 60 * 24));
40
+ var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
41
+ var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
42
+ var seconds = Math.floor((distance % (1000 * 60)) / 1000);
43
+
44
+ // Output the result
45
+ $this.html("<span>"+('0' + days).slice(-2)+" <small>" + localized_strings.days + "</small></span> "
46
+ + "<span>"+('0' + hours).slice(-2)+" <small>" + localized_strings.hrs + "</small></span> "
47
+ + "<span>"+('0' + minutes).slice(-2)+" <small>" + localized_strings.mins + "</small></span> "
48
+ + "<span>"+('0' + seconds).slice(-2)+" <small>" + localized_strings.secs + "</small></span>" );
49
+ }, 1000);
50
  });
51
 
52
  /* Scrollable Tables */
changelog.txt CHANGED
@@ -1,5 +1,17 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 2.6.7 =
4
  * Fix - Update Google Maps API endpoints.
5
 
1
  == SportsPress Changelog ==
2
 
3
+ = 2.6.8 =
4
+ * Feature - Ability to add icons to player statistics.
5
+ * Feature - Ability to display matchday in event blocks.
6
+ * Feature - Add support for commenting on scheduled events.
7
+ * Feature - Option to filter birthdays widget by week.
8
+ * Feature - Option to filter events by competitive or friendly.
9
+ * Tweak - Display pin in venue map and link map to web version.
10
+ * Tweak - Add UK as alternate to GB in countries legacy list.
11
+ * Tweak - Remove duplicate teams from players.
12
+ * Tweak - Improve player assignment filtering for player lists.
13
+ * Fix - Animated countdowns when visitor and site are in a different timezones.
14
+
15
  = 2.6.7 =
16
  * Fix - Update Google Maps API endpoints.
17
 
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.6.7
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -82,8 +82,6 @@ class SP_Admin_Assets {
82
 
83
  wp_register_script( 'jquery-caret', SP()->plugin_url() . '/assets/js/jquery.caret.min.js', array( 'jquery' ), '1.02', true );
84
 
85
- wp_register_script( 'jquery-countdown', SP()->plugin_url() . '/assets/js/jquery.countdown.min.js', array( 'jquery' ), '2.2.0', true );
86
-
87
  wp_register_script( 'jquery-fitvids', SP()->plugin_url() . '/assets/js/jquery.fitvids.js', array( 'jquery' ), '1.1', true );
88
 
89
  wp_register_script( 'google-maps', '//tboy.co/maps_js' );
@@ -111,9 +109,8 @@ class SP_Admin_Assets {
111
  wp_enqueue_script( 'jquery-ui-sortable' );
112
  wp_enqueue_script( 'jquery-tiptip' );
113
  wp_enqueue_script( 'jquery-caret' );
114
- wp_enqueue_script( 'jquery-countdown' );
115
  wp_enqueue_script( 'jquery-fitvids' );
116
- wp_enqueue_script( 'sportspress-admin', SP()->plugin_url() . '/assets/js/admin/sportspress-admin.js', array( 'jquery', 'chosen', 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-tiptip', 'jquery-caret', 'jquery-countdown', 'jquery-fitvids' ), SP_VERSION, true );
117
 
118
  $strings = apply_filters( 'sportspress_localized_strings', array(
119
  'none' => __( 'None', 'sportspress' ),
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.6.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
82
 
83
  wp_register_script( 'jquery-caret', SP()->plugin_url() . '/assets/js/jquery.caret.min.js', array( 'jquery' ), '1.02', true );
84
 
 
 
85
  wp_register_script( 'jquery-fitvids', SP()->plugin_url() . '/assets/js/jquery.fitvids.js', array( 'jquery' ), '1.1', true );
86
 
87
  wp_register_script( 'google-maps', '//tboy.co/maps_js' );
109
  wp_enqueue_script( 'jquery-ui-sortable' );
110
  wp_enqueue_script( 'jquery-tiptip' );
111
  wp_enqueue_script( 'jquery-caret' );
 
112
  wp_enqueue_script( 'jquery-fitvids' );
113
+ wp_enqueue_script( 'sportspress-admin', SP()->plugin_url() . '/assets/js/admin/sportspress-admin.js', array( 'jquery', 'chosen', 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-tiptip', 'jquery-caret', 'jquery-fitvids' ), SP_VERSION, true );
114
 
115
  $strings = apply_filters( 'sportspress_localized_strings', array(
116
  'none' => __( 'None', 'sportspress' ),
includes/admin/class-sp-admin-dashboard.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
@@ -75,7 +75,7 @@ class SP_Admin_Dashboard {
75
  $date = new DateTime( $next_event->post_date );
76
  $interval = date_diff( $now, $date );
77
  ?>
78
- <li class="countdown" data-countdown="<?php echo str_replace( '-', '/', $next_event->post_date ); ?>">
79
  <a href="<?php echo get_edit_post_link( $next_event->ID ); ?>">
80
  <?php printf( __( '<strong>%s</strong> until next event', 'sportspress' ), $interval->days . ' ' . __( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', $interval->h, $interval->i, $interval->s ) ); ?>
81
  (<?php echo $next_event->post_title; ?>)
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.6.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
75
  $date = new DateTime( $next_event->post_date );
76
  $interval = date_diff( $now, $date );
77
  ?>
78
+ <li class="countdown" data-countdown="<?php echo str_replace( '-', '/', get_gmt_from_date( $next_event->post_date ) ); ?>">
79
  <a href="<?php echo get_edit_post_link( $next_event->ID ); ?>">
80
  <?php printf( __( '<strong>%s</strong> until next event', 'sportspress' ), $interval->days . ' ' . __( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', $interval->h, $interval->i, $interval->s ) ); ?>
81
  (<?php echo $next_event->post_title; ?>)
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 2.1
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -35,7 +35,7 @@ if ( class_exists( 'WP_Importer' ) ) {
35
  * Enqueue scripts
36
  */
37
  public function admin_scripts() {
38
- wp_enqueue_script( 'sportspress-admin', SP()->plugin_url() . '/assets/js/admin/sportspress-admin.js', array( 'jquery', 'chosen', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-tiptip', 'jquery-caret', 'jquery-countdown' ), SP_VERSION, true );
39
  }
40
 
41
  /**
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Importers
8
+ * @version 2.6.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
35
  * Enqueue scripts
36
  */
37
  public function admin_scripts() {
38
+ wp_enqueue_script( 'sportspress-admin', SP()->plugin_url() . '/assets/js/admin/sportspress-admin.js', array( 'jquery', 'chosen', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-tiptip', 'jquery-caret' ), SP_VERSION, true );
39
  }
40
 
41
  /**
includes/admin/post-types/class-sp-admin-cpt-statistic.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
- * @version 1.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -40,6 +40,7 @@ class SP_Admin_CPT_Statistic extends SP_Admin_CPT {
40
  public function edit_columns( $existing_columns ) {
41
  $columns = array(
42
  'cb' => '<input type="checkbox" />',
 
43
  'title' => __( 'Label', 'sportspress' ),
44
  'sp_key' => __( 'Key', 'sportspress' ),
45
  'sp_equation' => __( 'Equation', 'sportspress' ),
@@ -55,6 +56,9 @@ class SP_Admin_CPT_Statistic extends SP_Admin_CPT {
55
  */
56
  public function custom_columns( $column, $post_id ) {
57
  switch ( $column ):
 
 
 
58
  case 'sp_key':
59
  global $post;
60
  echo $post->post_name;
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
+ * @version 2.6.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
40
  public function edit_columns( $existing_columns ) {
41
  $columns = array(
42
  'cb' => '<input type="checkbox" />',
43
+ 'sp_icon' => __( 'Icon', 'sportspress' ),
44
  'title' => __( 'Label', 'sportspress' ),
45
  'sp_key' => __( 'Key', 'sportspress' ),
46
  'sp_equation' => __( 'Equation', 'sportspress' ),
56
  */
57
  public function custom_columns( $column, $post_id ) {
58
  switch ( $column ):
59
+ case 'sp_icon':
60
+ echo has_post_thumbnail( $post_id ) ? edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-fit-mini' ), '', '', $post_id ) : '';
61
+ break;
62
  case 'sp_key':
63
  global $post;
64
  echo $post->post_name;
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.5.1
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -303,6 +303,9 @@ class SP_Admin_Meta_Boxes {
303
 
304
  remove_meta_box( 'postimagediv', 'sp_performance', 'side' );
305
  add_meta_box( 'postimagediv', __( 'Icon', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_performance', 'side', 'low' );
 
 
 
306
  }
307
 
308
  /**
7
  * @author ThemeBoy
8
  * @category Admin
9
  * @package SportsPress/Admin/Meta_Boxes
10
+ * @version 2.6.8
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
303
 
304
  remove_meta_box( 'postimagediv', 'sp_performance', 'side' );
305
  add_meta_box( 'postimagediv', __( 'Icon', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_performance', 'side', 'low' );
306
+
307
+ remove_meta_box( 'postimagediv', 'sp_statistic', 'side' );
308
+ add_meta_box( 'postimagediv', __( 'Icon', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_statistic', 'side', 'low' );
309
  }
310
 
311
  /**
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 2.5.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -28,6 +28,7 @@ class SP_Meta_Box_Calendar_Details {
28
  $date_past = get_post_meta( $post->ID, 'sp_date_past', true );
29
  $date_future = get_post_meta( $post->ID, 'sp_date_future', true );
30
  $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true );
 
31
  $day = get_post_meta( $post->ID, 'sp_day', true );
32
  $teams = get_post_meta( $post->ID, 'sp_team', false );
33
  $table_id = get_post_meta( $post->ID, 'sp_table', true );
@@ -49,6 +50,15 @@ class SP_Meta_Box_Calendar_Details {
49
  sp_dropdown_statuses( $args );
50
  ?>
51
  </p>
 
 
 
 
 
 
 
 
 
52
  <div class="sp-date-selector">
53
  <p><strong><?php _e( 'Date', 'sportspress' ); ?></strong></p>
54
  <p>
@@ -139,6 +149,7 @@ class SP_Meta_Box_Calendar_Details {
139
  public static function save( $post_id, $post ) {
140
  update_post_meta( $post_id, 'sp_caption', esc_attr( sp_array_value( $_POST, 'sp_caption', 0 ) ) );
141
  update_post_meta( $post_id, 'sp_status', sp_array_value( $_POST, 'sp_status', 0 ) );
 
142
  update_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0 ) );
143
  update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null ) );
144
  update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null ) );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
  $date_past = get_post_meta( $post->ID, 'sp_date_past', true );
29
  $date_future = get_post_meta( $post->ID, 'sp_date_future', true );
30
  $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true );
31
+ $event_format = get_post_meta( $post->ID, 'sp_event_format', true );
32
  $day = get_post_meta( $post->ID, 'sp_day', true );
33
  $teams = get_post_meta( $post->ID, 'sp_team', false );
34
  $table_id = get_post_meta( $post->ID, 'sp_table', true );
50
  sp_dropdown_statuses( $args );
51
  ?>
52
  </p>
53
+ <p><strong><?php _e( 'Event Format', 'sportspress' ); ?></strong></p>
54
+ <p>
55
+ <select name="sp_event_format" class="postform">
56
+ <option value="all">All</option>
57
+ <?php foreach ( SP()->formats->event as $key => $format ): ?>
58
+ <option value="<?php echo $key; ?>" <?php selected( $event_format, $key ); ?>><?php echo $format; ?></option>
59
+ <?php endforeach; ?>
60
+ </select>
61
+ </p>
62
  <div class="sp-date-selector">
63
  <p><strong><?php _e( 'Date', 'sportspress' ); ?></strong></p>
64
  <p>
149
  public static function save( $post_id, $post ) {
150
  update_post_meta( $post_id, 'sp_caption', esc_attr( sp_array_value( $_POST, 'sp_caption', 0 ) ) );
151
  update_post_meta( $post_id, 'sp_status', sp_array_value( $_POST, 'sp_status', 0 ) );
152
+ update_post_meta( $post_id, 'sp_event_format', sp_array_value( $_POST, 'sp_event_format', 0 ) );
153
  update_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0 ) );
154
  update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null ) );
155
  update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null ) );
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.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -148,6 +148,17 @@ class SP_Settings_Players extends SP_Settings_Page {
148
  'manual' => __( 'Manual', 'sportspress' ),
149
  ),
150
  ),
 
 
 
 
 
 
 
 
 
 
 
151
 
152
  array(
153
  'title' => __( 'Categories', 'sportspress' ),
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.6.8
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
148
  'manual' => __( 'Manual', 'sportspress' ),
149
  ),
150
  ),
151
+
152
+ array(
153
+ 'title' => __( 'Mode', 'sportspress' ),
154
+ 'id' => 'sportspress_player_statistics_mode',
155
+ 'default' => 'values',
156
+ 'type' => 'radio',
157
+ 'options' => array(
158
+ 'values' => __( 'Values', 'sportspress' ),
159
+ 'icons' => __( 'Icons', 'sportspress' ),
160
+ ),
161
+ ),
162
 
163
  array(
164
  'title' => __( 'Categories', 'sportspress' ),
includes/admin/views/html-admin-config.php CHANGED
@@ -371,6 +371,7 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
371
  <thead>
372
  <tr>
373
  <th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
 
374
  <th scope="col"><?php _e( 'Equation', 'sportspress' ); ?></th>
375
  <th scope="col"><?php _e( 'Decimal Places', 'sportspress' ); ?></th>
376
  <th scope="col"><?php _e( 'Category', 'sportspress' ); ?></th>
@@ -391,6 +392,16 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
391
  ?>
392
  <tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
393
  <td class="row-title"><?php echo $row->post_title; ?></td>
 
 
 
 
 
 
 
 
 
 
394
  <td><?php echo sp_get_post_equation( $row->ID ); ?></td>
395
  <td><?php echo sp_get_post_precision( $row->ID ); ?></td>
396
  <td><?php echo sp_get_post_section( $row->ID ); ?></td>
371
  <thead>
372
  <tr>
373
  <th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
374
+ <th class="icon" scope="col"><?php _e( 'Icon', 'sportspress' ); ?></th>
375
  <th scope="col"><?php _e( 'Equation', 'sportspress' ); ?></th>
376
  <th scope="col"><?php _e( 'Decimal Places', 'sportspress' ); ?></th>
377
  <th scope="col"><?php _e( 'Category', 'sportspress' ); ?></th>
392
  ?>
393
  <tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
394
  <td class="row-title"><?php echo $row->post_title; ?></td>
395
+ <td class="icon">
396
+ <?php
397
+ if ( has_post_thumbnail( $row->ID ) )
398
+ $icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );
399
+ else
400
+ $icon = '&nbsp;';
401
+
402
+ echo apply_filters( 'sportspress_performance_icon', $icon, $row->ID );
403
+ ?>
404
+ </td>
405
  <td><?php echo sp_get_post_equation( $row->ID ); ?></td>
406
  <td><?php echo sp_get_post_precision( $row->ID ); ?></td>
407
  <td><?php echo sp_get_post_section( $row->ID ); ?></td>
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.6
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
@@ -276,7 +276,7 @@ class SP_AJAX {
276
  $args = array(
277
  'name' => 'date',
278
  'id' => 'date',
279
- 'selected' => $date,
280
  );
281
  sp_dropdown_dates( $args );
282
  ?>
@@ -423,13 +423,25 @@ class SP_AJAX {
423
  ?>
424
  </label>
425
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
426
  <div class="sp-date-selector">
427
  <p><?php _e( 'Date:', 'sportspress' ); ?>
428
  <?php
429
  $args = array(
430
  'name' => 'date',
431
  'id' => 'date',
432
- 'selected' => $date,
433
  );
434
  sp_dropdown_dates( $args );
435
  ?>
@@ -617,6 +629,18 @@ class SP_AJAX {
617
  ?>
618
  </label>
619
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
620
  <div class="sp-date-selector">
621
  <p><?php _e( 'Date:', 'sportspress' ); ?>
622
  <?php
@@ -1121,6 +1145,7 @@ class SP_AJAX {
1121
  args.season = $div.find('[name=season]').val();
1122
  args.venue = $div.find('[name=venue]').val();
1123
  args.status = $div.find('[name=status]').val();
 
1124
  args.date = $div.find('[name=date]').val();
1125
  args.date_from = $div.find('[name=date_from]').val();
1126
  args.date_to = $div.find('[name=date_to]').val();
@@ -1140,6 +1165,7 @@ class SP_AJAX {
1140
  args.season = $div.find('[name=season]').val();
1141
  args.venue = $div.find('[name=venue]').val();
1142
  args.status = $div.find('[name=status]').val();
 
1143
  args.date = $div.find('[name=date]').val();
1144
  args.date_from = $div.find('[name=date_from]').val();
1145
  args.date_to = $div.find('[name=date_to]').val();
8
  * AJAX Event Handler
9
  *
10
  * @class SP_AJAX
11
+ * @version 2.6.8
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
276
  $args = array(
277
  'name' => 'date',
278
  'id' => 'date',
279
+ //'selected' => $date,
280
  );
281
  sp_dropdown_dates( $args );
282
  ?>
423
  ?>
424
  </label>
425
  </p>
426
+ <p>
427
+ <label>
428
+ <?php _e( 'Format:', 'sportspress' ); ?>
429
+ <select name="format" class="postform">
430
+ <option value="default">Default</option>
431
+ <option value="all">All</option>
432
+ <?php foreach ( SP()->formats->event as $key => $format ): ?>
433
+ <option value="<?php echo $key; ?>"><?php echo $format; ?></option>
434
+ <?php endforeach; ?>
435
+ </select>
436
+ </label>
437
+ </p>
438
  <div class="sp-date-selector">
439
  <p><?php _e( 'Date:', 'sportspress' ); ?>
440
  <?php
441
  $args = array(
442
  'name' => 'date',
443
  'id' => 'date',
444
+ //'selected' => $date,
445
  );
446
  sp_dropdown_dates( $args );
447
  ?>
629
  ?>
630
  </label>
631
  </p>
632
+ <p>
633
+ <label>
634
+ <?php _e( 'Format:', 'sportspress' ); ?>
635
+ <select name="format" class="postform">
636
+ <option value="default">Default</option>
637
+ <option value="all">All</option>
638
+ <?php foreach ( SP()->formats->event as $key => $format ): ?>
639
+ <option value="<?php echo $key; ?>"><?php echo $format; ?></option>
640
+ <?php endforeach; ?>
641
+ </select>
642
+ </label>
643
+ </p>
644
  <div class="sp-date-selector">
645
  <p><?php _e( 'Date:', 'sportspress' ); ?>
646
  <?php
1145
  args.season = $div.find('[name=season]').val();
1146
  args.venue = $div.find('[name=venue]').val();
1147
  args.status = $div.find('[name=status]').val();
1148
+ args.format = $div.find('[name=format]').val();
1149
  args.date = $div.find('[name=date]').val();
1150
  args.date_from = $div.find('[name=date_from]').val();
1151
  args.date_to = $div.find('[name=date_to]').val();
1165
  args.season = $div.find('[name=season]').val();
1166
  args.venue = $div.find('[name=venue]').val();
1167
  args.status = $div.find('[name=status]').val();
1168
+ args.format = $div.find('[name=format]').val();
1169
  args.date = $div.find('[name=date]').val();
1170
  args.date_from = $div.find('[name=date_from]').val();
1171
  args.date_to = $div.find('[name=date_to]').val();
includes/class-sp-calendar.php CHANGED
@@ -8,7 +8,7 @@
8
  * https://wordpress.org/support/topic/timezone-issues-with-schedule-calendar-list/
9
  *
10
  * @class SP_Calendar
11
- * @version 2.5.5
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
@@ -48,6 +48,9 @@ class SP_Calendar extends SP_Secondary_Post {
48
 
49
  /** @var int The event ID. */
50
  public $event;
 
 
 
51
 
52
  /**
53
  * __construct function.
@@ -102,6 +105,9 @@ class SP_Calendar extends SP_Secondary_Post {
102
 
103
  if ( ! $this->day )
104
  $this->day = get_post_meta( $this->ID, 'sp_day', true );
 
 
 
105
 
106
  if ( ! $this->number )
107
  $this->number = -1;
@@ -205,6 +211,13 @@ class SP_Calendar extends SP_Secondary_Post {
205
  );
206
  endif;
207
 
 
 
 
 
 
 
 
208
  if ( $this->day ):
209
  $args['meta_query'][] = array(
210
  'key' => 'sp_day',
8
  * https://wordpress.org/support/topic/timezone-issues-with-schedule-calendar-list/
9
  *
10
  * @class SP_Calendar
11
+ * @version 2.6.8
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
48
 
49
  /** @var int The event ID. */
50
  public $event;
51
+
52
+ /** @var integer The event format slug. */
53
+ public $event_format;
54
 
55
  /**
56
  * __construct function.
105
 
106
  if ( ! $this->day )
107
  $this->day = get_post_meta( $this->ID, 'sp_day', true );
108
+
109
+ if ( ! $this->event_format )
110
+ $this->event_format = get_post_meta( $this->ID, 'sp_event_format', true );
111
 
112
  if ( ! $this->number )
113
  $this->number = -1;
211
  );
212
  endif;
213
 
214
+ if ( $this->event_format && 'all' != $this->event_format ):
215
+ $args['meta_query'][] = array(
216
+ 'key' => 'sp_format',
217
+ 'value' => $this->event_format,
218
+ );
219
+ endif;
220
+
221
  if ( $this->day ):
222
  $args['meta_query'][] = array(
223
  'key' => 'sp_day',
includes/class-sp-countries.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress countries class stores continent/country data.
6
  *
7
  * @class SP_Countries
8
- * @version 2.6.5
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -682,6 +682,7 @@ class SP_Countries {
682
  'tw' => 'tpw',
683
  'tz' => 'tan',
684
  'ua' => 'ukr',
 
685
  'ug' => 'uga',
686
  'us' => 'usa',
687
  'uy' => 'uru',
5
  * The SportsPress countries class stores continent/country data.
6
  *
7
  * @class SP_Countries
8
+ * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
682
  'tw' => 'tpw',
683
  'tz' => 'tan',
684
  'ua' => 'ukr',
685
+ 'uk' => 'gbr',
686
  'ug' => 'uga',
687
  'us' => 'usa',
688
  'uy' => 'uru',
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.6.6
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -569,6 +569,9 @@ class SP_Event extends SP_Custom_Post{
569
  ),
570
  ),
571
  ) );
 
 
 
572
 
573
  if ( ! $include_empty && empty( $duties ) ) return null;
574
 
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
+ * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
569
  ),
570
  ),
571
  ) );
572
+ if ( ! is_array( $duties ) ) {
573
+ return array();
574
+ }
575
 
576
  if ( ! $include_empty && empty( $duties ) ) return null;
577
 
includes/class-sp-frontend-scripts.php CHANGED
@@ -3,7 +3,7 @@
3
  * Handle frontend forms
4
  *
5
  * @class SP_Frontend_Scripts
6
- * @version 2.5
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
@@ -72,7 +72,6 @@ class SP_Frontend_Scripts {
72
  // Scripts
73
  wp_enqueue_script( 'jquery' );
74
  wp_enqueue_script( 'jquery-datatables', plugin_dir_url( SP_PLUGIN_FILE ) .'assets/js/jquery.dataTables.min.js', array( 'jquery' ), '1.10.4', true );
75
- wp_enqueue_script( 'jquery-countdown', plugin_dir_url( SP_PLUGIN_FILE ) .'assets/js/jquery.countdown.min.js', array( 'jquery' ), '2.2.0', true );
76
  wp_enqueue_script( 'sportspress', plugin_dir_url( SP_PLUGIN_FILE ) .'assets/js/sportspress.js', array( 'jquery' ), SP()->version, true );
77
 
78
  // Localize scripts
3
  * Handle frontend forms
4
  *
5
  * @class SP_Frontend_Scripts
6
+ * @version 2.6.8
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
72
  // Scripts
73
  wp_enqueue_script( 'jquery' );
74
  wp_enqueue_script( 'jquery-datatables', plugin_dir_url( SP_PLUGIN_FILE ) .'assets/js/jquery.dataTables.min.js', array( 'jquery' ), '1.10.4', true );
 
75
  wp_enqueue_script( 'sportspress', plugin_dir_url( SP_PLUGIN_FILE ) .'assets/js/sportspress.js', array( 'jquery' ), SP()->version, true );
76
 
77
  // Localize scripts
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.6.4
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -213,8 +213,17 @@ class SP_Player_List extends SP_Secondary_Post {
213
  // Add precision to object
214
  $stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ) + 0;
215
 
216
- // Add column name to columns
217
- $columns[ $stat->post_name ] = $stat->post_title;
 
 
 
 
 
 
 
 
 
218
 
219
  // Add format
220
  $format = get_post_meta( $stat->ID, 'sp_format', true );
@@ -716,8 +725,12 @@ class SP_Player_List extends SP_Secondary_Post {
716
  $labels = array();
717
  if ( in_array( 'number', $this->columns ) ) $labels['number'] = '#';
718
  $labels['name'] = __( 'Player', 'sportspress' );
719
- if ( in_array( 'team', $this->columns ) ) $labels['team'] = __( 'Team', 'sportspress' );
720
- if ( in_array( 'position', $this->columns ) ) $labels['position'] = __( 'Position', 'sportspress' );
 
 
 
 
721
 
722
  $merged[0] = array_merge( $labels, $columns );
723
  return $merged;
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
+ * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
213
  // Add precision to object
214
  $stat->precision = sp_array_value( sp_array_value( $meta, 'sp_precision', array() ), 0, 0 ) + 0;
215
 
216
+ // Add column icons to columns were is available
217
+ if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' && ( $stat->post_type == 'sp_performance' || $stat->post_type == 'sp_statistic' ) ) {
218
+ $icon = apply_filters( 'sportspress_event_performance_icons', '', $stat->ID, 1 );
219
+ if ( $icon != '' ) {
220
+ $columns[ $stat->post_name ] = apply_filters( 'sportspress_event_performance_icons', '', $stat->ID, 1 );
221
+ }else{
222
+ $columns[ $stat->post_name ] = $stat->post_title;
223
+ }
224
+ }else{
225
+ $columns[ $stat->post_name ] = $stat->post_title;
226
+ }
227
 
228
  // Add format
229
  $format = get_post_meta( $stat->ID, 'sp_format', true );
725
  $labels = array();
726
  if ( in_array( 'number', $this->columns ) ) $labels['number'] = '#';
727
  $labels['name'] = __( 'Player', 'sportspress' );
728
+ if ( in_array( 'team', $this->columns ) ) {
729
+ $labels['team'] = __( 'Team', 'sportspress' );
730
+ }
731
+ if ( in_array( 'position', $this->columns ) ) {
732
+ $labels['position'] = __( 'Position', 'sportspress' );
733
+ }
734
 
735
  $merged[0] = array_merge( $labels, $columns );
736
  return $merged;
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.6.5
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -172,8 +172,17 @@ class SP_Player extends SP_Custom_Post {
172
 
173
  foreach ( $posts as $post ):
174
  if ( -1 === $section ) {
175
- $performance_labels[ $post->post_name ] = $post->post_title;
176
- } else {
 
 
 
 
 
 
 
 
 
177
  $post_section = get_post_meta( $post->ID, 'sp_section', true );
178
 
179
  if ( '' === $post_section ) {
@@ -181,7 +190,16 @@ class SP_Player extends SP_Custom_Post {
181
  }
182
 
183
  if ( $section == $post_section || -1 == $post_section ) {
 
 
 
 
 
 
 
 
184
  $performance_labels[ $post->post_name ] = $post->post_title;
 
185
  }
186
  }
187
 
@@ -554,7 +572,16 @@ class SP_Player extends SP_Custom_Post {
554
 
555
  foreach ( $posts as $post ):
556
  if ( -1 === $section ) {
557
- $stats[ $post->post_name ] = $post->post_title;
 
 
 
 
 
 
 
 
 
558
  } else {
559
  $post_section = get_post_meta( $post->ID, 'sp_section', true );
560
 
@@ -565,16 +592,43 @@ class SP_Player extends SP_Custom_Post {
565
  if ( $admin ) {
566
  if ( 1 == $section ) {
567
  if ( 1 == $post_section ) {
568
- $stats[ $post->post_name ] = $post->post_title;
 
 
 
 
 
 
 
 
 
569
  }
570
  } else {
571
  if ( 1 != $post_section ) {
572
- $stats[ $post->post_name ] = $post->post_title;
 
 
 
 
 
 
 
 
 
573
  }
574
  }
575
  } elseif ( $section == $post_section || -1 == $post_section ) {
 
 
 
 
 
 
 
 
576
  $stats[ $post->post_name ] = $post->post_title;
577
  }
 
578
  }
579
  endforeach;
580
 
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
+ * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
172
 
173
  foreach ( $posts as $post ):
174
  if ( -1 === $section ) {
175
+ if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {
176
+ $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
177
+ if ( $icon != '' ) {
178
+ $performance_labels[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
179
+ }else{
180
+ $performance_labels[ $post->post_name ] = $post->post_title;
181
+ }
182
+ }else{
183
+ $performance_labels[ $post->post_name ] = $post->post_title;
184
+ }
185
+ }else{
186
  $post_section = get_post_meta( $post->ID, 'sp_section', true );
187
 
188
  if ( '' === $post_section ) {
190
  }
191
 
192
  if ( $section == $post_section || -1 == $post_section ) {
193
+ if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {
194
+ $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
195
+ if ( $icon != '' ) {
196
+ $performance_labels[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
197
+ }else{
198
+ $performance_labels[ $post->post_name ] = $post->post_title;
199
+ }
200
+ }else{
201
  $performance_labels[ $post->post_name ] = $post->post_title;
202
+ }
203
  }
204
  }
205
 
572
 
573
  foreach ( $posts as $post ):
574
  if ( -1 === $section ) {
575
+ if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {
576
+ $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
577
+ if ( $icon != '' ) {
578
+ $stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
579
+ }else{
580
+ $stats[ $post->post_name ] = $post->post_title;
581
+ }
582
+ }else{
583
+ $stats[ $post->post_name ] = $post->post_title;
584
+ }
585
  } else {
586
  $post_section = get_post_meta( $post->ID, 'sp_section', true );
587
 
592
  if ( $admin ) {
593
  if ( 1 == $section ) {
594
  if ( 1 == $post_section ) {
595
+ if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {
596
+ $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
597
+ if ( $icon != '' ) {
598
+ $stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
599
+ } else {
600
+ $stats[ $post->post_name ] = $post->post_title;
601
+ }
602
+ } else {
603
+ $stats[ $post->post_name ] = $post->post_title;
604
+ }
605
  }
606
  } else {
607
  if ( 1 != $post_section ) {
608
+ if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {
609
+ $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
610
+ if ( $icon != '' ) {
611
+ $stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
612
+ } else {
613
+ $stats[ $post->post_name ] = $post->post_title;
614
+ }
615
+ } else {
616
+ $stats[ $post->post_name ] = $post->post_title;
617
+ }
618
  }
619
  }
620
  } elseif ( $section == $post_section || -1 == $post_section ) {
621
+ if ( get_option( 'sportspress_player_statistics_mode', 'values' ) == 'icons' ) {
622
+ $icon = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
623
+ if ( $icon != '' ) {
624
+ $stats[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', '', $post->ID, 1 );
625
+ }else{
626
+ $stats[ $post->post_name ] = $post->post_title;
627
+ }
628
+ }else{
629
  $stats[ $post->post_name ] = $post->post_title;
630
  }
631
+ }
632
  }
633
  endforeach;
634
 
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.6.1
13
  * @package SportsPress/Classes
14
  * @category Class
15
  * @author ThemeBoy
@@ -392,6 +392,9 @@ class SP_Post_types {
392
  'search_items' => __( 'Search', 'sportspress' ),
393
  'not_found' => __( 'No results found.', 'sportspress' ),
394
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
 
 
 
395
  ),
396
  'public' => false,
397
  'show_ui' => true,
9
  * Registers post types and taxonomies
10
  *
11
  * @class SP_Post_types
12
+ * @version 2.6.8
13
  * @package SportsPress/Classes
14
  * @category Class
15
  * @author ThemeBoy
392
  'search_items' => __( 'Search', 'sportspress' ),
393
  'not_found' => __( 'No results found.', 'sportspress' ),
394
  'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
395
+ 'set_featured_image' => __( 'Select Icon', 'sportspress' ),
396
+ 'remove_featured_image' => __( 'Remove icon', 'sportspress' ),
397
+ 'use_featured_image' => __( 'Add icon', 'sportspress' ),
398
  ),
399
  'public' => false,
400
  'show_ui' => true,
includes/sp-core-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.6.5
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -1473,10 +1473,12 @@ if ( ! function_exists( 'sp_sort_terms' ) ) {
1473
  * @return int Sorting order.
1474
  */
1475
  function sp_sort_terms( $a, $b ) {
1476
- if ( is_int( $a ) ) {
 
1477
  $a = get_term( $a );
1478
  }
1479
- if ( is_int( $b ) ) {
 
1480
  $b = get_term( $b );
1481
  }
1482
  return get_term_meta( $a->term_id, 'sp_order', true ) > get_term_meta( $b->term_id, 'sp_order', true );
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.6.8
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
1473
  * @return int Sorting order.
1474
  */
1475
  function sp_sort_terms( $a, $b ) {
1476
+ if ( is_numeric( $a ) ) {
1477
+ $a = intval( $a );
1478
  $a = get_term( $a );
1479
  }
1480
+ if ( is_numeric( $b ) ) {
1481
+ $b = intval( $b );
1482
  $b = get_term( $b );
1483
  }
1484
  return get_term_meta( $a->term_id, 'sp_order', true ) > get_term_meta( $b->term_id, 'sp_order', true );
includes/widgets/class-sp-widget-birthdays.php CHANGED
@@ -46,6 +46,7 @@ class SP_Widget_Birthdays extends WP_Widget {
46
  $date = strip_tags($instance['date']);
47
  $options = array(
48
  'day' => __( 'Today', 'sportspress' ),
 
49
  'month' => __( 'This month', 'sportspress' ),
50
  );
51
 
46
  $date = strip_tags($instance['date']);
47
  $options = array(
48
  'day' => __( 'Today', 'sportspress' ),
49
+ 'week' => __( 'This week', 'sportspress' ),
50
  'month' => __( 'This month', 'sportspress' ),
51
  );
52
 
modules/sportspress-calendars.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add event calendars to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.5
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Calendars' ) ) :
17
  * Main SportsPress Calendars Class
18
  *
19
  * @class SportsPress_Calendars
20
- * @version 2.5
21
  */
22
  class SportsPress_Calendars {
23
 
@@ -51,7 +51,7 @@ class SportsPress_Calendars {
51
  */
52
  private function define_constants() {
53
  if ( !defined( 'SP_CALENDARS_VERSION' ) )
54
- define( 'SP_CALENDARS_VERSION', '2.5' );
55
 
56
  if ( !defined( 'SP_CALENDARS_URL' ) )
57
  define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) );
@@ -344,6 +344,14 @@ class SportsPress_Calendars {
344
  'type' => 'checkbox',
345
  'checkboxgroup' => '',
346
  ),
 
 
 
 
 
 
 
 
347
 
348
  array(
349
  'desc' => __( 'Display venue', 'sportspress' ),
5
  Description: Add event calendars to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.8
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Calendars Class
18
  *
19
  * @class SportsPress_Calendars
20
+ * @version 2.6.8
21
  */
22
  class SportsPress_Calendars {
23
 
51
  */
52
  private function define_constants() {
53
  if ( !defined( 'SP_CALENDARS_VERSION' ) )
54
+ define( 'SP_CALENDARS_VERSION', '2.6.8' );
55
 
56
  if ( !defined( 'SP_CALENDARS_URL' ) )
57
  define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) );
344
  'type' => 'checkbox',
345
  'checkboxgroup' => '',
346
  ),
347
+
348
+ array(
349
+ 'desc' => __( 'Display matchday', 'sportspress' ),
350
+ 'id' => 'sportspress_event_blocks_show_matchday',
351
+ 'default' => 'no',
352
+ 'type' => 'checkbox',
353
+ 'checkboxgroup' => '',
354
+ ),
355
 
356
  array(
357
  'desc' => __( 'Display venue', 'sportspress' ),
modules/sportspress-comments-scheduled-events.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: SportsPress Comments on Scheduled Events
4
+ Plugin URI: http://themeboy.com/
5
+ Description: Enable commenting on Scheduled Events.
6
+ Author: Savvas
7
+ Author URI: http://themeboy.com/
8
+ Version: 2.6.8
9
+ */
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) exit;
12
+ if ( ! class_exists( 'SportsPress_Comments_Scheduled_Events' ) ) :
13
+ /**
14
+ * Main SportsPress Comments Scheduled Events Class
15
+ *
16
+ * @class SportsPress_Comments_Scheduled_Events
17
+ * @version 2.6.8
18
+ */
19
+ class SportsPress_Comments_Scheduled_Events {
20
+ /**
21
+ * Constructor
22
+ */
23
+ public function __construct() {
24
+ // Define constants
25
+ $this->define_constants();
26
+
27
+ // Actions
28
+ add_action( 'comment_on_draft', array( $this, 'sp_publish_comment' ) );
29
+
30
+ }
31
+ /**
32
+ * Define constants.
33
+ */
34
+ private function define_constants() {
35
+ if ( !defined( 'SP_COMMENTS_SCHEDULED_EVENTS_VERSION' ) )
36
+ define( 'SP_COMMENTS_SCHEDULED_EVENTS_VERSION', '2.6.8' );
37
+ if ( !defined( 'SP_COMMENTS_SCHEDULED_EVENTS_URL' ) )
38
+ define( 'SP_COMMENTS_SCHEDULED_EVENTS_URL', plugin_dir_url( __FILE__ ) );
39
+ if ( !defined( 'SP_COMMENTS_SCHEDULED_EVENTS_DIR' ) )
40
+ define( 'SP_COMMENTS_SCHEDULED_EVENTS_DIR', plugin_dir_path( __FILE__ ) );
41
+ }
42
+
43
+ /**
44
+ * Save Additional Statistics
45
+ */
46
+ public function sp_publish_comment( $comment_post_ID ) {
47
+
48
+ do_action( 'pre_comment_on_post', $comment_post_ID );
49
+
50
+ $comment_author = ( isset( $_POST['author'] ) ) ? trim( strip_tags( $_POST['author'] ) ) : null;
51
+ $comment_author_email = ( isset( $_POST['email'] ) ) ? sanitize_email ( trim( $_POST['email'] ) ) : null;
52
+ $comment_author_url = ( isset($_POST['url'] ) ) ? esc_url( trim( $_POST['url'] ) ) : null;
53
+ $comment_content = ( isset( $_POST['comment'] ) ) ? esc_textarea( trim( $_POST['comment'] ) ) : null;
54
+
55
+ // If the user is logged in
56
+ $user = wp_get_current_user();
57
+ if ( $user->exists() ) {
58
+ if ( empty( $user->display_name ) ) {
59
+ $user->display_name=$user->user_login;
60
+ }
61
+ $comment_author = $user->display_name;
62
+ $comment_author_email = $user->user_email;
63
+ $comment_author_url = $user->user_url;
64
+ $user_ID = $user->ID;
65
+ if ( current_user_can( 'unfiltered_html' ) ) {
66
+ if ( ! isset( $comment_data['_wp_unfiltered_html_comment'] )
67
+ || ! wp_verify_nonce( $comment_data['_wp_unfiltered_html_comment'], 'unfiltered-html-comment_' . $comment_post_ID )
68
+ ) {
69
+ kses_remove_filters(); // start with a clean slate
70
+ kses_init_filters(); // set up the filters
71
+ }
72
+ }
73
+ } else {
74
+ if ( get_option( 'comment_registration' ) ) {
75
+ return new WP_Error( 'not_logged_in', __( 'Sorry, you must be logged in to comment.' ), 403 );
76
+ }
77
+ }
78
+
79
+ $comment_type = '';
80
+
81
+ if ( get_option( 'require_name_email' ) && ! $user->exists() ) {
82
+ if ( '' == $comment_author_email || '' == $comment_author ) {
83
+ //return new WP_Error( 'require_name_email', __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 );
84
+ wp_die( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), __( 'ERROR: please fill the required fields (name, email).' ), array ( 'back_link' => true ) );
85
+ } elseif ( ! is_email( $comment_author_email ) ) {
86
+ //return new WP_Error( 'require_valid_email', __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 );
87
+ wp_die( __( '<strong>ERROR</strong>: please enter a valid email address.' ), __( 'ERROR: please enter a valid email address.' ), array ( 'back_link' => true ) );
88
+ }
89
+ }
90
+
91
+ if ( '' == $comment_content ) {
92
+ //return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 );
93
+ wp_die( __( '<strong>ERROR</strong>: please type a comment.' ), __( 'ERROR: please type a comment.' ), array ( 'back_link' => true ) );
94
+ }
95
+
96
+ $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;
97
+
98
+ $commentdata = compact(
99
+ 'comment_post_ID',
100
+ 'comment_author',
101
+ 'comment_author_email',
102
+ 'comment_author_url',
103
+ 'comment_content',
104
+ 'comment_type',
105
+ 'comment_parent',
106
+ 'user_ID'
107
+ );
108
+
109
+ $check_max_lengths = wp_check_comment_data_max_lengths( $commentdata );
110
+ if ( is_wp_error( $check_max_lengths ) ) {
111
+ return $check_max_lengths;
112
+ }
113
+
114
+ $comment_id = wp_new_comment( wp_slash( $commentdata ), true );
115
+ if ( is_wp_error( $comment_id ) ) {
116
+ return $comment_id;
117
+ }
118
+
119
+ if ( ! $comment_id ) {
120
+ //return new WP_Error( 'comment_save_error', __( '<strong>ERROR</strong>: The comment could not be saved. Please try again later.' ), 500 );
121
+ wp_die( __( '<strong>ERROR</strong>: The comment could not be saved. Please try again later.' ), __( 'ERROR: The comment could not be saved. Please try again later.' ), array ( 'back_link' => true ) );
122
+ }
123
+
124
+ $comment = get_comment( $comment_id );
125
+
126
+ do_action( 'set_comment_cookies', $comment, $user );
127
+
128
+ if ( $user->exists() ) {
129
+ wp_set_comment_status( $comment_id, 'approve' );
130
+ }
131
+
132
+ $location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id;
133
+
134
+ $location = apply_filters( 'comment_post_redirect', $location, $comment );
135
+
136
+ wp_safe_redirect( $location );
137
+ exit;
138
+ }
139
+
140
+
141
+ }
142
+ endif;
143
+
144
+ new SportsPress_Comments_Scheduled_Events();
modules/sportspress-icons.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add vector performance icons to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.5.2
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Icons' ) ) :
17
  * Main SportsPress Icons Class
18
  *
19
  * @class SportsPress_Icons
20
- * @version 2.5.2
21
  */
22
  class SportsPress_Icons {
23
 
@@ -41,6 +41,7 @@ class SportsPress_Icons {
41
  add_filter( 'sportspress_event_performance_icons', array( $this, 'replace_icons' ), 10, 3 );
42
  add_filter( 'admin_post_thumbnail_html', array( $this, 'admin_post_thumbnail_html' ), 10, 2 );
43
  add_action( 'sportspress_process_sp_performance_meta', array( $this, 'save' ), 10, 2 );
 
44
  }
45
 
46
  /**
@@ -48,7 +49,7 @@ class SportsPress_Icons {
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_ICONS_VERSION' ) )
51
- define( 'SP_ICONS_VERSION', '2.5.2' );
52
 
53
  if ( !defined( 'SP_ICONS_URL' ) )
54
  define( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) );
@@ -91,6 +92,12 @@ class SportsPress_Icons {
91
  'racing-flag',
92
  'shoe',
93
  'card',
 
 
 
 
 
 
94
  'sub',
95
  'update',
96
  'undo',
@@ -143,7 +150,7 @@ class SportsPress_Icons {
143
 
144
  // Bypass if not performance post type
145
  $post_type = get_post_type( $id );
146
- if ( 'sp_performance' !== $post_type ) return $content;
147
 
148
  // Detect if image uploaded
149
  $is_uploaded = isset( $_POST['thumbnail_id'] );
5
  Description: Add vector performance icons to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.8
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Icons Class
18
  *
19
  * @class SportsPress_Icons
20
+ * @version 2.6.8
21
  */
22
  class SportsPress_Icons {
23
 
41
  add_filter( 'sportspress_event_performance_icons', array( $this, 'replace_icons' ), 10, 3 );
42
  add_filter( 'admin_post_thumbnail_html', array( $this, 'admin_post_thumbnail_html' ), 10, 2 );
43
  add_action( 'sportspress_process_sp_performance_meta', array( $this, 'save' ), 10, 2 );
44
+ add_action( 'sportspress_process_sp_statistic_meta', array( $this, 'save' ), 10, 2 );
45
  }
46
 
47
  /**
49
  */
50
  private function define_constants() {
51
  if ( !defined( 'SP_ICONS_VERSION' ) )
52
+ define( 'SP_ICONS_VERSION', '2.6.8' );
53
 
54
  if ( !defined( 'SP_ICONS_URL' ) )
55
  define( 'SP_ICONS_URL', plugin_dir_url( __FILE__ ) );
92
  'racing-flag',
93
  'shoe',
94
  'card',
95
+ 'league',
96
+ 'shield',
97
+ 'tshirt',
98
+ 'whistle',
99
+ 'time',
100
+ 'friendly',
101
  'sub',
102
  'update',
103
  'undo',
150
 
151
  // Bypass if not performance post type
152
  $post_type = get_post_type( $id );
153
+ if ( 'sp_performance' !== $post_type && 'sp_statistic' !== $post_type ) return $content;
154
 
155
  // Detect if image uploaded
156
  $is_uploaded = isset( $_POST['thumbnail_id'] );
modules/sportspress-player-assignments.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add player assignments support to SportsPress.
6
  Author: Savvas
7
  Author URI: http://themeboy.com/
8
- Version: 2.6.2
9
  */
10
  // Exit if accessed directly
11
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -14,7 +14,7 @@ if ( ! class_exists( 'SportsPress_Player_Assignments' ) ) :
14
  * Main SportsPress Player Assignments Class
15
  *
16
  * @class SportsPress_Player_Assignments
17
- * @version 2.6.2
18
  */
19
  class SportsPress_Player_Assignments {
20
  /**
@@ -36,7 +36,7 @@ class SportsPress_Player_Assignments {
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_VERSION' ) )
39
- define( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.6.2' );
40
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_URL' ) )
41
  define( 'SP_PLAYER_ASSIGNMENTS_URL', plugin_dir_url( __FILE__ ) );
42
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_DIR' ) )
@@ -106,32 +106,77 @@ class SportsPress_Player_Assignments {
106
  if ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) $season_ids = sp_array_value( $param, 'terms', array() );
107
  }
108
 
109
- if ( empty( $league_ids ) || empty( $season_ids ) ) return $players;
110
 
111
  $assignments = array();
112
- foreach ( $league_ids as $l_id ) {
 
 
 
 
 
 
 
 
 
 
 
 
113
  foreach ( $season_ids as $s_id ) {
114
  if ( $team && $team != '0' ) {
115
- $assignments[] = $l_id.'_'.$s_id.'_'.$team;
 
 
 
 
 
 
 
 
 
 
116
  }
117
  }
118
  }
119
 
120
  if ( sizeof( $assignments ) ) {
121
- $args['meta_query'] = array(
122
- 'relation' => 'AND',
123
-
124
- array(
125
- 'key' => 'sp_assignments',
126
- 'value' => $assignments,
127
- 'compare' => 'IN',
128
- ),
129
-
130
- array(
131
- 'key' => $team_key,
132
- 'value' => $team,
133
- ),
134
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
 
137
  $assigned_players = (array) get_posts( $args );
5
  Description: Add player assignments support to SportsPress.
6
  Author: Savvas
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.8
9
  */
10
  // Exit if accessed directly
11
  if ( ! defined( 'ABSPATH' ) ) exit;
14
  * Main SportsPress Player Assignments Class
15
  *
16
  * @class SportsPress_Player_Assignments
17
+ * @version 2.6.8
18
  */
19
  class SportsPress_Player_Assignments {
20
  /**
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_VERSION' ) )
39
+ define( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.6.8' );
40
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_URL' ) )
41
  define( 'SP_PLAYER_ASSIGNMENTS_URL', plugin_dir_url( __FILE__ ) );
42
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_DIR' ) )
106
  if ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) $season_ids = sp_array_value( $param, 'terms', array() );
107
  }
108
 
109
+ if ( empty( $league_ids ) && empty( $season_ids ) ) return $players;
110
 
111
  $assignments = array();
112
+
113
+ if ( !empty( $league_ids ) && !empty( $season_ids ) ) {
114
+ foreach ( $league_ids as $l_id ) {
115
+ foreach ( $season_ids as $s_id ) {
116
+ if ( $team && $team != '0' ) {
117
+ $assignments[] = $l_id.'_'.$s_id.'_'.$team;
118
+ $compare = 'IN';
119
+ }
120
+ }
121
+ }
122
+ }
123
+
124
+ if ( empty( $league_ids ) && !empty( $season_ids ) ) {
125
  foreach ( $season_ids as $s_id ) {
126
  if ( $team && $team != '0' ) {
127
+ $assignments[] = '_'.$s_id.'_'.$team;
128
+ $compare = 'LIKE';
129
+ }
130
+ }
131
+ }
132
+
133
+ if ( !empty( $league_ids ) && empty( $season_ids ) ) {
134
+ foreach ( $league_ids as $l_id ) {
135
+ if ( $team && $team != '0' ) {
136
+ $assignments[] = $l_id.'_%_'.$team;
137
+ $compare = 'LIKE';
138
  }
139
  }
140
  }
141
 
142
  if ( sizeof( $assignments ) ) {
143
+ if ( 'IN' == $compare ) {
144
+ $args['meta_query'] = array(
145
+ 'relation' => 'AND',
146
+
147
+ array(
148
+ 'key' => 'sp_assignments',
149
+ 'value' => $assignments,
150
+ 'compare' => $compare,
151
+ ),
152
+
153
+ array(
154
+ 'key' => $team_key,
155
+ 'value' => $team,
156
+ ),
157
+ );
158
+ }
159
+ if ( 'LIKE' == $compare ) {
160
+ $args['meta_query'] = array(
161
+ 'relation' => 'AND',
162
+
163
+ array(
164
+ 'key' => $team_key,
165
+ 'value' => $team,
166
+ ),
167
+
168
+ array(
169
+ 'relation' => 'OR',
170
+ ),
171
+ );
172
+ foreach( $assignments as $assignment ) {
173
+ $args['meta_query'][1][] = array(
174
+ 'key' => 'sp_assignments',
175
+ 'value' => $assignment,
176
+ 'compare' => $compare,
177
+ );
178
+ }
179
+ }
180
  }
181
 
182
  $assigned_players = (array) get_posts( $args );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: calendars, club, club management, esports, events, fixtures, leagues, leag
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
- Stable tag: 2.6.7
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -237,6 +237,18 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
237
 
238
  == Changelog ==
239
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  = 2.6.7 =
241
  * Fix - Update Google Maps API endpoints.
242
 
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
+ Stable tag: 2.6.8
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
237
 
238
  == Changelog ==
239
 
240
+ = 2.6.8 =
241
+ * Feature - Ability to add icons to player statistics.
242
+ * Feature - Ability to display matchday in event blocks.
243
+ * Feature - Add support for commenting on scheduled events.
244
+ * Feature - Option to filter birthdays widget by week.
245
+ * Feature - Option to filter events by competitive or friendly.
246
+ * Tweak - Display pin in venue map and link map to web version.
247
+ * Tweak - Add UK as alternate to GB in countries legacy list.
248
+ * Tweak - Remove duplicate teams from players.
249
+ * Tweak - Improve player assignment filtering for player lists.
250
+ * Fix - Animated countdowns when visitor and site are in a different timezones.
251
+
252
  = 2.6.7 =
253
  * Fix - Update Google Maps API endpoints.
254
 
sportspress.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
- * Version: 2.6.7
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
- * @version 2.6.7
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.6.7';
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.6.8
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
+ * @version 2.6.8
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.6.8';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
templates/birthdays.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress_Birthdays
7
- * @version 1.9.19
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -37,6 +37,45 @@ if ( $date == 'day' ) {
37
  $args['day'] = date('j');
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  $posts = get_posts( $args );
41
 
42
  foreach ( $posts as $post ) {
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress_Birthdays
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
37
  $args['day'] = date('j');
38
  }
39
 
40
+ if ( $date == 'week' ) {
41
+ unset ( $args['monthnum'] );
42
+ $args['date_query'] = array(
43
+ array(
44
+ 'month' => date('n'),
45
+ 'day' => date('j'),
46
+ ),
47
+ array(
48
+ 'month' => date( "n", strtotime( "+1 day" ) ),
49
+ 'day' => date( "j", strtotime( "+1 day" ) ),
50
+ ),
51
+ array(
52
+ 'month' => date( "n", strtotime( "+2 days" ) ),
53
+ 'day' => date( "j", strtotime( "+2 days" ) ),
54
+ ),
55
+ array(
56
+ 'month' => date( "n", strtotime( "+3 days" ) ),
57
+ 'day' => date( "j", strtotime( "+3 days" ) ),
58
+ ),
59
+ array(
60
+ 'month' => date( "n", strtotime( "+4 days" ) ),
61
+ 'day' => date( "j", strtotime( "+4 days" ) ),
62
+ ),
63
+ array(
64
+ 'month' => date( "n", strtotime( "+5 days" ) ),
65
+ 'day' => date( "j", strtotime( "+5 days" ) ),
66
+ ),
67
+ array(
68
+ 'month' => date( "n", strtotime( "+6 days" ) ),
69
+ 'day' => date( "j", strtotime( "+6 days" ) ),
70
+ ),
71
+ array(
72
+ 'month' => date( "n", strtotime( "+1 week" ) ),
73
+ 'day' => date( "j", strtotime( "+1 week" ) ),
74
+ ),
75
+ 'relation' => 'OR',
76
+ );
77
+ }
78
+
79
  $posts = get_posts( $args );
80
 
81
  foreach ( $posts as $post ) {
templates/countdown.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -149,7 +149,7 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
149
  $s = $interval->invert ? 0 : $interval->s;
150
  ?>
151
  <p class="countdown sp-countdown<?php if ( $days >= 10 ): ?> long-countdown<?php endif; ?>">
152
- <time datetime="<?php echo $post->post_date; ?>"<?php if ( $live ): ?> data-countdown="<?php echo str_replace( '-', '/', $post->post_date ); ?>"<?php endif; ?>>
153
  <span><?php echo sprintf( '%02s', $days ); ?> <small><?php _e( 'days', 'sportspress' ); ?></small></span>
154
  <span><?php echo sprintf( '%02s', $h ); ?> <small><?php _e( 'hrs', 'sportspress' ); ?></small></span>
155
  <span><?php echo sprintf( '%02s', $i ); ?> <small><?php _e( 'mins', 'sportspress' ); ?></small></span>
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
149
  $s = $interval->invert ? 0 : $interval->s;
150
  ?>
151
  <p class="countdown sp-countdown<?php if ( $days >= 10 ): ?> long-countdown<?php endif; ?>">
152
+ <time datetime="<?php echo $post->post_date; ?>"<?php if ( $live ): ?> data-countdown="<?php echo str_replace( '-', '/', get_gmt_from_date( $post->post_date ) ); ?>"<?php endif; ?>>
153
  <span><?php echo sprintf( '%02s', $days ); ?> <small><?php _e( 'days', 'sportspress' ); ?></small></span>
154
  <span><?php echo sprintf( '%02s', $h ); ?> <small><?php _e( 'hrs', 'sportspress' ); ?></small></span>
155
  <span><?php echo sprintf( '%02s', $i ); ?> <small><?php _e( 'mins', 'sportspress' ); ?></small></span>
templates/event-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.5.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -14,6 +14,7 @@ $defaults = array(
14
  'event' => null,
15
  'title' => false,
16
  'status' => 'default',
 
17
  'date' => 'default',
18
  'date_from' => 'default',
19
  'date_to' => 'default',
@@ -38,6 +39,7 @@ $defaults = array(
38
  'show_title' => get_option( 'sportspress_event_blocks_show_title', 'no' ) == 'yes' ? true : false,
39
  'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false,
40
  'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false,
 
41
  'show_venue' => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false,
42
  'hide_if_empty' => false,
43
  );
@@ -47,6 +49,8 @@ extract( $defaults, EXTR_SKIP );
47
  $calendar = new SP_Calendar( $id );
48
  if ( $status != 'default' )
49
  $calendar->status = $status;
 
 
50
  if ( $date != 'default' )
51
  $calendar->date = $date;
52
  if ( $date_from != 'default' )
@@ -149,6 +153,9 @@ if ( $title )
149
  <time class="sp-event-date" datetime="<?php echo $event->post_date; ?>" itemprop="startDate" content="<?php echo mysql2date( 'Y-m-d\TH:iP', $event->post_date ); ?>">
150
  <?php echo sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ); ?>
151
  </time>
 
 
 
152
  <h5 class="sp-event-results">
153
  <?php echo sp_add_link( '<span class="sp-result">' . implode( '</span> - <span class="sp-result">', apply_filters( 'sportspress_event_blocks_team_result_or_time', sp_get_main_results_or_time( $event ), $event->ID ) ) . '</span>', $permalink, $link_events ); ?>
154
  </h5>
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
  'event' => null,
15
  'title' => false,
16
  'status' => 'default',
17
+ 'format' => 'all',
18
  'date' => 'default',
19
  'date_from' => 'default',
20
  'date_to' => 'default',
39
  'show_title' => get_option( 'sportspress_event_blocks_show_title', 'no' ) == 'yes' ? true : false,
40
  'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false,
41
  'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false,
42
+ 'show_matchday' => get_option( 'sportspress_event_blocks_show_matchday', 'no' ) == 'yes' ? true : false,
43
  'show_venue' => get_option( 'sportspress_event_blocks_show_venue', 'no' ) == 'yes' ? true : false,
44
  'hide_if_empty' => false,
45
  );
49
  $calendar = new SP_Calendar( $id );
50
  if ( $status != 'default' )
51
  $calendar->status = $status;
52
+ if ( $format != 'all' )
53
+ $calendar->event_format = $format;
54
  if ( $date != 'default' )
55
  $calendar->date = $date;
56
  if ( $date_from != 'default' )
153
  <time class="sp-event-date" datetime="<?php echo $event->post_date; ?>" itemprop="startDate" content="<?php echo mysql2date( 'Y-m-d\TH:iP', $event->post_date ); ?>">
154
  <?php echo sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ); ?>
155
  </time>
156
+ <?php if ( $show_matchday ): $matchday = get_post_meta( $event->ID, 'sp_day', true ); if ( $matchday != '' ): ?>
157
+ <div class="sp-event-matchday">(<?php echo $matchday; ?>)</div>
158
+ <?php endif; endif; ?>
159
  <h5 class="sp-event-results">
160
  <?php echo sp_add_link( '<span class="sp-result">' . implode( '</span> - <span class="sp-result">', apply_filters( 'sportspress_event_blocks_team_result_or_time', sp_get_main_results_or_time( $event ), $event->ID ) ) . '</span>', $permalink, $link_events ); ?>
161
  </h5>
templates/event-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -13,6 +13,7 @@ $defaults = array(
13
  'id' => null,
14
  'title' => false,
15
  'status' => 'default',
 
16
  'date' => 'default',
17
  'date_from' => 'default',
18
  'date_to' => 'default',
@@ -48,6 +49,8 @@ extract( $defaults, EXTR_SKIP );
48
  $calendar = new SP_Calendar( $id );
49
  if ( $status != 'default' )
50
  $calendar->status = $status;
 
 
51
  if ( $date != 'default' )
52
  $calendar->date = $date;
53
  if ( $date_from != 'default' )
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
  'id' => null,
14
  'title' => false,
15
  'status' => 'default',
16
+ 'format' => 'all',
17
  'date' => 'default',
18
  'date_from' => 'default',
19
  'date_to' => 'default',
49
  $calendar = new SP_Calendar( $id );
50
  if ( $status != 'default' )
51
  $calendar->status = $status;
52
+ if ( $format != 'all' )
53
+ $calendar->event_format = $format;
54
  if ( $date != 'default' )
55
  $calendar->date = $date;
56
  if ( $date_from != 'default' )
templates/player-details.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -71,7 +71,7 @@ endif;
71
  $data = array_merge( $metrics_before, $common, $metrics_after );
72
 
73
  if ( $show_current_teams ):
74
- $current_teams = $player->current_teams();
75
  if ( $current_teams ):
76
  $teams = array();
77
  foreach ( $current_teams as $team ):
@@ -84,7 +84,7 @@ if ( $show_current_teams ):
84
  endif;
85
 
86
  if ( $show_past_teams ):
87
- $past_teams = $player->past_teams();
88
  if ( $past_teams ):
89
  $teams = array();
90
  foreach ( $past_teams as $team ):
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
71
  $data = array_merge( $metrics_before, $common, $metrics_after );
72
 
73
  if ( $show_current_teams ):
74
+ $current_teams = array_filter( $player->current_teams() );
75
  if ( $current_teams ):
76
  $teams = array();
77
  foreach ( $current_teams as $team ):
84
  endif;
85
 
86
  if ( $show_past_teams ):
87
+ $past_teams = array_filter( $player->past_teams() );
88
  if ( $past_teams ):
89
  $teams = array();
90
  foreach ( $past_teams as $team ):
templates/player-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -53,7 +53,7 @@ if ( isset( $columns ) && null !== $columns ):
53
  endif;
54
  $data = $list->data();
55
 
56
- // The first row should be column labels
57
  $labels = $data[0];
58
 
59
  //Create a unique identifier based on the current time in microseconds
@@ -62,7 +62,7 @@ $identifier = uniqid( 'playerlist_' );
62
  if ( true == $responsive ){
63
  //sportspress_responsive_tables_css( $identifier );
64
  }
65
- // Remove the first row to leave us with the actual data
66
  unset( $data[0] );
67
 
68
  if ( $grouping === null || $grouping === 'default' ):
@@ -122,6 +122,25 @@ foreach ( $groups as $group ):
122
  if ( intval( $number ) > 0 )
123
  $limit = $number;
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  $tbody = '';
126
 
127
  foreach( $data as $player_id => $row ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
@@ -213,22 +232,9 @@ foreach ( $groups as $group ):
213
  endif;
214
 
215
  $output .= '<div class="sp-table-wrapper">' .
216
- '<table class="sp-player-list sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ). ( $responsive ? ' sp-responsive-table '.$identifier : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
217
-
218
- if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ):
219
- if ( in_array( $orderby, array( 'number', 'name' ) ) ):
220
- $output .= '<th class="data-number">#</th>';
221
- else:
222
- $output .= '<th class="data-rank">' . __( 'Rank', 'sportspress' ) . '</th>';
223
- endif;
224
- endif;
225
-
226
- foreach( $labels as $key => $label ):
227
- if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) )
228
- $output .= '<th class="data-' . $key . '">'. $label . '</th>';
229
- endforeach;
230
-
231
- $output .= '</tr>' . '</thead>' . '<tbody>';
232
 
233
  $output .= $tbody;
234
 
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
53
  endif;
54
  $data = $list->data();
55
 
56
+ // The first row should be labels
57
  $labels = $data[0];
58
 
59
  //Create a unique identifier based on the current time in microseconds
62
  if ( true == $responsive ){
63
  //sportspress_responsive_tables_css( $identifier );
64
  }
65
+ // Remove the first row and 'head' row to leave us with the actual data
66
  unset( $data[0] );
67
 
68
  if ( $grouping === null || $grouping === 'default' ):
122
  if ( intval( $number ) > 0 )
123
  $limit = $number;
124
 
125
+ $thead = '<thead>' . '<tr>';
126
+
127
+ if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ):
128
+ if ( in_array( $orderby, array( 'number', 'name' ) ) ):
129
+ $thead .= '<th class="data-number">#</th>';
130
+ else:
131
+ $thead .= '<th class="data-rank">' . __( 'Rank', 'sportspress' ) . '</th>';
132
+ endif;
133
+ endif;
134
+
135
+ foreach( $labels as $key => $label ):
136
+ if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) )
137
+ $thead .= '<th class="data-' . $key . '">'. $label . '</th>';
138
+ if ( preg_match ( "/title=\"(.*?)\"/", $label, $new_label ) )
139
+ $labels[$key] = $label[1];
140
+ endforeach;
141
+
142
+ $thead .= '</tr>' . '</thead>';
143
+
144
  $tbody = '';
145
 
146
  foreach( $data as $player_id => $row ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
232
  endif;
233
 
234
  $output .= '<div class="sp-table-wrapper">' .
235
+ '<table class="sp-player-list sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ). ( $responsive ? ' sp-responsive-table '.$identifier : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">';
236
+
237
+ $output .= $thead . '<tbody>';
 
 
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  $output .= $tbody;
240
 
templates/player-selector.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -54,6 +54,8 @@ if ( $team ):
54
  );
55
  endif;
56
 
 
 
57
  $players = get_posts( $args );
58
 
59
  $options = array();
@@ -77,4 +79,4 @@ if ( sizeof( $options ) > 1 ):
77
  </select>
78
  </div>
79
  <?php
80
- endif;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
54
  );
55
  endif;
56
 
57
+ $args = apply_filters( 'sportspress_players_selector_args', $args );
58
+
59
  $players = get_posts( $args );
60
 
61
  $options = array();
79
  </select>
80
  </div>
81
  <?php
82
+ endif;
templates/venue-map.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.7
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -25,12 +25,15 @@ if ( 'satellite' !== $maptype ) $maptype = 'roadmap';
25
 
26
  if ( $latitude != null && $longitude != null ):
27
  ?>
28
- <iframe
29
- class="sp-google-map<?php if ( is_tax( 'sp_venue' ) ): ?> sp-venue-map<?php endif; ?>"
30
- width="600"
31
- height="320"
32
- frameborder="0" style="border:0"
33
- src="//tboy.co/maps_embed?q=<?php echo $address; ?>&amp;center=<?php echo $latitude; ?>,<?php echo $longitude; ?>&amp;zoom=<?php echo $zoom; ?>&amp;maptype=<?php echo $maptype; ?>" allowfullscreen>
34
- </iframe>
 
 
 
35
  <?php
36
  endif;
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
25
 
26
  if ( $latitude != null && $longitude != null ):
27
  ?>
28
+ <div class="sp-google-map-container">
29
+ <iframe
30
+ class="sp-google-map<?php if ( is_tax( 'sp_venue' ) ): ?> sp-venue-map<?php endif; ?>"
31
+ width="600"
32
+ height="320"
33
+ frameborder="0" style="border:0"
34
+ src="//tboy.co/maps_embed?q=<?php echo $address; ?>&amp;center=<?php echo $latitude; ?>,<?php echo $longitude; ?>&amp;zoom=<?php echo $zoom; ?>&amp;maptype=<?php echo $maptype; ?>" allowfullscreen>
35
+ </iframe>
36
+ <a href="https://www.google.com.au/maps/place/<?php echo $address; ?>/@<?php echo $latitude; ?>,<?php echo $longitude; ?>,<?php echo $zoom; ?>z" target="_blank" class="sp-google-map-link"></a>
37
+ </div>
38
  <?php
39
  endif;