Wrap substitution time with parentheses and fix sub out number

This commit is contained in:
Brian Miyaji
2016-12-12 11:37:47 +11:00
parent 6a8b187ab5
commit 92ac59121e

View File

@@ -97,15 +97,16 @@ if ( ! isset( $subs ) ) $subs = array();
if ( $show_minutes && ! empty( $sub ) ):
preg_match( '#\((.*?)\)#', $data[ $lineup_sub_relation[ $player_id ] ]['sub'], $match );
if ( ! empty( $match ) && isset( $match[1] ) ):
$name .= $match[1];
$name .= ' (' . $match[1] . ')';
endif;
endif;
elseif ( isset( $row['sub'] ) && $row['sub'] ):
$name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . '</span>';
$subbed = (int) $row['sub'];
$name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $subbed, array() ), 'number', null ) . '</span>';
if ( $show_minutes && ! empty( $row['sub'] ) ):
preg_match( '#\((.*?)\)#', $row['sub'], $match );
if ( ! empty( $match ) && isset( $match[1] ) ):
$name .= $match[1];
$name .= ' (' . $match[1] . ')';
endif;
endif;
endif;