Changeset 2280658
- Timestamp:
- 04/10/2020 04:34:47 AM (6 years ago)
- Location:
- sportspress
- Files:
-
- 38 edited
- 1 copied
-
tags/2.7.1 (copied) (copied from sportspress/trunk)
-
tags/2.7.1/assets/js/sportspress.js (modified) (1 diff)
-
tags/2.7.1/changelog.txt (modified) (1 diff)
-
tags/2.7.1/includes/admin/importers/class-sp-event-importer.php (modified) (2 diffs)
-
tags/2.7.1/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php (modified) (2 diffs)
-
tags/2.7.1/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php (modified) (5 diffs)
-
tags/2.7.1/includes/class-sp-player-list.php (modified) (10 diffs)
-
tags/2.7.1/includes/class-sp-post-types.php (modified) (2 diffs)
-
tags/2.7.1/includes/class-sp-team.php (modified) (2 diffs)
-
tags/2.7.1/modules/sportspress-birthdays.php (modified) (5 diffs)
-
tags/2.7.1/readme.txt (modified) (2 diffs)
-
tags/2.7.1/sportspress.php (modified) (3 diffs)
-
tags/2.7.1/templates/countdown.php (modified) (3 diffs)
-
tags/2.7.1/templates/event-calendar.php (modified) (2 diffs)
-
tags/2.7.1/templates/event-list.php (modified) (2 diffs)
-
tags/2.7.1/templates/event-logos-block.php (modified) (2 diffs)
-
tags/2.7.1/templates/event-results.php (modified) (2 diffs)
-
tags/2.7.1/templates/event-venue.php (modified) (2 diffs)
-
tags/2.7.1/templates/player-list.php (modified) (2 diffs)
-
tags/2.7.1/templates/team-details.php (modified) (2 diffs)
-
trunk/assets/js/sportspress.js (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/includes/admin/importers/class-sp-event-importer.php (modified) (2 diffs)
-
trunk/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php (modified) (2 diffs)
-
trunk/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php (modified) (5 diffs)
-
trunk/includes/class-sp-player-list.php (modified) (10 diffs)
-
trunk/includes/class-sp-post-types.php (modified) (2 diffs)
-
trunk/includes/class-sp-team.php (modified) (2 diffs)
-
trunk/modules/sportspress-birthdays.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sportspress.php (modified) (3 diffs)
-
trunk/templates/countdown.php (modified) (3 diffs)
-
trunk/templates/event-calendar.php (modified) (2 diffs)
-
trunk/templates/event-list.php (modified) (2 diffs)
-
trunk/templates/event-logos-block.php (modified) (2 diffs)
-
trunk/templates/event-results.php (modified) (2 diffs)
-
trunk/templates/event-venue.php (modified) (2 diffs)
-
trunk/templates/player-list.php (modified) (2 diffs)
-
trunk/templates/team-details.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sportspress/tags/2.7.1/assets/js/sportspress.js
r2098952 r2280658 11 11 12 12 /* Header */ 13 if ( ! $('.sp-header'). size()) {13 if ( ! $('.sp-header').length ) { 14 14 $('body').prepend( '<div class="sp-header sp-header-loaded"></div>' ); 15 15 } -
sportspress/tags/2.7.1/changelog.txt
r2266710 r2280658 1 1 == SportsPress Changelog == 2 3 = 2.7.1 = 4 * Feature - Enable player list filtering by nationality. 5 * Feature - Add option to display date of birth in player lists. 6 * Tweak - Exclude postponed and canceled events from countdowns. 7 * Tweak - Apply reverse order option to event results. 8 * Tweak - When a team has more than one home venue, separate with commas. 9 * Fix - Venue address containing pluses in events. 10 * Fix - Event blocks showing the wrong dates when embedded within other event pages. 11 * Fix - Statistics not adding manual values when not based on equations. 12 * Fix - Event lists ignoring the format parameter. 13 * Fix - League table order when displaying multiple tables in team profiles. 14 * Fix - Error when deleting configuration columns. 15 * Fix - Player lists not including past players in some cases. 16 * Fix - Prevent error when viewing event calendar in some cases. 2 17 3 18 = 2.7 = -
sportspress/tags/2.7.1/includes/admin/importers/class-sp-event-importer.php
r1768064 r2280658 6 6 * @category Admin 7 7 * @package SportsPress/Admin/Importers 8 * @version 2. 58 * @version 2.7.1 9 9 */ 10 10 … … 473 473 <fieldset id="post-formats-select"> 474 474 <ul> 475 <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> 476 <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> 477 <br> 475 <?php 476 foreach( (new SP_Formats)->event as $name => $title ) { 477 ?> 478 <li><input type="radio" name="sp_format" class="post-format" id="post-format-<?php echo $name; ?>" value="<?php echo $name; ?>" checked="checked"> <label for="post-format-<?php echo $name; ?>" class="post-format-icon post-format-<?php echo $name; ?>"><?php echo $title; ?></label></li> 479 <?php 480 } 481 ?> 482 </ul> 478 483 </fieldset> 479 484 </td> -
sportspress/tags/2.7.1/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php
r1493758 r2280658 6 6 * @category Admin 7 7 * @package SportsPress/Admin/Meta_Boxes 8 * @version 2. 18 * @version 2.7.1 9 9 */ 10 10 … … 49 49 </label> 50 50 </li> 51 <?php do_action( 'sportspress_list_general_columns', $selected ); ?> 51 52 </ul> 52 53 <p><strong><?php _e( 'Data', 'sportspress' ); ?></strong></p> -
sportspress/tags/2.7.1/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php
r1807715 r2280658 6 6 * @category Admin 7 7 * @package SportsPress/Admin/Meta_Boxes 8 * @version 2. 5.58 * @version 2.7.1 9 9 */ 10 10 … … 35 35 $date_past = get_post_meta( $post->ID, 'sp_date_past', true ); 36 36 $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true ); 37 $continents = SP()->countries->continents; 38 $nationalities = get_post_meta( $post->ID, 'sp_nationality', false ); 39 $default_nationality = get_option( 'sportspress_default_nationality' , false ); 37 40 ?> 38 41 <div> … … 99 102 </select> 100 103 </p> 104 <p><strong><?php _e( 'Nationality', 'sportspress' ); ?></strong></p> 105 <p> 106 <select id="sp_nationality" name="sp_nationality[]" data-placeholder="<?php printf( __( 'Select %s', 'sportspress' ), __( 'Nationality', 'sportspress' ) ); ?>" class="widefat chosen-select<?php if ( is_rtl() ): ?> chosen-rtl<?php endif; ?>" multiple="multiple"> 107 <option value=""></option> 108 <?php foreach ( $continents as $continent => $countries ): ?> 109 <optgroup label="<?php echo $continent; ?>"> 110 <?php foreach ( $countries as $code => $country ): ?> 111 <option value="<?php echo $code; ?>" <?php selected ( in_array( $code, $nationalities ) ); ?>><?php echo $country; ?></option> 112 <?php endforeach; ?> 113 </optgroup> 114 <?php endforeach; ?> 115 </select> 116 </p> 101 117 <p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p> 102 118 <p> … … 144 160 <?php 145 161 if ( 'manual' == $select ) { 146 sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) ); 162 $player_filters = array( 'sp_league', 'sp_season' ); 163 if ( $team_id ) { 164 if ( in_array( $era, [ 'all', 'past' ] ) ) { 165 $player_filters[] = 'sp_past_team'; 166 } 167 if ( in_array( $era, [ 'all', 'current' ] ) ) { 168 $player_filters[] = 'sp_current_team'; 169 } 170 } 171 sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), $player_filters ); 147 172 sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) ); 148 173 } else { … … 179 204 update_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', array() ) ); 180 205 sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) ); 206 sp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array() ) ); 181 207 } 182 208 } -
sportspress/tags/2.7.1/includes/class-sp-player-list.php
r2266710 r2280658 6 6 * 7 7 * @class SP_Player_List 8 * @version 2.7 8 * @version 2.7.1 9 9 * @package SportsPress/Classes 10 10 * @category Class … … 60 60 $order = get_post_meta( $this->ID, 'sp_order', true ); 61 61 $select = get_post_meta( $this->ID, 'sp_select', true ); 62 $nationalities = get_post_meta( $this->ID, 'sp_nationality', false ); 62 63 63 64 $this->date = $this->__get( 'date' ); … … 109 110 'order' => 'ASC', 110 111 'tax_query' => array( 112 'relation' => 'AND', 113 ), 114 'meta_query' => array( 111 115 'relation' => 'AND', 112 116 ), … … 139 143 break; 140 144 endswitch; 141 $args['meta_query'] = array(145 $args['meta_query'][] = array( 142 146 array( 143 147 'key' => $team_key, … … 152 156 'field' => 'term_id', 153 157 'terms' => $position_ids 158 ); 159 endif; 160 161 if ( $nationalities ): 162 $args['meta_query'][] = array( 163 array( 164 'key' => 'sp_nationality', 165 'value' => $nationalities, 166 'compare' => 'IN' 167 ), 154 168 ); 155 169 endif; … … 393 407 $timeline = (array)get_post_meta( $event->ID, 'sp_timeline', true ); 394 408 $minutes = get_post_meta( $event->ID, 'sp_minutes', true ); 409 $showdob = get_option( 'sportspress_player_show_birthday', 'no' ); 410 $showage = get_option( 'sportspress_player_show_age', 'no' ); 395 411 if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 ); 396 412 … … 598 614 endif; 599 615 600 if ( $placeholder !== '' && is_numeric( $placeholder ) ): 601 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder; 602 else: 603 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' ); 604 endif; 616 if ( ! $stat->equation ) { 617 if ( $placeholder !== '' && is_numeric( $placeholder ) ): 618 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder; 619 else: 620 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' ); 621 endif; 622 } 605 623 606 624 if ( is_numeric( $placeholder ) && $stat->precision ): … … 615 633 // Merge the data and placeholders arrays 616 634 foreach( $placeholders as $player_id => $player_data ): 635 636 if ( in_array( 'dob', $this->columns ) ): 637 $player_data['dob'] = get_the_date( get_option( 'date_format') , $player_id ); 638 endif; 639 640 if ( in_array( 'age', $this->columns ) ): 641 $birthdayclass = new SportsPress_Birthdays(); 642 $player_data['age'] = $birthdayclass->get_age( get_the_date( 'm-d-Y', $player_id ) ); 643 endif; 617 644 618 645 $player_data = array_merge( $column_order, $player_data ); … … 702 729 elseif ( $key == 'position' ): 703 730 $labels[ $key ] = __( 'Position', 'sportspress' ); 731 elseif ( $key == 'dob' && $showdob ): 732 $labels[ $key ] = __( 'Date of Birth', 'sportspress' ); 733 elseif ( $key == 'age' && $showage ): 734 $labels[ $key ] = __( 'Age', 'sportspress' ); 704 735 elseif ( array_key_exists( $key, $columns ) ): 705 736 $labels[ $key ] = $columns[ $key ]; … … 751 782 $labels['position'] = __( 'Position', 'sportspress' ); 752 783 } 784 if ( in_array( 'dob', $this->columns ) && $showdob ) { 785 $labels['dob'] = __( 'Date of Birth', 'sportspress' ); 786 } 787 if ( in_array( 'age', $this->columns ) && $showage ) { 788 $labels['age'] = __( 'Age', 'sportspress' ); 789 } 753 790 754 791 $merged[0] = array_merge( $labels, $columns ); -
sportspress/tags/2.7.1/includes/class-sp-post-types.php
r2266710 r2280658 10 10 * 11 11 * @class SP_Post_types 12 * @version 2.7 12 * @version 2.7.1 13 13 * @package SportsPress/Classes 14 14 * @category Class … … 23 23 add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 ); 24 24 add_action( 'init', array( __CLASS__, 'register_taxonomies' ), 10 ); 25 add_action( ' wp_trash_post', array( $this, 'delete_config_post' ) );25 add_action( 'trashed_post', array( $this, 'delete_config_post' ) ); 26 26 add_filter( 'the_posts', array( $this, 'display_scheduled_events' ) ); 27 27 } -
sportspress/tags/2.7.1/includes/class-sp-team.php
r1874103 r2280658 6 6 * 7 7 * @class SP_Team 8 * @version 2. 6.38 * @version 2.7.1 9 9 * @package SportsPress/Classes 10 10 * @category Class … … 489 489 $tables_by_terms = get_posts( $args ); 490 490 491 $tables = array_merge( $tables_by_ id, $tables_by_terms);491 $tables = array_merge( $tables_by_terms, $tables_by_id ); 492 492 493 493 $checked = (array) get_post_meta( $this->ID, 'sp_table' ); -
sportspress/tags/2.7.1/modules/sportspress-birthdays.php
r1768064 r2280658 6 6 Author: ThemeBoy 7 7 Author URI: http://themeboy.com/ 8 Version: 2. 58 Version: 2.7.1 9 9 */ 10 10 … … 18 18 * 19 19 * @class SportsPress_Birthdays 20 * @version 2. 520 * @version 2.7.1 21 21 */ 22 22 class SportsPress_Birthdays { … … 37 37 38 38 add_action( 'sportspress_widgets', array( $this, 'widgets' ) ); 39 add_action( 'sportspress_list_general_columns', array( $this, 'columns' ), 10, 1 ); 39 40 } 40 41 … … 44 45 private function define_constants() { 45 46 if ( !defined( 'SP_BIRTHDAYS_VERSION' ) ) 46 define( 'SP_BIRTHDAYS_VERSION', '2. 5' );47 define( 'SP_BIRTHDAYS_VERSION', '2.7.1' ); 47 48 48 49 if ( !defined( 'SP_BIRTHDAYS_URL' ) ) … … 188 189 include_once( SP()->plugin_path() . '/includes/widgets/class-sp-widget-birthdays.php' ); 189 190 } 191 192 /** 193 * Add more General Columns at Player Lists 194 */ 195 public static function columns( $selected ) { 196 ?> 197 <li> 198 <label class="selectit"> 199 <input value="dob" type="checkbox" name="sp_columns[]" id="sp_columns_dob" <?php checked( in_array( 'dob', $selected ) ); ?>> 200 <?php _e( 'Date of Birth', 'sportspress' ); ?> 201 </label> 202 </li> 203 <li> 204 <label class="selectit"> 205 <input value="age" type="checkbox" name="sp_columns[]" id="sp_columns_age" <?php checked( in_array( 'age', $selected ) ); ?>> 206 <?php _e( 'Age', 'sportspress' ); ?> 207 </label> 208 </li> 209 <?php 210 } 190 211 191 212 /** -
sportspress/tags/2.7.1/readme.txt
r2266710 r2280658 1 1 === SportsPress - Sports Club & League Manager === 2 Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi 2 Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochesterj 3 3 Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters 4 4 Donate link: http://tboy.co/donate 5 5 Requires at least: 3.8 6 6 Tested up to: 5.3 7 Stable tag: 2.7 7 Stable tag: 2.7.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 240 240 241 241 == Changelog == 242 243 = 2.7.1 = 244 * Feature - Enable player list filtering by nationality. 245 * Feature - Add option to display date of birth in player lists. 246 * Tweak - Exclude postponed and canceled events from countdowns. 247 * Tweak - Apply reverse order option to event results. 248 * Tweak - When a team has more than one home venue, separate with commas. 249 * Fix - Venue address containing pluses in events. 250 * Fix - Event blocks showing the wrong dates when embedded within other event pages. 251 * Fix - Statistics not adding manual values when not based on equations. 252 * Fix - Event lists ignoring the format parameter. 253 * Fix - League table order when displaying multiple tables in team profiles. 254 * Fix - Error when deleting configuration columns. 255 * Fix - Player lists not including past players in some cases. 256 * Fix - Prevent error when viewing event calendar in some cases. 242 257 243 258 = 2.7 = -
sportspress/tags/2.7.1/sportspress.php
r2266710 r2280658 4 4 * Plugin URI: http://themeboy.com/sportspress/ 5 5 * Description: Manage your club and its players, staff, events, league tables, and player lists. 6 * Version: 2.7 6 * Version: 2.7.1 7 7 * Author: ThemeBoy 8 8 * Author URI: http://themeboy.com … … 27 27 * 28 28 * @class SportsPress 29 * @version 2.7 29 * @version 2.7.1 30 30 */ 31 31 final class SportsPress { … … 34 34 * @var string 35 35 */ 36 public $version = '2.7 ';36 public $version = '2.7.1'; 37 37 38 38 /** -
sportspress/tags/2.7.1/templates/countdown.php
r1989657 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 6.127 * @version 2.7.1 8 8 */ 9 9 … … 31 31 $calendar->team = $team; 32 32 $calendar->status = 'future'; 33 $calendar->number = 1;34 33 $calendar->order = 'ASC'; 35 34 $data = $calendar->data(); 36 $post = array_shift( $data ); 35 36 /** 37 * Exclude postponed or cancelled events. 38 */ 39 $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array( 40 'postponed', 41 'cancelled', 42 ) ); 43 while ( $post = array_shift( $data ) ) { 44 $sp_status = get_post_meta($post->ID, 'sp_status', true); 45 if( ! in_array( $sp_status, $excluded_statuses ) ) { 46 break; 47 } 48 } 37 49 else: 38 50 $args = array(); … … 62 74 } 63 75 } 76 77 /** 78 * Exclude postponed or cancelled events. 79 */ 80 $args['meta_query'][] = [ 81 'key' => 'sp_status', 82 'compare' => 'NOT IN', 83 'value' => apply_filters( 'sp_countdown_excluded_statuses', array( 84 'postponed', 85 'cancelled', 86 ) ), 87 ]; 88 64 89 $post = sp_get_next_event( $args ); 65 90 endif; -
sportspress/tags/2.7.1/templates/event-calendar.php
r1807715 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 5.57 * @version 2.7.1 8 8 */ 9 9 … … 184 184 } 185 185 186 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false)186 if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) && preg_match( '/(MSIE|camino|safari)/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) { 187 187 $ak_title_separator = "\n"; 188 else 188 } else { 189 189 $ak_title_separator = ', '; 190 } 190 191 191 192 $ak_titles_for_day = array(); -
sportspress/tags/2.7.1/templates/event-list.php
r2119148 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 6.197 * @version 2.7.1 8 8 */ 9 9 … … 52 52 if ( $status != 'default' ) 53 53 $calendar->status = $status; 54 if ( $format != ' default' )54 if ( $format != 'all' ) 55 55 $calendar->event_format = $format; 56 56 if ( $date != 'default' ) -
sportspress/tags/2.7.1/templates/event-logos-block.php
r1869768 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 67 * @version 2.7.1 8 8 */ 9 9 ?> … … 43 43 endforeach; 44 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' ) ); ?>45 <time class="sp-event-date" datetime="<?php echo get_the_time( 'Y-m-d H:i:s', $id ); ?>"> 46 <?php echo get_the_time( get_option( 'date_format' ), $id ); ?> 47 47 </time> 48 48 <?php -
sportspress/tags/2.7.1/templates/event-results.php
r1869768 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 67 * @version 2.7.1 8 8 */ 9 9 … … 43 43 $table_rows = ''; 44 44 $i = 0; 45 46 // Reverse teams order if the option "Events > Teams > Order > Reverse order" is enabled. 47 $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; 48 if ( $reverse_teams ) { 49 $data = array_reverse( $data, true ); 50 } 45 51 46 52 foreach( $data as $team_id => $result ): -
sportspress/tags/2.7.1/templates/event-venue.php
r2266710 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2.7 7 * @version 2.7.1 8 8 */ 9 9 … … 48 48 <?php if ( $address != null ) { ?> 49 49 <tr class="sp-event-venue-address-row"> 50 <td><?php echo $address; ?></td>50 <td><?php echo urldecode( $address ); ?></td> 51 51 </tr> 52 52 <?php } ?> -
sportspress/tags/2.7.1/templates/player-list.php
r2097227 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 6.157 * @version 2.7.1 8 8 */ 9 9 … … 56 56 $list->columns = $columns; 57 57 endif; 58 $data = $list->data( false, $leagues, $seasons, $team ); 58 59 $data = apply_filters('sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ) , $id ); 59 60 60 61 // The first row should be labels -
sportspress/tags/2.7.1/templates/team-details.php
r1768064 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 57 * @version 2.7.1 8 8 */ 9 9 … … 37 37 if ( $terms ): 38 38 if ( get_option( 'sportspress_team_link_venues', 'no' ) === 'yes' ): 39 $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue' );39 $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue', '', ', ' ); 40 40 else: 41 41 $venues = array(); -
sportspress/trunk/assets/js/sportspress.js
r2098952 r2280658 11 11 12 12 /* Header */ 13 if ( ! $('.sp-header'). size()) {13 if ( ! $('.sp-header').length ) { 14 14 $('body').prepend( '<div class="sp-header sp-header-loaded"></div>' ); 15 15 } -
sportspress/trunk/changelog.txt
r2266710 r2280658 1 1 == SportsPress Changelog == 2 3 = 2.7.1 = 4 * Feature - Enable player list filtering by nationality. 5 * Feature - Add option to display date of birth in player lists. 6 * Tweak - Exclude postponed and canceled events from countdowns. 7 * Tweak - Apply reverse order option to event results. 8 * Tweak - When a team has more than one home venue, separate with commas. 9 * Fix - Venue address containing pluses in events. 10 * Fix - Event blocks showing the wrong dates when embedded within other event pages. 11 * Fix - Statistics not adding manual values when not based on equations. 12 * Fix - Event lists ignoring the format parameter. 13 * Fix - League table order when displaying multiple tables in team profiles. 14 * Fix - Error when deleting configuration columns. 15 * Fix - Player lists not including past players in some cases. 16 * Fix - Prevent error when viewing event calendar in some cases. 2 17 3 18 = 2.7 = -
sportspress/trunk/includes/admin/importers/class-sp-event-importer.php
r1768064 r2280658 6 6 * @category Admin 7 7 * @package SportsPress/Admin/Importers 8 * @version 2. 58 * @version 2.7.1 9 9 */ 10 10 … … 473 473 <fieldset id="post-formats-select"> 474 474 <ul> 475 <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> 476 <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> 477 <br> 475 <?php 476 foreach( (new SP_Formats)->event as $name => $title ) { 477 ?> 478 <li><input type="radio" name="sp_format" class="post-format" id="post-format-<?php echo $name; ?>" value="<?php echo $name; ?>" checked="checked"> <label for="post-format-<?php echo $name; ?>" class="post-format-icon post-format-<?php echo $name; ?>"><?php echo $title; ?></label></li> 479 <?php 480 } 481 ?> 482 </ul> 478 483 </fieldset> 479 484 </td> -
sportspress/trunk/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php
r1493758 r2280658 6 6 * @category Admin 7 7 * @package SportsPress/Admin/Meta_Boxes 8 * @version 2. 18 * @version 2.7.1 9 9 */ 10 10 … … 49 49 </label> 50 50 </li> 51 <?php do_action( 'sportspress_list_general_columns', $selected ); ?> 51 52 </ul> 52 53 <p><strong><?php _e( 'Data', 'sportspress' ); ?></strong></p> -
sportspress/trunk/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php
r1807715 r2280658 6 6 * @category Admin 7 7 * @package SportsPress/Admin/Meta_Boxes 8 * @version 2. 5.58 * @version 2.7.1 9 9 */ 10 10 … … 35 35 $date_past = get_post_meta( $post->ID, 'sp_date_past', true ); 36 36 $date_relative = get_post_meta( $post->ID, 'sp_date_relative', true ); 37 $continents = SP()->countries->continents; 38 $nationalities = get_post_meta( $post->ID, 'sp_nationality', false ); 39 $default_nationality = get_option( 'sportspress_default_nationality' , false ); 37 40 ?> 38 41 <div> … … 99 102 </select> 100 103 </p> 104 <p><strong><?php _e( 'Nationality', 'sportspress' ); ?></strong></p> 105 <p> 106 <select id="sp_nationality" name="sp_nationality[]" data-placeholder="<?php printf( __( 'Select %s', 'sportspress' ), __( 'Nationality', 'sportspress' ) ); ?>" class="widefat chosen-select<?php if ( is_rtl() ): ?> chosen-rtl<?php endif; ?>" multiple="multiple"> 107 <option value=""></option> 108 <?php foreach ( $continents as $continent => $countries ): ?> 109 <optgroup label="<?php echo $continent; ?>"> 110 <?php foreach ( $countries as $code => $country ): ?> 111 <option value="<?php echo $code; ?>" <?php selected ( in_array( $code, $nationalities ) ); ?>><?php echo $country; ?></option> 112 <?php endforeach; ?> 113 </optgroup> 114 <?php endforeach; ?> 115 </select> 116 </p> 101 117 <p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p> 102 118 <p> … … 144 160 <?php 145 161 if ( 'manual' == $select ) { 146 sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), array( 'sp_league', 'sp_season', 'sp_current_team' ) ); 162 $player_filters = array( 'sp_league', 'sp_season' ); 163 if ( $team_id ) { 164 if ( in_array( $era, [ 'all', 'past' ] ) ) { 165 $player_filters[] = 'sp_past_team'; 166 } 167 if ( in_array( $era, [ 'all', 'current' ] ) ) { 168 $player_filters[] = 'sp_current_team'; 169 } 170 } 171 sp_post_checklist( $post->ID, 'sp_player', ( 'auto' == $select ? 'none' : 'block' ), $player_filters ); 147 172 sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) ); 148 173 } else { … … 179 204 update_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', array() ) ); 180 205 sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) ); 206 sp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array() ) ); 181 207 } 182 208 } -
sportspress/trunk/includes/class-sp-player-list.php
r2266710 r2280658 6 6 * 7 7 * @class SP_Player_List 8 * @version 2.7 8 * @version 2.7.1 9 9 * @package SportsPress/Classes 10 10 * @category Class … … 60 60 $order = get_post_meta( $this->ID, 'sp_order', true ); 61 61 $select = get_post_meta( $this->ID, 'sp_select', true ); 62 $nationalities = get_post_meta( $this->ID, 'sp_nationality', false ); 62 63 63 64 $this->date = $this->__get( 'date' ); … … 109 110 'order' => 'ASC', 110 111 'tax_query' => array( 112 'relation' => 'AND', 113 ), 114 'meta_query' => array( 111 115 'relation' => 'AND', 112 116 ), … … 139 143 break; 140 144 endswitch; 141 $args['meta_query'] = array(145 $args['meta_query'][] = array( 142 146 array( 143 147 'key' => $team_key, … … 152 156 'field' => 'term_id', 153 157 'terms' => $position_ids 158 ); 159 endif; 160 161 if ( $nationalities ): 162 $args['meta_query'][] = array( 163 array( 164 'key' => 'sp_nationality', 165 'value' => $nationalities, 166 'compare' => 'IN' 167 ), 154 168 ); 155 169 endif; … … 393 407 $timeline = (array)get_post_meta( $event->ID, 'sp_timeline', true ); 394 408 $minutes = get_post_meta( $event->ID, 'sp_minutes', true ); 409 $showdob = get_option( 'sportspress_player_show_birthday', 'no' ); 410 $showage = get_option( 'sportspress_player_show_age', 'no' ); 395 411 if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 ); 396 412 … … 598 614 endif; 599 615 600 if ( $placeholder !== '' && is_numeric( $placeholder ) ): 601 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder; 602 else: 603 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' ); 604 endif; 616 if ( ! $stat->equation ) { 617 if ( $placeholder !== '' && is_numeric( $placeholder ) ): 618 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder; 619 else: 620 $placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' ); 621 endif; 622 } 605 623 606 624 if ( is_numeric( $placeholder ) && $stat->precision ): … … 615 633 // Merge the data and placeholders arrays 616 634 foreach( $placeholders as $player_id => $player_data ): 635 636 if ( in_array( 'dob', $this->columns ) ): 637 $player_data['dob'] = get_the_date( get_option( 'date_format') , $player_id ); 638 endif; 639 640 if ( in_array( 'age', $this->columns ) ): 641 $birthdayclass = new SportsPress_Birthdays(); 642 $player_data['age'] = $birthdayclass->get_age( get_the_date( 'm-d-Y', $player_id ) ); 643 endif; 617 644 618 645 $player_data = array_merge( $column_order, $player_data ); … … 702 729 elseif ( $key == 'position' ): 703 730 $labels[ $key ] = __( 'Position', 'sportspress' ); 731 elseif ( $key == 'dob' && $showdob ): 732 $labels[ $key ] = __( 'Date of Birth', 'sportspress' ); 733 elseif ( $key == 'age' && $showage ): 734 $labels[ $key ] = __( 'Age', 'sportspress' ); 704 735 elseif ( array_key_exists( $key, $columns ) ): 705 736 $labels[ $key ] = $columns[ $key ]; … … 751 782 $labels['position'] = __( 'Position', 'sportspress' ); 752 783 } 784 if ( in_array( 'dob', $this->columns ) && $showdob ) { 785 $labels['dob'] = __( 'Date of Birth', 'sportspress' ); 786 } 787 if ( in_array( 'age', $this->columns ) && $showage ) { 788 $labels['age'] = __( 'Age', 'sportspress' ); 789 } 753 790 754 791 $merged[0] = array_merge( $labels, $columns ); -
sportspress/trunk/includes/class-sp-post-types.php
r2266710 r2280658 10 10 * 11 11 * @class SP_Post_types 12 * @version 2.7 12 * @version 2.7.1 13 13 * @package SportsPress/Classes 14 14 * @category Class … … 23 23 add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 ); 24 24 add_action( 'init', array( __CLASS__, 'register_taxonomies' ), 10 ); 25 add_action( ' wp_trash_post', array( $this, 'delete_config_post' ) );25 add_action( 'trashed_post', array( $this, 'delete_config_post' ) ); 26 26 add_filter( 'the_posts', array( $this, 'display_scheduled_events' ) ); 27 27 } -
sportspress/trunk/includes/class-sp-team.php
r1874103 r2280658 6 6 * 7 7 * @class SP_Team 8 * @version 2. 6.38 * @version 2.7.1 9 9 * @package SportsPress/Classes 10 10 * @category Class … … 489 489 $tables_by_terms = get_posts( $args ); 490 490 491 $tables = array_merge( $tables_by_ id, $tables_by_terms);491 $tables = array_merge( $tables_by_terms, $tables_by_id ); 492 492 493 493 $checked = (array) get_post_meta( $this->ID, 'sp_table' ); -
sportspress/trunk/modules/sportspress-birthdays.php
r1768064 r2280658 6 6 Author: ThemeBoy 7 7 Author URI: http://themeboy.com/ 8 Version: 2. 58 Version: 2.7.1 9 9 */ 10 10 … … 18 18 * 19 19 * @class SportsPress_Birthdays 20 * @version 2. 520 * @version 2.7.1 21 21 */ 22 22 class SportsPress_Birthdays { … … 37 37 38 38 add_action( 'sportspress_widgets', array( $this, 'widgets' ) ); 39 add_action( 'sportspress_list_general_columns', array( $this, 'columns' ), 10, 1 ); 39 40 } 40 41 … … 44 45 private function define_constants() { 45 46 if ( !defined( 'SP_BIRTHDAYS_VERSION' ) ) 46 define( 'SP_BIRTHDAYS_VERSION', '2. 5' );47 define( 'SP_BIRTHDAYS_VERSION', '2.7.1' ); 47 48 48 49 if ( !defined( 'SP_BIRTHDAYS_URL' ) ) … … 188 189 include_once( SP()->plugin_path() . '/includes/widgets/class-sp-widget-birthdays.php' ); 189 190 } 191 192 /** 193 * Add more General Columns at Player Lists 194 */ 195 public static function columns( $selected ) { 196 ?> 197 <li> 198 <label class="selectit"> 199 <input value="dob" type="checkbox" name="sp_columns[]" id="sp_columns_dob" <?php checked( in_array( 'dob', $selected ) ); ?>> 200 <?php _e( 'Date of Birth', 'sportspress' ); ?> 201 </label> 202 </li> 203 <li> 204 <label class="selectit"> 205 <input value="age" type="checkbox" name="sp_columns[]" id="sp_columns_age" <?php checked( in_array( 'age', $selected ) ); ?>> 206 <?php _e( 'Age', 'sportspress' ); ?> 207 </label> 208 </li> 209 <?php 210 } 190 211 191 212 /** -
sportspress/trunk/readme.txt
r2266710 r2280658 1 1 === SportsPress - Sports Club & League Manager === 2 Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi 2 Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochesterj 3 3 Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters 4 4 Donate link: http://tboy.co/donate 5 5 Requires at least: 3.8 6 6 Tested up to: 5.3 7 Stable tag: 2.7 7 Stable tag: 2.7.1 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 240 240 241 241 == Changelog == 242 243 = 2.7.1 = 244 * Feature - Enable player list filtering by nationality. 245 * Feature - Add option to display date of birth in player lists. 246 * Tweak - Exclude postponed and canceled events from countdowns. 247 * Tweak - Apply reverse order option to event results. 248 * Tweak - When a team has more than one home venue, separate with commas. 249 * Fix - Venue address containing pluses in events. 250 * Fix - Event blocks showing the wrong dates when embedded within other event pages. 251 * Fix - Statistics not adding manual values when not based on equations. 252 * Fix - Event lists ignoring the format parameter. 253 * Fix - League table order when displaying multiple tables in team profiles. 254 * Fix - Error when deleting configuration columns. 255 * Fix - Player lists not including past players in some cases. 256 * Fix - Prevent error when viewing event calendar in some cases. 242 257 243 258 = 2.7 = -
sportspress/trunk/sportspress.php
r2266710 r2280658 4 4 * Plugin URI: http://themeboy.com/sportspress/ 5 5 * Description: Manage your club and its players, staff, events, league tables, and player lists. 6 * Version: 2.7 6 * Version: 2.7.1 7 7 * Author: ThemeBoy 8 8 * Author URI: http://themeboy.com … … 27 27 * 28 28 * @class SportsPress 29 * @version 2.7 29 * @version 2.7.1 30 30 */ 31 31 final class SportsPress { … … 34 34 * @var string 35 35 */ 36 public $version = '2.7 ';36 public $version = '2.7.1'; 37 37 38 38 /** -
sportspress/trunk/templates/countdown.php
r1989657 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 6.127 * @version 2.7.1 8 8 */ 9 9 … … 31 31 $calendar->team = $team; 32 32 $calendar->status = 'future'; 33 $calendar->number = 1;34 33 $calendar->order = 'ASC'; 35 34 $data = $calendar->data(); 36 $post = array_shift( $data ); 35 36 /** 37 * Exclude postponed or cancelled events. 38 */ 39 $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array( 40 'postponed', 41 'cancelled', 42 ) ); 43 while ( $post = array_shift( $data ) ) { 44 $sp_status = get_post_meta($post->ID, 'sp_status', true); 45 if( ! in_array( $sp_status, $excluded_statuses ) ) { 46 break; 47 } 48 } 37 49 else: 38 50 $args = array(); … … 62 74 } 63 75 } 76 77 /** 78 * Exclude postponed or cancelled events. 79 */ 80 $args['meta_query'][] = [ 81 'key' => 'sp_status', 82 'compare' => 'NOT IN', 83 'value' => apply_filters( 'sp_countdown_excluded_statuses', array( 84 'postponed', 85 'cancelled', 86 ) ), 87 ]; 88 64 89 $post = sp_get_next_event( $args ); 65 90 endif; -
sportspress/trunk/templates/event-calendar.php
r1807715 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 5.57 * @version 2.7.1 8 8 */ 9 9 … … 184 184 } 185 185 186 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false)186 if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) && preg_match( '/(MSIE|camino|safari)/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) { 187 187 $ak_title_separator = "\n"; 188 else 188 } else { 189 189 $ak_title_separator = ', '; 190 } 190 191 191 192 $ak_titles_for_day = array(); -
sportspress/trunk/templates/event-list.php
r2119148 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 6.197 * @version 2.7.1 8 8 */ 9 9 … … 52 52 if ( $status != 'default' ) 53 53 $calendar->status = $status; 54 if ( $format != ' default' )54 if ( $format != 'all' ) 55 55 $calendar->event_format = $format; 56 56 if ( $date != 'default' ) -
sportspress/trunk/templates/event-logos-block.php
r1869768 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 67 * @version 2.7.1 8 8 */ 9 9 ?> … … 43 43 endforeach; 44 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' ) ); ?>45 <time class="sp-event-date" datetime="<?php echo get_the_time( 'Y-m-d H:i:s', $id ); ?>"> 46 <?php echo get_the_time( get_option( 'date_format' ), $id ); ?> 47 47 </time> 48 48 <?php -
sportspress/trunk/templates/event-results.php
r1869768 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 67 * @version 2.7.1 8 8 */ 9 9 … … 43 43 $table_rows = ''; 44 44 $i = 0; 45 46 // Reverse teams order if the option "Events > Teams > Order > Reverse order" is enabled. 47 $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; 48 if ( $reverse_teams ) { 49 $data = array_reverse( $data, true ); 50 } 45 51 46 52 foreach( $data as $team_id => $result ): -
sportspress/trunk/templates/event-venue.php
r2266710 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2.7 7 * @version 2.7.1 8 8 */ 9 9 … … 48 48 <?php if ( $address != null ) { ?> 49 49 <tr class="sp-event-venue-address-row"> 50 <td><?php echo $address; ?></td>50 <td><?php echo urldecode( $address ); ?></td> 51 51 </tr> 52 52 <?php } ?> -
sportspress/trunk/templates/player-list.php
r2097227 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 6.157 * @version 2.7.1 8 8 */ 9 9 … … 56 56 $list->columns = $columns; 57 57 endif; 58 $data = $list->data( false, $leagues, $seasons, $team ); 58 59 $data = apply_filters('sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ) , $id ); 59 60 60 61 // The first row should be labels -
sportspress/trunk/templates/team-details.php
r1768064 r2280658 5 5 * @author ThemeBoy 6 6 * @package SportsPress/Templates 7 * @version 2. 57 * @version 2.7.1 8 8 */ 9 9 … … 37 37 if ( $terms ): 38 38 if ( get_option( 'sportspress_team_link_venues', 'no' ) === 'yes' ): 39 $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue' );39 $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue', '', ', ' ); 40 40 else: 41 41 $venues = array();
Note: See TracChangeset
for help on using the changeset viewer.