Fix presets, config post types and Japanese translations

This commit is contained in:
Brian Miyaji
2014-01-05 20:37:08 +11:00
parent c370e352a4
commit f49ec03546
34 changed files with 1507 additions and 1914 deletions

View File

@@ -23,9 +23,11 @@ function sp_column_edit_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' ),
'sp_format' => __( 'Format', 'sportspress' ),
'sp_precision' => __( 'Precision', 'sportspress' ),
'sp_equation' => __( 'Equation', 'sportspress' ),
'sp_order' => __( 'Sort Order', 'sportspress' ),
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' )
);
return $columns;
}
@@ -36,15 +38,34 @@ function sp_column_meta_init() {
}
function sp_column_details_meta( $post ) {
global $sportspress_config_formats;
$equation = explode( ' ', get_post_meta( $post->ID, 'sp_equation', true ) );
$order = get_post_meta( $post->ID, 'sp_order', true );
$priority = get_post_meta( $post->ID, 'sp_priority', true );
$precision = get_post_meta( $post->ID, 'sp_precision', true );
$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
// Defaults
if ( $precision == '' ) $precision = 1;
?>
<p><strong><?php _e( 'Key', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>">
</p>
<p><strong><?php _e( 'Format', 'sportspress' ); ?></strong></p>
<p class="sp-format-selector">
<select name="sp_format">
<?php
foreach ( $sportspress_config_formats as $key => $value ):
printf( '<option value="%s" %s>%s</option>', $key, selected( true, $key == $priority, false ), $value );
endforeach;
?>
</select>
</p>
<p><strong><?php _e( 'Precision', 'sportspress' ); ?></strong></p>
<p class="sp-precision-selector">
<input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>" placeholder="1">
</p>
<p><strong><?php _e( 'Equation', 'sportspress' ); ?></strong></p>
<p class="sp-equation-selector">
<?php
@@ -63,7 +84,7 @@ function sp_column_details_meta( $post ) {
endforeach;
?>
</select>
<select name="sp_order"<?php if ( ! $priority ): ?> disabled="disabled;"<?php endif; ?>>
<select name="sp_order">
<?php
$options = array( 'DESC' => __( 'Descending', 'sportspress' ), 'ASC' => __( 'Ascending', 'sportspress' ) );
foreach ( $options as $key => $value ):
@@ -72,14 +93,6 @@ function sp_column_details_meta( $post ) {
?>
</select>
</p>
<p><strong><?php _e( 'Precision', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>">
</p>
<p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_abbreviation" type="text" size="4" id="sp_abbreviation" value="<?php echo $abbreviation; ?>">
</p>
<?php
sp_nonce();
}

View File

@@ -24,7 +24,6 @@ function sp_outcome_edit_columns() {
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' ),
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' )
);
return $columns;
}
@@ -35,11 +34,10 @@ function sp_outcome_meta_init() {
}
function sp_outcome_details_meta( $post ) {
$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
?>
<p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
?>
<p><strong><?php _e( 'Key', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_abbreviation" type="text" size="4" id="sp_abbreviation" value="<?php echo $abbreviation; ?>">
<input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>">
</p>
<?php
sp_nonce();

View File

@@ -24,7 +24,7 @@ function sp_result_edit_columns() {
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' ),
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' )
'sp_format' => __( 'Format', 'sportspress' ),
);
return $columns;
}
@@ -35,11 +35,21 @@ function sp_result_meta_init() {
}
function sp_result_details_meta( $post ) {
$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
global $sportspress_config_formats;
?>
<p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
<p><strong><?php _e( 'Key', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_abbreviation" type="text" size="4" id="sp_abbreviation" value="<?php echo $abbreviation; ?>">
<input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>">
</p>
<p><strong><?php _e( 'Format', 'sportspress' ); ?></strong></p>
<p class="sp-format-selector">
<select name="sp_format">
<?php
foreach ( $sportspress_config_formats as $key => $value ):
printf( '<option value="%s" %s>%s</option>', $key, selected( true, $key == $priority, false ), $value );
endforeach;
?>
</select>
</p>
<?php
sp_nonce();

View File

@@ -23,28 +23,50 @@ function sp_statistic_edit_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => __( 'Label', 'sportspress' ),
'sp_key' => __( 'Key', 'sportspress' ),
'sp_format' => __( 'Format', 'sportspress' ),
'sp_precision' => __( 'Precision', 'sportspress' ),
'sp_equation' => __( 'Equation', 'sportspress' ),
'sp_order' => __( 'Sort Order', 'sportspress' ),
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' )
);
return $columns;
}
add_filter( 'manage_edit-sp_statistic_columns', 'sp_statistic_edit_columns' );
function sp_statistic_meta_init() {
add_meta_box( 'sp_equationdiv', __( 'Equation', 'sportspress' ), 'sp_statistic_equation_meta', 'sp_statistic', 'normal', 'high' );
add_meta_box( 'sp_equationdiv', __( 'Details', 'sportspress' ), 'sp_statistic_equation_meta', 'sp_statistic', 'normal', 'high' );
}
function sp_statistic_equation_meta( $post ) {
global $sportspress_config_formats;
$equation = explode( ' ', get_post_meta( $post->ID, 'sp_equation', true ) );
$order = get_post_meta( $post->ID, 'sp_order', true );
$priority = get_post_meta( $post->ID, 'sp_priority', true );
$precision = get_post_meta( $post->ID, 'sp_precision', true );
$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
// Defaults
if ( $precision == '' ) $precision = 1;
?>
<p><strong><?php _e( 'Key', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>">
</p>
<p><strong><?php _e( 'Format', 'sportspress' ); ?></strong></p>
<p class="sp-format-selector">
<select name="sp_format">
<?php
foreach ( $sportspress_config_formats as $key => $value ):
printf( '<option value="%s" %s>%s</option>', $key, selected( true, $key == $priority, false ), $value );
endforeach;
?>
</select>
</p>
<p><strong><?php _e( 'Precision', 'sportspress' ); ?></strong></p>
<p class="sp-precision-selector">
<input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>" placeholder="1">
</p>
<p><strong><?php _e( 'Equation', 'sportspress' ); ?></strong></p>
<p class="sp-equation-selector">
<?php
foreach ( $equation as $piece ):
@@ -70,13 +92,6 @@ function sp_statistic_equation_meta( $post ) {
endforeach;
?>
</select>
<p><strong><?php _e( 'Precision', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>">
</p>
<p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_abbreviation" type="text" size="4" id="sp_abbreviation" value="<?php echo $abbreviation; ?>">
</p>
<?php
sp_nonce();

View File

@@ -154,8 +154,7 @@ function sp_team_columns_meta( $post ) {
if ( $outcomes ):
$outcome = $outcomes[0];
$abbreviation = get_post_meta( $outcome->ID, 'sp_abbreviation', true );
$totals['streak'] = ( $abbreviation ? $abbreviation : $outcome->post_title ) . $streak['count'];
$totals['streak'] = $outcome->post_title . $streak['count'];
endif;
// Generate array of placeholder values for each league

View File

@@ -7,181 +7,159 @@ $sportspress_sports['baseball'] = array(
// Columns
'sp_column' => array(
array(
'post_title' => __( 'Wins', 'sportspress' ),
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$win',
'sp_abbreviation' => __( 'W', 'sportspress' ),
'sp_equation' => '$w',
'sp_priority' => 1,
'sp_order' => 'DESC'
)
'sp_order' => 'DESC',
),
),
array(
'post_title' => __( 'Losses', 'sportspress' ),
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$loss',
'sp_abbreviation' => __( 'L', 'sportspress' ),
'sp_equation' => '$l',
'sp_priority' => 2,
'sp_order' => 'ASC'
)
'sp_order' => 'ASC',
),
),
array(
'post_title' => __( 'Win Percentage', 'sportspress' ),
'post_title' => 'Pct',
'post_name' => 'pct',
'meta' => array(
'sp_equation' => '$win / $eventsplayed',
'sp_abbreviation' => __( 'Pct', 'sportspress' )
)
'sp_equation' => '$w / $eventsplayed',
),
),
array(
'post_title' => __( 'Games Back', 'sportspress' ),
'post_title' => 'GB',
'post_name' => 'gb',
'meta' => array(
'sp_equation' => '( $winmax + $loss - $win - $lossmax ) / 2',
'sp_abbreviation' => __( 'GB', 'sportspress' )
)
'sp_equation' => '( $wmax + $l - $w - $lmax ) / 2',
),
),
array(
'post_title' => __( 'Runs Scored', 'sportspress' ),
'post_title' => 'RS',
'post_name' => 'rs',
'meta' => array(
'sp_equation' => '$rfor',
'sp_abbreviation' => __( 'RS', 'sportspress' ),
'sp_priority' => 3,
'sp_order' => 'DESC'
)
'sp_order' => 'DESC',
),
),
array(
'post_title' => __( 'Runs Against', 'sportspress' ),
'post_title' => 'RA',
'post_name' => 'ra',
'meta' => array(
'sp_equation' => '$ragainst',
'sp_abbreviation' => __( 'RA', 'sportspress' )
)
),
),
array(
'post_title' => __( 'Streak', 'sportspress' ),
'post_title' => 'Strk',
'post_name' => 'strk',
'meta' => array(
'sp_equation' => '$streak',
'sp_abbreviation' => __( 'Strk', 'sportspress' )
)
)
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'meta' => array(
'sp_equation' => '$eventsplayed'
)
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'meta' => array( 'sp_equation' => '' )
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( '1st Inning', 'sportspress' ),
'post_title' => '1',
'post_name' => 'first',
'meta' => array(
'sp_abbreviation' => __( '1', 'sportspress' )
)
),
),
array(
'post_title' => __( '2nd Inning', 'sportspress' ),
'post_title' => '2',
'post_name' => 'second',
'meta' => array(
'sp_abbreviation' => __( '2', 'sportspress' )
)
),
),
array(
'post_title' => __( '3rd Inning', 'sportspress' ),
'post_title' => '3',
'post_name' => 'third',
'meta' => array(
'sp_abbreviation' => __( '3', 'sportspress' )
)
),
),
array(
'post_title' => __( '4th Inning', 'sportspress' ),
'post_title' => '4',
'post_name' => 'fourth',
'meta' => array(
'sp_abbreviation' => __( '4', 'sportspress' )
)
),
),
array(
'post_title' => __( '5th Inning', 'sportspress' ),
'post_title' => '5',
'post_name' => 'fifth',
'meta' => array(
'sp_abbreviation' => __( '5', 'sportspress' )
)
),
),
array(
'post_title' => __( '6th Inning', 'sportspress' ),
'post_title' => '6',
'post_name' => 'sixth',
'meta' => array(
'sp_abbreviation' => __( '6', 'sportspress' )
)
),
),
array(
'post_title' => __( '7th Inning', 'sportspress' ),
'post_title' => '7',
'post_name' => 'seventh',
'meta' => array(
'sp_abbreviation' => __( '7', 'sportspress' )
)
),
),
array(
'post_title' => __( '8th Inning', 'sportspress' ),
'post_title' => '8',
'post_name' => 'eighth',
'meta' => array(
'sp_abbreviation' => __( '8', 'sportspress' )
)
),
),
array(
'post_title' => __( '9th Inning', 'sportspress' ),
'post_title' => '9',
'post_name' => 'ninth',
'meta' => array(
'sp_abbreviation' => __( '9', 'sportspress' )
)
),
),
array(
'post_title' => __( 'Extra Innings', 'sportspress' ),
'post_title' => '&nbsp;',
'post_name' => 'extra',
'meta' => array(
'sp_abbreviation' => __( '&nbsp;', 'sportspress' )
)
),
),
array(
'post_title' => __( 'Runs', 'sportspress' ),
'post_title' => 'R',
'post_name' => 'r',
'meta' => array(
'sp_abbreviation' => __( 'R', 'sportspress' )
)
),
),
array(
'post_title' => __( 'Hits', 'sportspress' ),
'post_title' => 'H',
'post_name' => 'h',
'meta' => array(
'sp_abbreviation' => __( 'H', 'sportspress' )
)
),
),
array(
'post_title' => __( 'Errors', 'sportspress' ),
'post_title' => 'E',
'post_name' => 'e',
'meta' => array(
'sp_abbreviation' => __( 'E', 'sportspress' )
)
)
),
),
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_abbreviation' => __( 'W', 'sportspress' )
)
),
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_abbreviation' => __( 'L', 'sportspress' )
)
)
)
)
),
),
),
),
);

View File

@@ -1,127 +1,87 @@
<?php
global $sportspress_sports;
$sportspress_sports['baseball'] = array(
'name' => __( 'Baseball', 'sportspress' ),
$sportspress_sports['basketball'] = array(
'name' => __( 'Basketball', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => __( 'Wins', 'sportspress' ),
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$win',
'sp_abbreviation' => __( 'W', 'sportspress' )
)
'sp_equation' => '$w',
),
),
array(
'post_title' => __( 'Losses', 'sportspress' ),
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$loss',
'sp_abbreviation' => __( 'L', 'sportspress' )
)
'sp_equation' => '$l',
),
),
array(
'post_title' => __( 'Win Percentage', 'sportspress' ),
'post_title' => 'Pct',
'post_name' => 'pct',
'meta' => array(
'sp_equation' => '$win / $eventsplayed',
'sp_abbreviation' => __( 'Pct', 'sportspress' )
)
'sp_equation' => '$w / $eventsplayed',
),
),
array(
'post_title' => __( 'Games Behind', 'sportspress' ),
'post_title' => 'GB',
'post_name' => 'gb',
'meta' => array(
'sp_equation' => '( $winmax + $loss - $win - $lossmax ) / 2',
'sp_abbreviation' => __( 'GB', 'sportspress' )
)
'sp_equation' => '( $wmax + $l - $w - $lmax ) / 2',
),
),
array(
'post_title' => __( 'Streak', 'sportspress' ),
'post_title' => 'Strk',
'post_name' => 'strk',
'meta' => array(
'sp_equation' => '$streak',
'sp_abbreviation' => __( 'Strk', 'sportspress' )
)
)
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'meta' => array(
'sp_equation' => '$eventsplayed'
)
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'meta' => array(
'sp_equation' => ''
)
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'meta' => array(
'sp_equation' => ''
)
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'meta' => array(
'sp_equation' => ''
)
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'meta' => array(
'sp_equation' => ''
)
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( '1st Quarter', 'sportspress' ),
'meta' => array(
'sp_abbreviation' => __( '1', 'sportspress' )
)
'post_title' => '1',
'post_name' => 'first',
),
array(
'post_title' => __( '2nd Quarter', 'sportspress' ),
'meta' => array(
'sp_abbreviation' => __( '2', 'sportspress' )
)
'post_title' => '2',
'post_name' => 'second',
),
array(
'post_title' => __( '3rd Quarter', 'sportspress' ),
'meta' => array(
'sp_abbreviation' => __( '3', 'sportspress' )
)
'post_title' => '3',
'post_name' => 'third',
),
array(
'post_title' => __( '4th Quarter', 'sportspress' ),
'meta' => array(
'sp_abbreviation' => __( '4', 'sportspress' )
)
'post_title' => '4',
'post_name' => 'fourth',
),
array(
'post_title' => __( 'Overtime', 'sportspress' ),
'meta' => array(
'sp_abbreviation' => __( '&nbsp;', 'sportspress' )
)
'post_title' => 'OT',
'post_name' => 'ot',
),
array(
'post_title' => __( 'Total', 'sportspress' ),
'meta' => array(
'sp_abbreviation' => __( 'T', 'sportspress' )
)
)
'post_title' => 'T',
'post_name' => 't',
),
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' )
'post_title' => 'W',
'post_name' => 'w'
),
array(
'post_title' => __( 'Loss', 'sportspress' )
)
)
)
'post_title' => 'L',
'post_name' => 'l'
),
),
),
);

View File

@@ -4,106 +4,68 @@ global $sportspress_sports;
$sportspress_sports['cricket'] = array(
'name' => __( 'Cricket', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => 'M',
'post_name' => 'm',
'meta' => array(
'sp_equation' => '$eventsplayed',
),
),
array(
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
),
),
array(
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
),
),
array(
'post_title' => 'T',
'post_name' => 't',
'meta' => array(
'sp_equation' => '$t',
),
),
array(
'post_title' => 'N/R',
'post_name' => 'nr',
'meta' => array(
'sp_equation' => '$nr',
),
),
array(
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '$w * 2 + $nr',
'sp_priority' => '1',
'sp_order' => 'DESC',
),
),
array(
'post_title' => 'RR',
'post_name' => 'rr',
'meta' => array(
'sp_equation' => '( $rfor / $oagainst ) - ( $ragainst / $ofor )',
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
// Outcomes
'sp_outcome' => array(
),
),
);

View File

@@ -4,101 +4,59 @@ global $sportspress_sports;
$sportspress_sports['football'] = array(
'name' => __( 'American Football', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
),
),
array(
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
),
),
array(
'post_title' => 'Pct',
'post_name' => 'pct',
'meta' => array(
'sp_equation' => '$w / $eventsplayed',
),
),
array(
'post_title' => 'PF',
'post_name' => 'pf',
'meta' => array(
'sp_equation' => '$ptsfor',
),
),
array(
'post_title' => 'PA',
'post_name' => 'pa',
'meta' => array(
'sp_equation' => '$ptsagainst',
),
),
array(
'post_title' => 'Str',
'post_name' => 'strk',
'meta' => array(
'sp_equation' => '$streak',
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Touchdowns', 'sportspress' ),
'post_name' => 'touchdowns'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'T', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'PCT', 'sportspress' ),
'post_name' => 'pct',
'meta' => array( 'sp_equation' => '$win / $eventsplayed', 'sp_priority' => '1', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PF', 'sportspress' ),
'post_name' => 'pf',
'meta' => array( 'sp_equation' => '$pointsfor', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PA', 'sportspress' ),
'post_name' => 'pa',
'meta' => array( 'sp_equation' => '$pointsagainst' )
),
array(
'post_title' => __( 'STRK', 'sportspress' ),
'post_name' => 'strk',
'meta' => array( 'sp_equation' => '$streak' )
)
)
)
// Outcomes
'sp_outcome' => array(
),
),
);

View File

@@ -4,106 +4,73 @@ global $sportspress_sports;
$sportspress_sports['footy'] = array(
'name' => __( 'Australian Rules Football', 'sportspress' ),
'posts' => array(
// Statistics
'sp_statistic' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
'post_title' => 'P',
'post_name' => 'p',
'meta' => array(
'sp_equation' => '$eventsplayed',
)
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
)
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
)
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'D',
'post_name' => 'd',
'meta' => array(
'sp_equation' => '$d',
)
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'F',
'post_name' => 'f',
'meta' => array(
'sp_equation' => '$ptsfor',
)
),
array(
'post_title' => 'A',
'post_name' => 'a',
'meta' => array(
'sp_equation' => '$ptsagainst',
)
),
array(
'post_title' => 'Pct',
'post_name' => 'pct',
'meta' => array(
'sp_equation' => '( $w / $eventsplayed ) * 10 * 10',
)
),
array(
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '$pts',
)
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
// Statistics
'sp_statistic' => array(
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
// Outcomes
'sp_outcome' => array(
),
),
);

View File

@@ -4,106 +4,66 @@ global $sportspress_sports;
$sportspress_sports['gaming'] = array(
'name' => __( 'Competitive Gaming', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
),
),
array(
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
),
),
array(
'post_title' => 'Pct',
'post_name' => 'pct',
'meta' => array(
'sp_equation' => '$w / $eventsplayed',
),
),
array(
'post_title' => 'Strk',
'post_name' => 'strk',
'meta' => array(
'sp_equation' => '$strk',
),
),
array(
'post_title' => 'XP',
'post_name' => 'xp',
'meta' => array(
'sp_equation' => '$xp',
),
),
array(
'post_title' => 'Rep',
'post_name' => 'rep',
'meta' => array(
'sp_equation' => '$rep / $eventsplayed',
),
),
array(
'post_title' => 'Ping',
'post_name' => 'ping',
'meta' => array(
'sp_equation' => '$ping / $eventsplayed',
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
// Outcomes
'sp_outcome' => array(
),
),
);

View File

@@ -4,106 +4,52 @@ global $sportspress_sports;
$sportspress_sports['golf'] = array(
'name' => __( 'Golf', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
'post_title' => __( 'Events', 'sportspress' ),
'post_name' => 'events',
'meta' => array(
'sp_equation' => '$eventsplayed',
),
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'Avg',
'post_name' => 'avg',
'meta' => array(
'sp_equation' => '$ptsfor / $eventsplayed',
),
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
'post_title' => __( 'Total', 'sportspress' ),
'post_name' => 'total',
'meta' => array(
'sp_equation' => '$ptsfor',
),
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'PL',
'post_name' => 'lost',
'meta' => array(
'sp_equation' => '$ptsagainst',
),
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
'post_title' => 'PG',
'post_name' => 'gained',
'meta' => array(
'sp_equation' => '$ptsfor',
),
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
// Outcomes
'sp_outcome' => array(
),
),
);

View File

@@ -1,109 +0,0 @@
<?php
global $sportspress_sports;
$sportspress_sports['handball'] = array(
'name' => __( 'Handball', 'sportspress' ),
'posts' => array(
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
);

View File

@@ -4,106 +4,85 @@ global $sportspress_sports;
$sportspress_sports['hockey'] = array(
'name' => __( 'Hockey', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => 'GP',
'post_name' => 'gp',
'meta' => array(
'sp_equation' => '$eventsplayed',
),
),
array(
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
),
),
array(
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
),
),
array(
'post_title' => 'OT',
'post_name' => 'ot',
'meta' => array(
'sp_equation' => '$ot',
),
),
array(
'post_title' => 'P',
'post_name' => 'p',
'meta' => array(
'sp_equation' => '$w * 2 + $ot',
),
),
array(
'post_title' => 'GF',
'post_name' => 'gf',
'meta' => array(
'sp_equation' => '$gfor',
),
),
array(
'post_title' => 'GA',
'post_name' => 'ga',
'meta' => array(
'sp_equation' => '$gagainst',
),
),
array(
'post_title' => 'Strk',
'post_name' => 'strk',
'meta' => array(
'sp_equation' => '$streak',
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Results
'sp_result' => array(
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
'post_title' => 'W',
'post_name' => 'w'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
'post_title' => 'L',
'post_name' => 'l'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
'post_title' => 'OT',
'post_name' => 'ot'
),
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
),
);

View File

@@ -1,21 +0,0 @@
<?php
$sportspress_sports = array();
include_once dirname( __FILE__ ) . '/soccer.php';
include_once dirname( __FILE__ ) . '/football.php';
include_once dirname( __FILE__ ) . '/footy.php';
include_once dirname( __FILE__ ) . '/baseball.php';
include_once dirname( __FILE__ ) . '/basketball.php';
include_once dirname( __FILE__ ) . '/gaming.php';
include_once dirname( __FILE__ ) . '/cricket.php';
include_once dirname( __FILE__ ) . '/golf.php';
include_once dirname( __FILE__ ) . '/handball.php';
include_once dirname( __FILE__ ) . '/hockey.php';
include_once dirname( __FILE__ ) . '/racing.php';
include_once dirname( __FILE__ ) . '/rugby.php';
include_once dirname( __FILE__ ) . '/swimming.php';
include_once dirname( __FILE__ ) . '/tennis.php';
include_once dirname( __FILE__ ) . '/volleyball.php';
$sportspress_sports[] = array( 'name' => __( 'Custom', 'sportspress' ), 'posts' => array() );
?>

View File

@@ -4,106 +4,54 @@ global $sportspress_sports;
$sportspress_sports['racing'] = array(
'name' => __( 'Racing', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '$ptsfor',
),
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'B',
'post_name' => 'b',
'meta' => array(
'sp_equation' => '$ptsmax - $ptsfor',
),
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'S',
'post_name' => 's',
'meta' => array(
'sp_equation' => '$eventsplayed',
),
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
'sp_priority' => '1',
'sp_order' => 'DESC',
),
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
'post_title' => 'DNF',
'post_name' => 'dnf',
'meta' => array(
'sp_equation' => '$dnf',
),
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
// Outcomes
'sp_outcome' => array(
),
),
);

View File

@@ -4,106 +4,82 @@ global $sportspress_sports;
$sportspress_sports['rugby'] = array(
'name' => __( 'Rugby', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => 'P',
'post_name' => 'p',
'meta' => array(
'sp_equation' => '$eventsplayed',
),
),
array(
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
),
),
array(
'post_title' => 'D',
'post_name' => 'd',
'meta' => array(
'sp_equation' => '$d',
),
),
array(
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
),
),
array(
'post_title' => 'B',
'post_name' => 'b',
'meta' => array(
'sp_equation' => '$b',
),
),
array(
'post_title' => 'F',
'post_name' => 'f',
'meta' => array(
'sp_equation' => '$ptsfor',
),
),
array(
'post_title' => 'A',
'post_name' => 'a',
'meta' => array(
'sp_equation' => '$ptsagainst',
),
),
array(
'post_title' => '+/-',
'post_name' => 'pd',
'meta' => array(
'sp_equation' => '$ptsfor - $ptsagainst',
),
),
array(
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '( $w + $b ) * 2 + $d',
'sp_priority' => '1',
'sp_order' => 'DESC',
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
// Outcomes
'sp_outcome' => array(
),
),
);

View File

@@ -7,116 +7,158 @@ $sportspress_sports['soccer'] = array(
// Table Columns
'sp_column' => array(
array(
'post_title' => __( 'Games Played', 'sportspress' ),
'post_title' => 'P',
'post_name' => 'p',
'meta' => array(
'sp_equation' => '$eventsplayed',
'sp_abbreviation' => __( 'GP', 'sportspress' )
)
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Wins', 'sportspress' ),
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$win',
'sp_abbreviation' => __( 'W', 'sportspress' )
)
'sp_equation' => '$w',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Draws', 'sportspress' ),
'post_title' => 'D',
'post_name' => 'd',
'meta' => array(
'sp_equation' => '$draw',
'sp_abbreviation' => __( 'D', 'sportspress' )
)
'sp_equation' => '$d',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Losses', 'sportspress' ),
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$loss',
'sp_abbreviation' => __( 'L', 'sportspress' )
)
'sp_equation' => '$l',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Goals For', 'sportspress' ),
'post_title' => 'F',
'post_name' => 'f',
'meta' => array(
'sp_equation' => '$goalsfor',
'sp_priority' => '3',
'sp_order' => 'DESC',
'sp_abbreviation' => __( 'GF', 'sportspress' )
)
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Goals Against', 'sportspress' ),
'post_title' => 'A',
'post_name' => 'a',
'meta' => array(
'sp_equation' => '$goalsagainst',
'sp_abbreviation' => __( 'GA', 'sportspress' )
)
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Goal Difference', 'sportspress' ),
'post_title' => 'GD',
'post_name' => 'gd',
'meta' => array(
'sp_equation' => '$goalsfor - $goalsagainst',
'sp_priority' => '2',
'sp_order' => 'DESC',
'sp_abbreviation' => __( 'GD', 'sportspress' )
)
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Points', 'sportspress' ),
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '$win * 3 + $draw',
'sp_equation' => '$w * 3 + $d',
'sp_priority' => '1',
'sp_order' => 'DESC',
'sp_abbreviation' => __( 'Pts', 'sportspress' )
)
)
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
),
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array(
'sp_equation' => '$eventsplayed'
)
'sp_equation' => '$eventsplayed',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array(
'sp_equation' => '',
'sp_priority' => '1',
'sp_order' => 'DESC'
)
'sp_order' => 'DESC',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Assists', 'sportspress' )
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' )
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => __( 'Red Cards', 'sportspress' )
)
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' )
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array(
'sp_format' => 'integer',
),
),
array(
'post_title' => __( '1st Half', 'sportspress' )
),
array(
'post_title' => __( '2nd Half', 'sportspress' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' )
'post_title' => 'W',
'post_name' => 'w',
),
array(
'post_title' => __( 'Draw', 'sportspress' )
'post_title' => 'D',
'post_name' => 'd',
),
array(
'post_title' => __( 'Loss', 'sportspress' )
)
)
)
'post_title' => 'L',
'post_name' => 'l',
),
),
),
);

View File

@@ -1,109 +0,0 @@
<?php
global $sportspress_sports;
$sportspress_sports['swimming'] = array(
'name' => __( 'Swimming', 'sportspress' ),
'posts' => array(
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
);

View File

@@ -1,109 +0,0 @@
<?php
global $sportspress_sports;
$sportspress_sports['tennis'] = array(
'name' => __( 'Tennis', 'sportspress' ),
'posts' => array(
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
);

View File

@@ -1,109 +0,0 @@
<?php
global $sportspress_sports;
$sportspress_sports['volleyball'] = array(
'name' => __( 'Volleyball', 'sportspress' ),
'posts' => array(
// Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Appearances', 'sportspress' ),
'post_name' => 'appearances',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array( 'sp_equation' => '' )
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array( 'sp_equation' => '' )
)
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Win', 'sportspress' ),
'post_name' => 'win'
),
array(
'post_title' => __( 'Draw', 'sportspress' ),
'post_name' => 'draw'
),
array(
'post_title' => __( 'Loss', 'sportspress' ),
'post_name' => 'loss'
)
),
// Results
'sp_result' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals'
),
array(
'post_title' => __( '1st Half', 'sportspress' ),
'post_name' => 'firsthalf'
),
array(
'post_title' => __( '2nd Half', 'sportspress' ),
'post_name' => 'secondhalf'
)
),
// Columns
'sp_column' => array(
array(
'post_title' => __( 'P', 'sportspress' ),
'post_name' => 'p',
'meta' => array( 'sp_equation' => '$eventsplayed' )
),
array(
'post_title' => __( 'W', 'sportspress' ),
'post_name' => 'w',
'meta' => array( 'sp_equation' => '$win' )
),
array(
'post_title' => __( 'D', 'sportspress' ),
'post_name' => 'd',
'meta' => array( 'sp_equation' => '$draw' )
),
array(
'post_title' => __( 'L', 'sportspress' ),
'post_name' => 'l',
'meta' => array( 'sp_equation' => '$loss' )
),
array(
'post_title' => __( 'F', 'sportspress' ),
'post_name' => 'f',
'meta' => array( 'sp_equation' => '$goalsfor', 'sp_priority' => '3', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'A', 'sportspress' ),
'post_name' => 'a',
'meta' => array( 'sp_equation' => '$goalsagainst' )
),
array(
'post_title' => __( 'GD', 'sportspress' ),
'post_name' => 'gd',
'meta' => array( 'sp_equation' => '$goalsfor - $goalsagainst', 'sp_priority' => '2', 'sp_order' => 'DESC' )
),
array(
'post_title' => __( 'PTS', 'sportspress' ),
'post_name' => 'pts',
'meta' => array( 'sp_equation' => '$win * 3 + $draw', 'sp_priority' => '1', 'sp_order' => 'DESC' )
)
)
)
);

View File

@@ -13,57 +13,26 @@
<thead>
<tr>
<th><?php _e( 'Label', 'sportspress' ); ?></th>
<th><?php _e( 'Key', 'sportspress' ); ?></th>
<th><?php _e( 'Format', 'sportspress' ); ?></th>
<th><?php _e( 'Precision', 'sportspress' ); ?></th>
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
<th><?php _e( 'Abbreviation', 'sportspress' ); ?></th>
</tr>
</thead>
<?php $i = 0; foreach ( $data as $row ): ?>
<tr>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td>
<td>
<?php
$equation = get_post_meta ( $row->ID, 'sp_equation', true );
if ( $equation ):
echo str_replace(
array( '$', '+', '-', '*', '/' ),
array( '', '&plus;', '&minus;', '&times;', '&divide' ),
$equation
);
else:
echo '—';
endif;
?>
</td>
<td>
<?php
$priority = get_post_meta ( $row->ID, 'sp_priority', true );
if ( $priority ):
echo $priority . ' ' . str_replace(
array( 'DESC', 'ASC' ),
array( '&darr;', '&uarr;' ),
get_post_meta ( $row->ID, 'sp_order', true )
);
else:
echo '—';
endif;
?>
</td>
<td>
<?php
$abbreviation = get_post_meta ( $row->ID, 'sp_abbreviation', true );
if ( $abbreviation ):
echo $abbreviation;
else:
echo $row->post_title;
endif;
?>
</td>
<td><?php echo $row->post_name; ?></td>
<td><?php echo sp_get_post_format( $row->ID ); ?></td>
<td><?php echo sp_get_post_precision( $row->ID ); ?></td>
<td><?php echo sp_get_post_equation( $row->ID ); ?></td>
<td><?php echo sp_get_post_order( $row->ID ); ?></td>
</tr>
<?php $i++; endforeach; ?>
<tfoot>
<tr>
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Table Columns', 'sportspress' ) ); ?></a></th>
<th colspan="7"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Table Columns', 'sportspress' ) ); ?></a></th>
</tr>
</tfoot>
</table>
@@ -83,57 +52,26 @@
<thead>
<tr>
<th><?php _e( 'Label', 'sportspress' ); ?></th>
<th><?php _e( 'Key', 'sportspress' ); ?></th>
<th><?php _e( 'Format', 'sportspress' ); ?></th>
<th><?php _e( 'Precision', 'sportspress' ); ?></th>
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
<th><?php _e( 'Abbreviation', 'sportspress' ); ?></th>
</tr>
</thead>
<?php $i = 0; foreach ( $data as $row ): ?>
<tr>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td>
<td>
<?php
$equation = get_post_meta ( $row->ID, 'sp_equation', true );
if ( $equation ):
echo str_replace(
array( '$', '+', '-', '*', '/' ),
array( '', '&plus;', '&minus;', '&times;', '&divide' ),
$equation
);
else:
echo '—';
endif;
?>
</td>
<td>
<?php
$priority = get_post_meta ( $row->ID, 'sp_priority', true );
if ( $priority ):
echo $priority . ' ' . str_replace(
array( 'DESC', 'ASC' ),
array( '&darr;', '&uarr;' ),
get_post_meta ( $row->ID, 'sp_order', true )
);
else:
echo '—';
endif;
?>
</td>
<td>
<?php
$abbreviation = get_post_meta ( $row->ID, 'sp_abbreviation', true );
if ( $abbreviation ):
echo $abbreviation;
else:
echo $row->post_title;
endif;
?>
</td>
<td><?php echo $row->post_name; ?></td>
<td><?php echo sp_get_post_format( $row->ID ); ?></td>
<td><?php echo sp_get_post_precision( $row->ID ); ?></td>
<td><?php echo sp_get_post_equation( $row->ID ); ?></td>
<td><?php echo sp_get_post_order( $row->ID ); ?></td>
</tr>
<?php $i++; endforeach; ?>
<tfoot>
<tr>
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Statistics', 'sportspress' ) ); ?></a></th>
<th colspan="7"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Statistics', 'sportspress' ) ); ?></a></th>
</tr>
</tfoot>
</table>
@@ -154,28 +92,19 @@
<tr>
<th><?php _e( 'Label', 'sportspress' ); ?></th>
<th><?php _e( 'Key', 'sportspress' ); ?></th>
<th><?php _e( 'Abbreviation', 'sportspress' ); ?></th>
<th><?php _e( 'Format', 'sportspress' ); ?></th>
</tr>
</thead>
<?php $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 ) echo ' class="alternate"'; ?>>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td>
<td>
<?php
$abbreviation = get_post_meta ( $row->ID, 'sp_abbreviation', true );
if ( $abbreviation ):
echo $abbreviation;
else:
echo $row->post_title;
endif;
?>
</td>
<td><?php echo sp_get_post_format( $row->ID ); ?></td>
</tr>
<?php $i++; endforeach; ?>
<tfoot>
<tr>
<th colspan="3"><a href="<?php echo admin_url( 'edit.php?post_type=sp_result' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Results', 'sportspress' ) ); ?></a></th>
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_result' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Results', 'sportspress' ) ); ?></a></th>
</tr>
</tfoot>
</table>
@@ -196,23 +125,12 @@
<tr>
<th><?php _e( 'Label', 'sportspress' ); ?></th>
<th><?php _e( 'Key', 'sportspress' ); ?></th>
<th><?php _e( 'Abbreviation', 'sportspress' ); ?></th>
</tr>
</thead>
<?php $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 ) echo ' class="alternate"'; ?>>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo $row->post_title; ?></td>
<td><?php echo $row->post_name; ?></td>
<td>
<?php
$abbreviation = get_post_meta ( $row->ID, 'sp_abbreviation', true );
if ( $abbreviation ):
echo $abbreviation;
else:
echo $row->post_title;
endif;
?>
</td>
</tr>
<?php $i++; endforeach; ?>
<tfoot>

View File

@@ -44,39 +44,72 @@ function sportspress_validate( $input ) {
$options = get_option( 'sportspress' );
if ( sp_array_value( $options, 'sport', null ) != sp_array_value( $input, 'sport', null ) ):
// Do nothing if sport is the same as currently selected
if ( sp_array_value( $options, 'sport', null ) == sp_array_value( $input, 'sport', null ) )
global $sportspress_sports;
return $input;
$post_groups = sp_array_value( sp_array_value( $sportspress_sports, sp_array_value( $input, 'sport', null ), array() ), 'posts', array() );
// Get sports presets
global $sportspress_sports;
foreach( $post_groups as $post_type => $posts ):
// Get array of post types to insert
$post_groups = sp_array_value( sp_array_value( $sportspress_sports, sp_array_value( $input, 'sport', null ), array() ), 'posts', array() );
// Delete posts
$old_posts = get_posts( array( 'post_type' => $post_type, 'numberposts' => -1, 'posts_per_page' => -1 ) );
foreach( $old_posts as $post ):
wp_delete_post( $post->ID, true);
endforeach;
// Loop through each post type
foreach( $post_groups as $post_type => $posts ):
// Add posts
foreach( $posts as $index => $post ):
$args = array(
'post_type' => $post_type,
'numberposts' => -1,
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'sp_preset',
'value' => 1
)
)
);
// Delete posts
$old_posts = get_posts( $args );
foreach( $old_posts as $post ):
wp_delete_post( $post->ID, true);
endforeach;
// Add posts
foreach( $posts as $index => $post ):
// Make sure post doesn't overlap
if ( ! get_page_by_path( $post['post_name'], OBJECT, $post_type ) ):
// Set post type
$post['post_type'] = $post_type;
$post['post_name'] = sp_get_eos_safe_slug( $post['post_title'], $index );
if ( ! get_page_by_path( $post['post_name'], OBJECT, $post['post_type'] ) ):
$post['menu_order'] = $index * 2 + 2;
$post['post_status'] = 'publish';
$id = wp_insert_post( $post );
if ( array_key_exists( 'meta', $post ) ):
foreach ( $post['meta'] as $key => $value ):
update_post_meta( $id, $key, $value );
endforeach;
endif;
// Increment menu order by 2 and publish post
$post['menu_order'] = $index * 2 + 2;
$post['post_status'] = 'publish';
$id = wp_insert_post( $post );
// Flag as preset
update_post_meta( $id, 'sp_preset', 1 );
// Update meta
if ( array_key_exists( 'meta', $post ) ):
foreach ( $post['meta'] as $key => $value ):
update_post_meta( $id, $key, $value );
endforeach;
endif;
endforeach;
endif;
endforeach;
endif;
endforeach;
return $input;
}

View File

@@ -3,7 +3,7 @@ function sp_position_term_init() {
$name = __( 'Positions', 'sportspress' );
$singular_name = __( 'Position', 'sportspress' );
$lowercase_name = __( 'position', 'sportspress' );
$object_type = array( 'sp_player', 'sp_staff' );
$object_type = array( 'sp_player' );
$labels = sp_tax_labels( $name, $singular_name, $lowercase_name );
$args = array(
'label' => $name,
@@ -14,7 +14,6 @@ function sp_position_term_init() {
);
register_taxonomy( 'sp_position', $object_type, $args );
register_taxonomy_for_object_type( 'sp_position', 'sp_player' );
register_taxonomy_for_object_type( 'sp_position', 'sp_staff' );
}
add_action( 'init', 'sp_position_term_init' );
?>

View File

@@ -13,6 +13,10 @@ function sp_season_term_init() {
'rewrite' => array( 'slug' => 'league' )
);
register_taxonomy( 'sp_season', $object_type, $args );
register_taxonomy_for_object_type( 'sp_season', 'sp_team' );
register_taxonomy_for_object_type( 'sp_season', 'sp_event' );
register_taxonomy_for_object_type( 'sp_season', 'sp_player' );
register_taxonomy_for_object_type( 'sp_season', 'sp_staff' );
}
add_action( 'init', 'sp_season_term_init' );
?>