Calculate sum/average statistics, delete duplicate configs, sort player list by number

This commit is contained in:
Brian Miyaji
2014-01-25 05:42:33 +11:00
parent a4aa963755
commit 8db2a05fa3
7 changed files with 177 additions and 81 deletions

View File

@@ -54,7 +54,7 @@ function sportspress_column_details_meta( $post ) {
<p class="sp-equation-selector">
<?php
foreach ( $equation as $piece ):
sportspress_get_equation_selector( $post->ID, $piece, array( 'team_event', 'result', 'outcome' ) );
sportspress_equation_selector( $post->ID, $piece, array( 'team_event', 'result', 'outcome' ) );
endforeach;
?>
</p>

View File

@@ -25,7 +25,7 @@ function sportspress_statistic_edit_columns() {
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_positions' => __( 'Positions', 'sportspress' ),
'sp_equation' => __( 'Equation', 'sportspress' ),
'sp_calculate' => __( 'Calculate', 'sportspress' ),
);
return $columns;
}
@@ -36,15 +36,11 @@ function sportspress_statistic_meta_init() {
}
function sportspress_statistic_equation_meta( $post ) {
$equation = explode( ' ', get_post_meta( $post->ID, 'sp_equation', true ) );
$calculate = get_post_meta( $post->ID, 'sp_calculate', true );
?>
<p><strong><?php _e( 'Equation', 'sportspress' ); ?></strong></p>
<p class="sp-equation-selector">
<?php
foreach ( $equation as $piece ):
sportspress_get_equation_selector( $post->ID, $piece, array( 'player_event' ) );
endforeach;
?>
<p><strong><?php _e( 'Calculate', 'sportspress' ); ?></strong></p>
<p class="sp-calculate-selector">
<?php sportspress_calculate_selector( $post->ID, $calculate ); ?>
</p>
<?php
sportspress_nonce();