Plugin Directory

Changeset 2280658


Ignore:
Timestamp:
04/10/2020 04:34:47 AM (6 years ago)
Author:
ThemeBoy
Message:

tagging version 2.7.1

Location:
sportspress
Files:
38 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sportspress/tags/2.7.1/assets/js/sportspress.js

    r2098952 r2280658  
    1111
    1212    /* Header */
    13     if ( ! $('.sp-header').size() ) {
     13    if ( ! $('.sp-header').length ) {
    1414        $('body').prepend( '<div class="sp-header sp-header-loaded"></div>' );
    1515    }
  • sportspress/tags/2.7.1/changelog.txt

    r2266710 r2280658  
    11== 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.
    217
    318= 2.7 =
  • sportspress/tags/2.7.1/includes/admin/importers/class-sp-event-importer.php

    r1768064 r2280658  
    66 * @category    Admin
    77 * @package     SportsPress/Admin/Importers
    8  * @version     2.5
     8 * @version     2.7.1
    99 */
    1010
     
    473473                            <fieldset id="post-formats-select">
    474474                                <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>
    478483                            </fieldset>
    479484                        </td>
  • sportspress/tags/2.7.1/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php

    r1493758 r2280658  
    66 * @category    Admin
    77 * @package     SportsPress/Admin/Meta_Boxes
    8  * @version     2.1
     8 * @version     2.7.1
    99 */
    1010
     
    4949                </label>
    5050            </li>
     51            <?php do_action( 'sportspress_list_general_columns', $selected ); ?>
    5152        </ul>
    5253        <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  
    66 * @category    Admin
    77 * @package     SportsPress/Admin/Meta_Boxes
    8  * @version     2.5.5
     8 * @version     2.7.1
    99 */
    1010
     
    3535        $date_past = get_post_meta( $post->ID, 'sp_date_past', true );
    3636        $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 );
    3740        ?>
    3841        <div>
     
    99102                </select>
    100103            </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>
    101117            <p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p>
    102118            <p>
     
    144160            <?php
    145161            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 );
    147172                sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
    148173            } else {
     
    179204        update_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', array() ) );
    180205        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() ) );
    181207    }
    182208}
  • sportspress/tags/2.7.1/includes/class-sp-player-list.php

    r2266710 r2280658  
    66 *
    77 * @class       SP_Player_List
    8  * @version     2.7
     8 * @version     2.7.1
    99 * @package     SportsPress/Classes
    1010 * @category    Class
     
    6060        $order = get_post_meta( $this->ID, 'sp_order', true );
    6161        $select = get_post_meta( $this->ID, 'sp_select', true );
     62        $nationalities = get_post_meta( $this->ID, 'sp_nationality', false );
    6263
    6364        $this->date = $this->__get( 'date' );
     
    109110                'order' => 'ASC',
    110111                'tax_query' => array(
     112                    'relation' => 'AND',
     113                ),
     114                'meta_query' => array(
    111115                    'relation' => 'AND',
    112116                ),
     
    139143                        break;
    140144                endswitch;
    141                 $args['meta_query'] = array(
     145                $args['meta_query'][] = array(
    142146                    array(
    143147                        'key' => $team_key,
     
    152156                    'field' => 'term_id',
    153157                    '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                    ),
    154168                );
    155169            endif;
     
    393407            $timeline = (array)get_post_meta( $event->ID, 'sp_timeline', true );
    394408            $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' );
    395411            if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
    396412
     
    598614                endif;
    599615
    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                }
    605623
    606624                if ( is_numeric( $placeholder ) && $stat->precision ):
     
    615633        // Merge the data and placeholders arrays
    616634        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;
    617644
    618645            $player_data = array_merge( $column_order, $player_data );
     
    702729                elseif ( $key == 'position' ):
    703730                    $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' );
    704735                elseif ( array_key_exists( $key, $columns ) ):
    705736                    $labels[ $key ] = $columns[ $key ];
     
    751782                $labels['position'] = __( 'Position', 'sportspress' );
    752783            }
     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            }
    753790
    754791            $merged[0] = array_merge( $labels, $columns );
  • sportspress/tags/2.7.1/includes/class-sp-post-types.php

    r2266710 r2280658  
    1010 *
    1111 * @class       SP_Post_types
    12  * @version     2.7
     12 * @version     2.7.1
    1313 * @package     SportsPress/Classes
    1414 * @category    Class
     
    2323        add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );
    2424        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' ) );
    2626        add_filter( 'the_posts', array( $this, 'display_scheduled_events' ) );
    2727    }
  • sportspress/tags/2.7.1/includes/class-sp-team.php

    r1874103 r2280658  
    66 *
    77 * @class       SP_Team
    8  * @version     2.6.3
     8 * @version     2.7.1
    99 * @package     SportsPress/Classes
    1010 * @category    Class
     
    489489        $tables_by_terms = get_posts( $args );
    490490       
    491         $tables = array_merge( $tables_by_id, $tables_by_terms );
     491        $tables = array_merge( $tables_by_terms, $tables_by_id );
    492492
    493493        $checked = (array) get_post_meta( $this->ID, 'sp_table' );
  • sportspress/tags/2.7.1/modules/sportspress-birthdays.php

    r1768064 r2280658  
    66Author: ThemeBoy
    77Author URI: http://themeboy.com/
    8 Version: 2.5
     8Version: 2.7.1
    99*/
    1010
     
    1818 *
    1919 * @class SportsPress_Birthdays
    20  * @version 2.5
     20 * @version 2.7.1
    2121 */
    2222class SportsPress_Birthdays {
     
    3737
    3838        add_action( 'sportspress_widgets', array( $this, 'widgets' ) );
     39        add_action( 'sportspress_list_general_columns', array( $this, 'columns' ), 10, 1 );
    3940    }
    4041
     
    4445    private function define_constants() {
    4546        if ( !defined( 'SP_BIRTHDAYS_VERSION' ) )
    46             define( 'SP_BIRTHDAYS_VERSION', '2.5' );
     47            define( 'SP_BIRTHDAYS_VERSION', '2.7.1' );
    4748
    4849        if ( !defined( 'SP_BIRTHDAYS_URL' ) )
     
    188189        include_once( SP()->plugin_path() . '/includes/widgets/class-sp-widget-birthdays.php' );
    189190    }
     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    }
    190211
    191212    /**
  • sportspress/tags/2.7.1/readme.txt

    r2266710 r2280658  
    11=== SportsPress - Sports Club & League Manager ===
    2 Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi
     2Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochesterj
    33Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
    44Donate link: http://tboy.co/donate
    55Requires at least: 3.8
    66Tested up to: 5.3
    7 Stable tag: 2.7
     7Stable tag: 2.7.1
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    240240
    241241== 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.
    242257
    243258= 2.7 =
  • sportspress/tags/2.7.1/sportspress.php

    r2266710 r2280658  
    44 * Plugin URI: http://themeboy.com/sportspress/
    55 * Description: Manage your club and its players, staff, events, league tables, and player lists.
    6  * Version: 2.7
     6 * Version: 2.7.1
    77 * Author: ThemeBoy
    88 * Author URI: http://themeboy.com
     
    2727 *
    2828 * @class SportsPress
    29  * @version 2.7
     29 * @version 2.7.1
    3030 */
    3131final class SportsPress {
     
    3434     * @var string
    3535     */
    36     public $version = '2.7';
     36    public $version = '2.7.1';
    3737
    3838    /**
  • sportspress/tags/2.7.1/templates/countdown.php

    r1989657 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6.12
     7 * @version   2.7.1
    88 */
    99
     
    3131        $calendar->team = $team;
    3232    $calendar->status = 'future';
    33     $calendar->number = 1;
    3433    $calendar->order = 'ASC';
    3534    $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    }
    3749else:
    3850    $args = array();
     
    6274        }
    6375    }
     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
    6489    $post = sp_get_next_event( $args );
    6590endif;
  • sportspress/tags/2.7.1/templates/event-calendar.php

    r1807715 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.5.5
     7 * @version   2.7.1
    88 */
    99
     
    184184}
    185185
    186 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false)
     186if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) && preg_match( '/(MSIE|camino|safari)/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
    187187    $ak_title_separator = "\n";
    188 else
     188} else {
    189189    $ak_title_separator = ', ';
     190}
    190191
    191192$ak_titles_for_day = array();
  • sportspress/tags/2.7.1/templates/event-list.php

    r2119148 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6.19
     7 * @version   2.7.1
    88 */
    99
     
    5252if ( $status != 'default' )
    5353    $calendar->status = $status;
    54 if ( $format != 'default' )
     54if ( $format != 'all' )
    5555    $calendar->event_format = $format;
    5656if ( $date != 'default' )
  • sportspress/tags/2.7.1/templates/event-logos-block.php

    r1869768 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6
     7 * @version   2.7.1
    88 */
    99?>
     
    4343                        endforeach;
    4444                        ?>
    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 ); ?>
    4747                        </time>
    4848                        <?php
  • sportspress/tags/2.7.1/templates/event-results.php

    r1869768 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6
     7 * @version   2.7.1
    88 */
    99
     
    4343$table_rows = '';
    4444$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;
     48if ( $reverse_teams ) {
     49    $data = array_reverse( $data, true );
     50}
    4551
    4652foreach( $data as $team_id => $result ):
  • sportspress/tags/2.7.1/templates/event-venue.php

    r2266710 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version     2.7
     7 * @version     2.7.1
    88 */
    99
     
    4848                    <?php if ( $address != null ) { ?>
    4949                        <tr class="sp-event-venue-address-row">
    50                             <td><?php echo $address; ?></td>
     50                            <td><?php echo urldecode( $address ); ?></td>
    5151                        </tr>
    5252                    <?php } ?>
  • sportspress/tags/2.7.1/templates/player-list.php

    r2097227 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6.15
     7 * @version   2.7.1
    88 */
    99
     
    5656    $list->columns = $columns;
    5757endif;
    58 $data = $list->data( false, $leagues, $seasons, $team );
     58
     59$data = apply_filters('sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ) , $id );
    5960
    6061// The first row should be labels
  • sportspress/tags/2.7.1/templates/team-details.php

    r1768064 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.5
     7 * @version   2.7.1
    88 */
    99
     
    3737if ( $terms ):
    3838    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', '', ', ' );
    4040    else:
    4141        $venues = array();
  • sportspress/trunk/assets/js/sportspress.js

    r2098952 r2280658  
    1111
    1212    /* Header */
    13     if ( ! $('.sp-header').size() ) {
     13    if ( ! $('.sp-header').length ) {
    1414        $('body').prepend( '<div class="sp-header sp-header-loaded"></div>' );
    1515    }
  • sportspress/trunk/changelog.txt

    r2266710 r2280658  
    11== 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.
    217
    318= 2.7 =
  • sportspress/trunk/includes/admin/importers/class-sp-event-importer.php

    r1768064 r2280658  
    66 * @category    Admin
    77 * @package     SportsPress/Admin/Importers
    8  * @version     2.5
     8 * @version     2.7.1
    99 */
    1010
     
    473473                            <fieldset id="post-formats-select">
    474474                                <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>
    478483                            </fieldset>
    479484                        </td>
  • sportspress/trunk/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-columns.php

    r1493758 r2280658  
    66 * @category    Admin
    77 * @package     SportsPress/Admin/Meta_Boxes
    8  * @version     2.1
     8 * @version     2.7.1
    99 */
    1010
     
    4949                </label>
    5050            </li>
     51            <?php do_action( 'sportspress_list_general_columns', $selected ); ?>
    5152        </ul>
    5253        <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  
    66 * @category    Admin
    77 * @package     SportsPress/Admin/Meta_Boxes
    8  * @version     2.5.5
     8 * @version     2.7.1
    99 */
    1010
     
    3535        $date_past = get_post_meta( $post->ID, 'sp_date_past', true );
    3636        $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 );
    3740        ?>
    3841        <div>
     
    99102                </select>
    100103            </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>
    101117            <p><strong><?php _e( 'Grouping', 'sportspress' ); ?></strong></p>
    102118            <p>
     
    144160            <?php
    145161            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 );
    147172                sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
    148173            } else {
     
    179204        update_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', array() ) );
    180205        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() ) );
    181207    }
    182208}
  • sportspress/trunk/includes/class-sp-player-list.php

    r2266710 r2280658  
    66 *
    77 * @class       SP_Player_List
    8  * @version     2.7
     8 * @version     2.7.1
    99 * @package     SportsPress/Classes
    1010 * @category    Class
     
    6060        $order = get_post_meta( $this->ID, 'sp_order', true );
    6161        $select = get_post_meta( $this->ID, 'sp_select', true );
     62        $nationalities = get_post_meta( $this->ID, 'sp_nationality', false );
    6263
    6364        $this->date = $this->__get( 'date' );
     
    109110                'order' => 'ASC',
    110111                'tax_query' => array(
     112                    'relation' => 'AND',
     113                ),
     114                'meta_query' => array(
    111115                    'relation' => 'AND',
    112116                ),
     
    139143                        break;
    140144                endswitch;
    141                 $args['meta_query'] = array(
     145                $args['meta_query'][] = array(
    142146                    array(
    143147                        'key' => $team_key,
     
    152156                    'field' => 'term_id',
    153157                    '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                    ),
    154168                );
    155169            endif;
     
    393407            $timeline = (array)get_post_meta( $event->ID, 'sp_timeline', true );
    394408            $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' );
    395411            if ( $minutes === '' ) $minutes = get_option( 'sportspress_event_minutes', 90 );
    396412
     
    598614                endif;
    599615
    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                }
    605623
    606624                if ( is_numeric( $placeholder ) && $stat->precision ):
     
    615633        // Merge the data and placeholders arrays
    616634        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;
    617644
    618645            $player_data = array_merge( $column_order, $player_data );
     
    702729                elseif ( $key == 'position' ):
    703730                    $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' );
    704735                elseif ( array_key_exists( $key, $columns ) ):
    705736                    $labels[ $key ] = $columns[ $key ];
     
    751782                $labels['position'] = __( 'Position', 'sportspress' );
    752783            }
     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            }
    753790
    754791            $merged[0] = array_merge( $labels, $columns );
  • sportspress/trunk/includes/class-sp-post-types.php

    r2266710 r2280658  
    1010 *
    1111 * @class       SP_Post_types
    12  * @version     2.7
     12 * @version     2.7.1
    1313 * @package     SportsPress/Classes
    1414 * @category    Class
     
    2323        add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );
    2424        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' ) );
    2626        add_filter( 'the_posts', array( $this, 'display_scheduled_events' ) );
    2727    }
  • sportspress/trunk/includes/class-sp-team.php

    r1874103 r2280658  
    66 *
    77 * @class       SP_Team
    8  * @version     2.6.3
     8 * @version     2.7.1
    99 * @package     SportsPress/Classes
    1010 * @category    Class
     
    489489        $tables_by_terms = get_posts( $args );
    490490       
    491         $tables = array_merge( $tables_by_id, $tables_by_terms );
     491        $tables = array_merge( $tables_by_terms, $tables_by_id );
    492492
    493493        $checked = (array) get_post_meta( $this->ID, 'sp_table' );
  • sportspress/trunk/modules/sportspress-birthdays.php

    r1768064 r2280658  
    66Author: ThemeBoy
    77Author URI: http://themeboy.com/
    8 Version: 2.5
     8Version: 2.7.1
    99*/
    1010
     
    1818 *
    1919 * @class SportsPress_Birthdays
    20  * @version 2.5
     20 * @version 2.7.1
    2121 */
    2222class SportsPress_Birthdays {
     
    3737
    3838        add_action( 'sportspress_widgets', array( $this, 'widgets' ) );
     39        add_action( 'sportspress_list_general_columns', array( $this, 'columns' ), 10, 1 );
    3940    }
    4041
     
    4445    private function define_constants() {
    4546        if ( !defined( 'SP_BIRTHDAYS_VERSION' ) )
    46             define( 'SP_BIRTHDAYS_VERSION', '2.5' );
     47            define( 'SP_BIRTHDAYS_VERSION', '2.7.1' );
    4748
    4849        if ( !defined( 'SP_BIRTHDAYS_URL' ) )
     
    188189        include_once( SP()->plugin_path() . '/includes/widgets/class-sp-widget-birthdays.php' );
    189190    }
     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    }
    190211
    191212    /**
  • sportspress/trunk/readme.txt

    r2266710 r2280658  
    11=== SportsPress - Sports Club & League Manager ===
    2 Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi
     2Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochesterj
    33Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
    44Donate link: http://tboy.co/donate
    55Requires at least: 3.8
    66Tested up to: 5.3
    7 Stable tag: 2.7
     7Stable tag: 2.7.1
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    240240
    241241== 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.
    242257
    243258= 2.7 =
  • sportspress/trunk/sportspress.php

    r2266710 r2280658  
    44 * Plugin URI: http://themeboy.com/sportspress/
    55 * Description: Manage your club and its players, staff, events, league tables, and player lists.
    6  * Version: 2.7
     6 * Version: 2.7.1
    77 * Author: ThemeBoy
    88 * Author URI: http://themeboy.com
     
    2727 *
    2828 * @class SportsPress
    29  * @version 2.7
     29 * @version 2.7.1
    3030 */
    3131final class SportsPress {
     
    3434     * @var string
    3535     */
    36     public $version = '2.7';
     36    public $version = '2.7.1';
    3737
    3838    /**
  • sportspress/trunk/templates/countdown.php

    r1989657 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6.12
     7 * @version   2.7.1
    88 */
    99
     
    3131        $calendar->team = $team;
    3232    $calendar->status = 'future';
    33     $calendar->number = 1;
    3433    $calendar->order = 'ASC';
    3534    $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    }
    3749else:
    3850    $args = array();
     
    6274        }
    6375    }
     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
    6489    $post = sp_get_next_event( $args );
    6590endif;
  • sportspress/trunk/templates/event-calendar.php

    r1807715 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.5.5
     7 * @version   2.7.1
    88 */
    99
     
    184184}
    185185
    186 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false)
     186if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) && preg_match( '/(MSIE|camino|safari)/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
    187187    $ak_title_separator = "\n";
    188 else
     188} else {
    189189    $ak_title_separator = ', ';
     190}
    190191
    191192$ak_titles_for_day = array();
  • sportspress/trunk/templates/event-list.php

    r2119148 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6.19
     7 * @version   2.7.1
    88 */
    99
     
    5252if ( $status != 'default' )
    5353    $calendar->status = $status;
    54 if ( $format != 'default' )
     54if ( $format != 'all' )
    5555    $calendar->event_format = $format;
    5656if ( $date != 'default' )
  • sportspress/trunk/templates/event-logos-block.php

    r1869768 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6
     7 * @version   2.7.1
    88 */
    99?>
     
    4343                        endforeach;
    4444                        ?>
    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 ); ?>
    4747                        </time>
    4848                        <?php
  • sportspress/trunk/templates/event-results.php

    r1869768 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6
     7 * @version   2.7.1
    88 */
    99
     
    4343$table_rows = '';
    4444$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;
     48if ( $reverse_teams ) {
     49    $data = array_reverse( $data, true );
     50}
    4551
    4652foreach( $data as $team_id => $result ):
  • sportspress/trunk/templates/event-venue.php

    r2266710 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version     2.7
     7 * @version     2.7.1
    88 */
    99
     
    4848                    <?php if ( $address != null ) { ?>
    4949                        <tr class="sp-event-venue-address-row">
    50                             <td><?php echo $address; ?></td>
     50                            <td><?php echo urldecode( $address ); ?></td>
    5151                        </tr>
    5252                    <?php } ?>
  • sportspress/trunk/templates/player-list.php

    r2097227 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.6.15
     7 * @version   2.7.1
    88 */
    99
     
    5656    $list->columns = $columns;
    5757endif;
    58 $data = $list->data( false, $leagues, $seasons, $team );
     58
     59$data = apply_filters('sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ) , $id );
    5960
    6061// The first row should be labels
  • sportspress/trunk/templates/team-details.php

    r1768064 r2280658  
    55 * @author      ThemeBoy
    66 * @package     SportsPress/Templates
    7  * @version   2.5
     7 * @version   2.7.1
    88 */
    99
     
    3737if ( $terms ):
    3838    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', '', ', ' );
    4040    else:
    4141        $venues = array();
Note: See TracChangeset for help on using the changeset viewer.