Outputs the HTML for the player stats table for a team
Parameters
- $html, string, the current HTML for the player stats table
- $player_stats_array, array, the stats for the table
- $sport, string, the sport that's being used on the site
Returns
- string, the HTML for the team's player's stats table
Since: 1.5
Source: baseball-team-info.php, line 93; basketball-team-info.php, line 85; football-team-info.php, line 97; hockey-team-info.php, line 82; rugby-team-info.php, line 76; soccer-game-info.php, line 78; volleyball-team-info.php, line 83
Example
/**
* Returns the html for the team stats table
*
* @param string $html
*
* @param array $stats
*
* @param string $sport
*
* @return string, html for the team stats table
*
* @since 1.5
*/
function sports_bench_do_team_stats_table( $html, $stats, $sport ) {
if ( 'baseball' == $sport ) {
if ( !empty( $stats ) ) {
foreach ( $stats as $key => $row ) {
$average[ $key ] = $row[ 'batting_average' ];
}
array_multisort( $average, SORT_DESC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'AB', 'sports-bench' ) . ' | ';
$html .= '' . __( 'AVG', 'sports-bench' ) . ' | ';
$html .= '' . __( 'H', 'sports-bench' ) . ' | ';
$html .= '' . __( 'R', 'sports-bench' ) . ' | ';
$html .= '' . __( 'RBI', 'sports-bench' ) . ' | ';
$html .= '' . __( '2B', 'sports-bench' ) . ' | ';
$html .= '' . __( '3B', 'sports-bench' ) . ' | ';
$html .= '' . __( 'HR', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SO', 'sports-bench' ) . ' | ';
$html .= '' . __( 'BB', 'sports-bench' ) . ' | ';
$html .= '' . __( 'HBP', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'at_bats' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'at_bats' ] . ' | ';
$html .= '' . $player[ 'batting_average' ] . ' | ';
$html .= '' . $player[ 'hits' ] . ' | ';
$html .= '' . $player[ 'runs' ] . ' | ';
$html .= '' . $player[ 'rbi' ] . ' | ';
$html .= '' . $player[ 'doubles' ] . ' | ';
$html .= '' . $player[ 'triples' ] . ' | ';
$html .= '' . $player[ 'homeruns' ] . ' | ';
$html .= '' . $player[ 'strikeouts' ] . ' | ';
$html .= '' . $player[ 'walks' ] . ' | ';
$html .= '' . $player[ 'hit_by_pitch' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
if ( !empty( $stats ) ) {
foreach ( $stats as $key => $row ) {
$era[ $key ] = $row[ 'era' ];
}
array_multisort( $era, SORT_ASC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'IP', 'sports-bench' ) . ' | ';
$html .= '' . __( 'ERA', 'sports-bench' ) . ' | ';
$html .= '' . __( 'R', 'sports-bench' ) . ' | ';
$html .= '' . __( 'ER', 'sports-bench' ) . ' | ';
$html .= '' . __( 'H', 'sports-bench' ) . ' | ';
$html .= '' . __( 'K', 'sports-bench' ) . ' | ';
$html .= '' . __( 'BB', 'sports-bench' ) . ' | ';
$html .= '' . __( 'HPB', 'sports-bench' ) . ' | ';
$html .= '' . __( 'HR', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PC', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'pitch_count' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'innings_pitched' ] . ' | ';
$html .= '' . $player[ 'era' ] . ' | ';
$html .= '' . $player[ 'runs_allowed' ] . ' | ';
$html .= '' . $player[ 'earned_runs' ] . ' | ';
$html .= '' . $player[ 'hits_allowed' ] . ' | ';
$html .= '' . $player[ 'pitcher_strikeouts' ] . ' | ';
$html .= '' . $player[ 'pitcher_walks' ] . ' | ';
$html .= '' . $player[ 'pitcher_hit_batters' ] . ' | ';
$html .= '' . $player[ 'homeruns_allowed' ] . ' | ';
$html .= '' . $player[ 'pitch_count' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
' . sports_bench_show_stats_abbreviation_guide() . '
';
} elseif ( 'basketball' == $sport ) {
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= '' . __( 'REBOUNDS', 'sports-bench' ) . ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= ' | ';
$html .= '
';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'GP', 'sports-bench' ) . ' | ';
$html .= '' . __( 'ST', 'sports-bench' ) . ' | ';
$html .= '' . __( 'MIN', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FG', 'sports-bench' ) . ' | ';
$html .= '' . __( '3-PT', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FT', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PTS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'AVG', 'sports-bench' ) . ' | ';
$html .= '' . __( 'O-D', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TOTAL', 'sports-bench' ) . '' . __( 'REB', 'sports-bench' ) . ' | ';
$html .= '' . __( 'A', 'sports-bench' ) . ' | ';
$html .= '' . __( 'S', 'sports-bench' ) . ' | ';
$html .= '' . __( 'B', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TO', 'sports-bench' ) . ' | ';
$html .= '' . __( '+/-', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'games_played' ] > 0 ) {
if ( strlen( $player[ 'minutes' ] ) > 4 ) {
$seconds = substr( $player[ 'minutes' ], -2, 2 );
$time = substr_replace( $player[ 'minutes' ], '', -2, 2 );
$minutes = substr( $time, -2, 2 );
$time = substr_replace( $time, '', -2, 2 );
$times = array( $time, $minutes, $seconds );
$time = implode( ':', $times );
} else {
$seconds = substr( $player[ 'minutes' ], -2, 2 );
$minutes = substr_replace( $player[ 'minutes' ], '', -2, 2 );
$times = array( $minutes, $seconds );
$time = implode( ':', $times );
}
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'games_played' ] . ' | ';
$html .= '' . $player[ 'starts' ] . ' | ';
$html .= '' . $time . ' | ';
$html .= '' . $player[ 'fgm' ] . '-' . $player[ 'fga' ] . ' | ';
$html .= '' . $player[ '3pm' ] . '-' . $player[ '3pa' ] . ' | ';
$html .= '' . $player[ 'ftm' ] . '-' . $player[ 'fta' ] . ' | ';
$html .= '' . $player[ 'points' ] . ' | ';
$html .= '' . $player[ 'points_per_game' ] . ' | ';
$html .= '' . $player[ 'off_reb' ] . '-' . $player[ 'def_reb' ] . ' | ';
$html .= '' . $player[ 'tot_reb' ] . ' | ';
$html .= '' . $player[ 'assists' ] . ' | ';
$html .= '' . $player[ 'steals' ] . ' | ';
$html .= '' . $player[ 'blocks' ] . ' | ';
$html .= '' . $player[ 'to' ] . ' | ';
$html .= '' . $player[ 'plus_minus' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
' . sports_bench_show_stats_abbreviation_guide() . '
';
} elseif ( 'football' == $sport ) {
if ( !empty( $stats ) ) {
foreach ( $stats as $key => $row ) {
$passyards[ $key ] = $row[ 'pass_yards' ];
}
array_multisort( $passyards, SORT_DESC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'COMP', 'sports-bench' ) . ' | ';
$html .= '' . __( 'ATT', 'sports-bench' ) . ' | ';
$html .= '' . __( 'YARDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TD', 'sports-bench' ) . ' | ';
$html .= '' . __( 'INT', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'attempts' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'completions' ] . ' | ';
$html .= '' . $player[ 'attempts' ] . ' | ';
$html .= '' . $player[ 'pass_yards' ] . ' | ';
$html .= '' . $player[ 'pass_tds' ] . ' | ';
$html .= '' . $player[ 'pass_ints' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
if ( !empty( $stats ) ) {
foreach ( $stats as $key => $row ) {
$rushyards[ $key ] = $row[ 'rush_yards' ];
$rushes[ $key ] = $row[ 'rushes' ];
}
array_multisort( $rushyards, SORT_DESC, $rushes, SORT_DESC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'RUSHES', 'sports-bench' ) . ' | ';
$html .= '' . __( 'YARDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FUMBLES', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'rushes' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'rushes' ] . ' | ';
$html .= '' . $player[ 'rush_yards' ] . ' | ';
$html .= '' . $player[ 'rush_tds' ] . ' | ';
$html .= '' . $player[ 'rush_fumbles' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
if ( !empty( $stats ) ) {
foreach ( $stats as $key => $row ) {
$receiving_yards[ $key ] = $row[ 'receiving_yards' ];
$catches[ $key ] = $row[ 'catches' ];
}
array_multisort( $receiving_yards, SORT_DESC, $catches, SORT_DESC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'CATCHES', 'sports-bench' ) . ' | ';
$html .= '' . __( 'YARDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FUMBLES', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'catches' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats__row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'catches' ] . ' | ';
$html .= '' . $player[ 'receiving_yards' ] . ' | ';
$html .= '' . $player[ 'receiving_tds' ] . ' | ';
$html .= '' . $player[ 'receiving_fumbles' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
if ( !empty( $stats ) ){
foreach ( $stats as $key => $row ) {
$tackles[ $key ] = $row[ 'tackles' ];
$sacks[ $key ] = $row[ 'sacks' ];
$ints[ $key ] = $row[ 'ints' ];
$forced_fumbles[ $key ] = $row[ 'forced_fumbles' ];
$fumbles_recovered[ $key ] = $row[ 'fumbles_recovered' ];
$blocked[ $key ] = $row[ 'blocked' ];
$yards[ $key ] = $row[ 'yards' ];
}
array_multisort( $tackles, SORT_DESC, $sacks, SORT_DESC, $ints, SORT_DESC, $forced_fumbles, SORT_DESC, $fumbles_recovered, SORT_DESC, $blocked, SORT_DESC, $yards, SORT_DESC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'TCK', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TFL', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SACKS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'INTS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FF', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FR', 'sports-bench' ) . ' | ';
$html .= '' . __( 'BLK', 'sports-bench' ) . ' | ';
$html .= '' . __( 'YDS', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'tackles' ] > 0 or $player[ 'ints' ] > 0 or $player[ 'forced_fumbles' ] > 0 or $player[ 'fumbles_recovered' ] > 0 or $player[ 'blocked' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'tackles' ] . ' | ';
$html .= '' . $player[ 'tfl' ] . ' | ';
$html .= '' . $player[ 'sacks' ] . ' | ';
$html .= '' . $player[ 'ints' ] . ' | ';
$html .= '' . $player[ 'tds' ] . ' | ';
$html .= '' . $player[ 'forced_fumbles' ] . ' | ';
$html .= '' . $player[ 'fumbles_recovered' ] . ' | ';
$html .= '' . $player[ 'blocked' ] . ' | ';
$html .= '' . $player[ 'yards' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
if ( !empty( $stats ) ) {
foreach ( $stats as $key => $row ) {
$fga[ $key ] = $row[ 'fga' ];
$xpa[ $key ] = $row[ 'xpa' ];
}
array_multisort( $fga, SORT_DESC, $xpa, SORT_DESC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'FGM', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FGA', 'sports-bench' ) . ' | ';
$html .= '' . __( 'XPM', 'sports-bench' ) . ' | ';
$html .= '' . __( 'XPA', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TOUCHBACKS', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'fga' ] > 0 or $player[ 'xpa' ] > 0 or $player[ 'touchbacks' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'fgm' ] . ' | ';
$html .= '' . $player[ 'fga' ] . ' | ';
$html .= '' . $player[ 'xpm' ] . ' | ';
$html .= '' . $player[ 'xpa' ] . ' | ';
$html .= '' . $player[ 'touchbacks' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
if ( !empty( $stats ) ) {
foreach ( $stats as $key => $row ) {
$returnyards[ $key ] = $row[ 'return_yards' ];
$returns[ $key ] = $row[ 'returns' ];
}
array_multisort( $returnyards, SORT_DESC, $returns, SORT_DESC, $stats );
}
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'RETURNS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'YARDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TDS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FUMBLES', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'returns' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'returns' ] . ' | ';
$html .= '' . $player[ 'return_yards' ] . ' | ';
$html .= '' . $player[ 'return_tds' ] . ' | ';
$html .= '' . $player[ 'return_fumbles' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
' . sports_bench_show_stats_abbreviation_guide() . '
';
} elseif ( 'hockey' == $sport ) {
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'G', 'sports-bench' ) . ' | ';
$html .= '' . __( 'A', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PTS', 'sports-bench' ) . ' | ';
$html .= '' . __( '+/-', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SOG', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PEN', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PM', 'sports-bench' ) . ' | ';
$html .= '' . __( 'H', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SFT', 'sports-bench' ) . ' | ';
$html .= '' . __( 'TOI', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FO-FW', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( strlen( $player[ 'ice_time' ] ) > 4 ) {
$seconds = substr( $player[ 'ice_time' ], -2, 2 );
$time = substr_replace( $player[ 'ice_time' ], '', -2, 2 );
$minutes = substr( $time, -2, 2 );
$time = substr_replace( $time, '', -2, 2 );
$times = array( $time, $minutes, $seconds );
$time = implode( ':', $times );
} else {
$seconds = substr( $player[ 'ice_time' ], -2, 2 );
$minutes = substr_replace( $player[ 'ice_time' ], '', -2, 2 );
$times = array( $minutes, $seconds );
$time = implode( ':', $times );
}
if ( $player[ 'shots_faced' ] <= 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'goals' ] . ' | ';
$html .= '' . $player[ 'assists' ] . ' | ';
$html .= '' . $player[ 'points' ] . ' | ';
$html .= '' . $player[ 'plus_minus' ] . ' | ';
$html .= '' . $player[ 'sog' ] . ' | ';
$html .= '' . $player[ 'penalties' ] . ' | ';
$html .= '' . $player[ 'pen_minutes' ] . ' | ';
$html .= '' . $player[ 'hits' ] . ' | ';
$html .= '' . $player[ 'shifts' ] . ' | ';
$html .= '' . $time . ' | ';
$html .= '' . $player[ 'faceoffs' ] . '-' . $player[ 'faceoff_wins' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'SF', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SAVES', 'sports-bench' ) . ' | ';
$html .= '' . __( 'GA', 'sports-bench' ) . ' | ';
$html .= '' . __( 'GAA', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'shots_faced' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'shots_faced' ] . ' | ';
$html .= '' . $player[ 'saves' ] . ' | ';
$html .= '' . $player[ 'goals_allowed' ] . ' | ';
$html .= '' . $player[ 'goals_against_average' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
' . sports_bench_show_stats_abbreviation_guide() . '
';
} elseif ( 'rugby' == $sport ) {
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'GP', 'sports-bench' ) . ' | ';
$html .= '' . __( 'T', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PT', 'sports-bench' ) . ' | ';
$html .= '' . __( 'A', 'sports-bench' ) . ' | ';
$html .= '' . __( 'C', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PG', 'sports-bench' ) . ' | ';
$html .= '' . __( 'DK', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PTS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PC', 'sports-bench' ) . ' | ';
$html .= '' . __( 'MR', 'sports-bench' ) . ' | ';
$html .= '' . __( 'R', 'sports-bench' ) . ' | ';
$html .= '' . __( 'Y', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'games_played' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'games_played' ] . ' | ';
$html .= '' . $player[ 'tries' ] . ' | ';
$html .= '' . $player[ 'points' ] . ' | ';
$html .= '' . $player[ 'assists' ] . ' | ';
$html .= '' . $player[ 'conversions' ] . ' | ';
$html .= '' . $player[ 'pk_goals' ] . ' | ';
$html .= '' . $player[ 'drop_kicks' ] . ' | ';
$html .= '' . $player[ 'points' ] . ' | ';
$html .= '' . $player[ 'penalties_conceded' ] . ' | ';
$html .= '' . $player[ 'meters_run' ] . ' | ';
$html .= '' . $player[ 'red_cards' ] . ' | ';
$html .= '' . $player[ 'yellow_cards' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
' . sports_bench_show_stats_abbreviation_guide() . '
';
} elseif ( 'soccer' == $sport ) {
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'MIN', 'sports-bench' ) . ' | ';
$html .= '' . __( 'G', 'sports-bench' ) . ' | ';
$html .= '' . __( 'A', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SH', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SOG', 'sports-bench' ) . ' | ';
$html .= '' . __( 'F', 'sports-bench' ) . ' | ';
$html .= '' . __( 'FS', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'shots_faced' ] <= 0 and $player[ 'minutes' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'minutes' ] . ' | ';
$html .= '' . $player[ 'goals' ] . ' | ';
$html .= '' . $player[ 'assists' ] . ' | ';
$html .= '' . $player[ 'shots' ] . ' | ';
$html .= '' . $player[ 'sog' ] . ' | ';
$html .= '' . $player[ 'fouls' ] . ' | ';
$html .= '' . $player[ 'fouls_suffered' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'MIN', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SF', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SV', 'sports-bench' ) . ' | ';
$html .= '' . __( 'GA', 'sports-bench' ) . ' | ';
$html .= '' . __( 'GAA', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'shots_faced' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'minutes' ] . ' | ';
$html .= '' . $player[ 'shots_faced' ] . ' | ';
$html .= '' . $player[ 'shots_saved' ] . ' | ';
$html .= '' . $player[ 'goals_allowed' ] . ' | ';
$html .= '' . $player[ 'goals_against_average' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
' . sports_bench_show_stats_abbreviation_guide() . '
';
} elseif ( 'volleyball' == $sport ) {
$html .= '
';
$html .= '';
$table_head_styles = apply_filters( 'sports_bench_team_player_stats_head_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= ' | ';
$html .= '' . __( 'GP', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SP', 'sports-bench' ) . ' | ';
$html .= '' . __( 'PTS', 'sports-bench' ) . ' | ';
$html .= '' . __( 'HIT %', 'sports-bench' ) . ' | ';
$html .= '' . __( 'K', 'sports-bench' ) . ' | ';
$html .= '' . __( 'ATT', 'sports-bench' ) . ' | ';
$html .= '' . __( 'HE', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SET E', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SET A', 'sports-bench' ) . ' | ';
$html .= '' . __( 'S', 'sports-bench' ) . ' | ';
$html .= '' . __( 'SE', 'sports-bench' ) . ' | ';
$html .= '' . __( 'ACE', 'sports-bench' ) . ' | ';
$html .= '' . __( 'B', 'sports-bench' ) . ' | ';
$html .= '' . __( 'BA', 'sports-bench' ) . ' | ';
$html .= '' . __( 'BE', 'sports-bench' ) . ' | ';
$html .= '' . __( 'DIG', 'sports-bench' ) . ' | ';
$html .= '' . __( 'RE', 'sports-bench' ) . ' | ';
$html .= '
';
$html .= '';
$html .= '';
foreach( $stats as $player ) {
if ( $player[ 'games_played' ] > 0 ) {
$table_row_styles = apply_filters( 'sports_bench_team_player_stats_row', '', $stats[ 0 ][ 'team_id' ] );
$html .= '';
$html .= '' . $player[ 'player_name' ] . ' | ';
$html .= '' . $player[ 'games_played' ] . ' | ';
$html .= '' . $player[ 'sets_played' ] . ' | ';
$html .= '' . $player[ 'points' ] . ' | ';
$html .= '' . $player[ 'hitting_percent' ] . ' | ';
$html .= '' . $player[ 'kills' ] . ' | ';
$html .= '' . $player[ 'attacks' ] . ' | ';
$html .= '' . $player[ 'hitting_errors' ] . ' | ';
$html .= '' . $player[ 'set_errors' ] . ' | ';
$html .= '' . $player[ 'set_attempts' ] . ' | ';
$html .= '' . $player[ 'serves' ] . ' | ';
$html .= '' . $player[ 'serve_errors' ] . ' | ';
$html .= '' . $player[ 'aces' ] . ' | ';
$html .= '' . $player[ 'blocks' ] . ' | ';
$html .= '' . $player[ 'block_attempts' ] . ' | ';
$html .= '' . $player[ 'block_errors' ] . ' | ';
$html .= '' . $player[ 'digs' ] . ' | ';
$html .= '' . $player[ 'rec_errors' ] . ' | ';
$html .= '
';
}
}
$html .= '';
$html .= '
';
$html .= '
' . sports_bench_show_stats_abbreviation_guide() . '
';
} else {
}
return $html;
}
add_filter( 'sports_bench_team_stats_table', 'sports_bench_do_team_stats_table', 10, 4 );