diff --git a/assets/css/sportspress.css b/assets/css/sportspress.css index 2fa79215..5b5cfcf6 100644 --- a/assets/css/sportspress.css +++ b/assets/css/sportspress.css @@ -61,13 +61,29 @@ text-align: center; } -/* League table */ +/* League Table */ .sp-league-table .team-logo { vertical-align: middle; height: 2.5em; width: auto; } +/* Event Performance */ +.sp-event-performance .sub-in, +.sp-event-performance .sub-out { + cursor: default; +} +.sp-event-performance .sub-in:before, +.sp-event-performance .sub-out:before { + font-family: dashicons; +} +.sp-event-performance .sub-in:before { + content: "\f140"; +} +.sp-event-performance .sub-out:before { + content: "\f142"; +} + /* Event Calendar */ .sp-event-calendar tbody td, .sp-event-calendar thead th { text-align: center; diff --git a/includes/class-sp-frontend-scripts.php b/includes/class-sp-frontend-scripts.php index 245a4c63..9503dfaf 100644 --- a/includes/class-sp-frontend-scripts.php +++ b/includes/class-sp-frontend-scripts.php @@ -56,6 +56,7 @@ class SP_Frontend_Scripts { wp_localize_script( 'sportspress', 'localized_strings', array( 'days' => __( 'days', 'sportspress' ), 'hrs' => __( 'hrs', 'sportspress' ), 'mins' => __( 'mins', 'sportspress' ), 'secs' => __( 'secs', 'sportspress' ), 'previous' => __( 'Previous', 'sportspress' ), 'next' => __( 'Next', 'sportspress' ) ) ); // CSS Styles + wp_enqueue_style( 'dashicons' ); $enqueue_styles = $this->get_styles(); if ( $enqueue_styles ): diff --git a/templates/event-performance.php b/templates/event-performance.php index cd48ec65..7ea79a40 100644 --- a/templates/event-performance.php +++ b/templates/event-performance.php @@ -12,6 +12,8 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( ! isset( $id ) ) $id = get_the_ID(); +$event = new SP_Event( $id ); + $teams = (array)get_post_meta( $id, 'sp_team', false ); $staff = (array)get_post_meta( $id, 'sp_staff', false ); $stats = (array)get_post_meta( $id, 'sp_players', true ); @@ -47,6 +49,17 @@ foreach( $teams as $key => $team_id ):
$sub ): + if ( ! $sub_id ) + continue; + $lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id; + endforeach; + $i = 0; foreach( $data as $player_id => $row ): @@ -68,6 +81,14 @@ foreach( $teams as $key => $team_id ): if ( $link_posts ): $permalink = get_post_permalink( $player_id ); $name = '' . $name . ''; + if ( isset( $row['status'] ) && $row['status'] == 'sub' ): + $name = '(' . $name . ')'; + endif; + if ( array_key_exists( $player_id, $lineup_sub_relation ) ): + $name .= ' ' . get_post_meta( $lineup_sub_relation[ $player_id ], 'sp_number', true ) . ''; + elseif ( isset( $row['sub'] ) && $row['sub'] ): + $name .= ' ' . get_post_meta( $row['sub'], 'sp_number', true ) . ''; + endif; endif; echo '