Fix league table issue with team ID of 0

This commit is contained in:
ThemeBoy
2013-12-02 20:37:07 +11:00
parent 6a9c2bf79a
commit 9fa6495ebe
2 changed files with 7 additions and 1 deletions

View File

@@ -104,7 +104,7 @@ function sp_list_stats_meta( $post ) {
$totals[ $player_id ][ $key ] = 0; $totals[ $player_id ][ $key ] = 0;
endforeach; endforeach;
// Get statis metrics // Get static metrics
$static = get_post_meta( $player_id, 'sp_metrics', true ); $static = get_post_meta( $player_id, 'sp_metrics', true );
// Create placeholders entry for the player // Create placeholders entry for the player
@@ -165,6 +165,9 @@ function sp_list_stats_meta( $post ) {
// Generate placeholder values for each team // Generate placeholder values for each team
foreach ( $player_ids as $player_id ): foreach ( $player_ids as $player_id ):
if ( ! $player_id )
continue;
foreach ( $equations as $key => $value ): foreach ( $equations as $key => $value ):
if ( sp_array_value( $placeholders[ $player_id ], $key, '' ) == '' ): if ( sp_array_value( $placeholders[ $player_id ], $key, '' ) == '' ):

View File

@@ -154,6 +154,9 @@ function sp_table_stats_meta( $post ) {
// Fill in empty placeholder values for each team // Fill in empty placeholder values for each team
foreach ( $team_ids as $team_id ): foreach ( $team_ids as $team_id ):
if ( ! $team_id )
continue;
foreach ( $equations as $key => $value ): foreach ( $equations as $key => $value ):
if ( sp_array_value( $placeholders[ $team_id ], $key, '' ) == '' ): if ( sp_array_value( $placeholders[ $team_id ], $key, '' ) == '' ):
$placeholders[ $team_id ][ $key ] = $eos->solveIF( str_replace( ' ', '', $value ), $totals[ $team_id ] ); $placeholders[ $team_id ][ $key ] = $eos->solveIF( str_replace( ' ', '', $value ), $totals[ $team_id ] );