Fix permissions, add post filters

This commit is contained in:
Brian Miyaji
2014-02-01 22:28:49 +11:00
parent b3270a06b1
commit bd8561cdba
15 changed files with 290 additions and 203 deletions

View File

@@ -4,6 +4,32 @@ global $sportspress_sports;
$sportspress_sports['rugby'] = array(
'name' => __( 'Rugby', 'sportspress' ),
'posts' => array(
// Results
'sp_result' => array(
array(
'post_title' => __( 'Points', 'sportspress' ),
'post_name' => 'points',
),
array(
'post_title' => __( 'Bonus', 'sportspress' ),
'post_name' => 'bonus',
),
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => 'W',
'post_name' => 'w',
),
array(
'post_title' => 'D',
'post_name' => 'd',
),
array(
'post_title' => 'L',
'post_name' => 'l',
),
),
// Table Columns
'sp_column' => array(
array(
@@ -11,6 +37,7 @@ $sportspress_sports['rugby'] = array(
'post_name' => 'p',
'meta' => array(
'sp_equation' => '$eventsplayed',
'sp_precision' => 1,
),
),
array(
@@ -18,6 +45,7 @@ $sportspress_sports['rugby'] = array(
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
'sp_precision' => 1,
),
),
array(
@@ -25,6 +53,7 @@ $sportspress_sports['rugby'] = array(
'post_name' => 'd',
'meta' => array(
'sp_equation' => '$d',
'sp_precision' => 1,
),
),
array(
@@ -32,54 +61,100 @@ $sportspress_sports['rugby'] = array(
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
'sp_precision' => 1,
),
),
array(
'post_title' => 'B',
'post_name' => 'b',
'meta' => array(
'sp_equation' => '$b',
'sp_equation' => '$bonus',
'sp_precision' => 1,
),
),
array(
'post_title' => 'F',
'post_name' => 'f',
'meta' => array(
'sp_equation' => '$ptsfor',
'sp_equation' => '$pointsfor',
'sp_precision' => 1,
),
),
array(
'post_title' => 'A',
'post_name' => 'a',
'meta' => array(
'sp_equation' => '$ptsagainst',
'sp_equation' => '$pointsagainst',
'sp_precision' => 1,
),
),
array(
'post_title' => '+/-',
'post_name' => 'pd',
'meta' => array(
'sp_equation' => '$ptsfor - $ptsagainst',
'sp_equation' => '$pointsfor - $pointsagainst',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '( $w + $b ) * 2 + $d',
'sp_equation' => '( $w + $bonus ) * 2 + $d',
'sp_precision' => 1,
'sp_priority' => '1',
'sp_order' => 'DESC',
),
),
),
// Statistics
// Player Metrics
'sp_metric' => array(
array(
'post_title' => __( 'Height', 'sportspress' ),
'post_name' => 'height',
),
array(
'post_title' => __( 'Weight', 'sportspress' ),
'post_name' => 'weight',
),
),
// Player Statistics
'sp_statistic' => array(
),
// Results
'sp_result' => array(
),
// Outcomes
'sp_outcome' => array(
array(
'post_title' => __( 'Points', 'sportspress' ),
'post_name' => 'points',
'meta' => array(
'sp_calculate' => 'sum',
),
),
array(
'post_title' => __( 'Tries', 'sportspress' ),
'post_name' => 'tries',
'meta' => array(
'sp_calculate' => 'sum',
),
),
array(
'post_title' => __( 'Conversions', 'sportspress' ),
'post_name' => 'conversions',
'meta' => array(
'sp_calculate' => 'sum',
),
),
array(
'post_title' => __( 'Penalty Goals', 'sportspress' ),
'post_name' => 'penaltygoals',
'meta' => array(
'sp_calculate' => 'sum',
),
),
array(
'post_title' => __( 'Drop Goals', 'sportspress' ),
'post_name' => 'dropgoals',
'meta' => array(
'sp_calculate' => 'sum',
),
),
),
),
);

View File

@@ -4,166 +4,11 @@ global $sportspress_sports;
$sportspress_sports['soccer'] = array(
'name' => __( 'Association Football (Soccer)', 'sportspress' ),
'posts' => array(
// Table Columns
'sp_column' => array(
array(
'post_title' => 'P',
'post_name' => 'p',
'meta' => array(
'sp_equation' => '$eventsplayed',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'D',
'post_name' => 'd',
'meta' => array(
'sp_equation' => '$d',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'F',
'post_name' => 'f',
'meta' => array(
'sp_equation' => '$goalsfor',
'sp_priority' => '3',
'sp_order' => 'DESC',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'A',
'post_name' => 'a',
'meta' => array(
'sp_equation' => '$goalsagainst',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'GD',
'post_name' => 'gd',
'meta' => array(
'sp_equation' => '$goalsfor - $goalsagainst',
'sp_priority' => '2',
'sp_order' => 'DESC',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '$w * 3 + $d',
'sp_priority' => '1',
'sp_order' => 'DESC',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
),
// Player Statistics
'sp_statistic' => array(
array(
'post_title' => 'Goals',
'post_name' => 'goals',
'meta' => array(
'sp_equation' => '',
'sp_priority' => '1',
'sp_order' => 'DESC',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Assists',
'post_name' => 'assists',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Yellow Cards',
'post_name' => 'yellowcards',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Red Cards',
'post_name' => 'redcards',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
),
// Player Metrics
'sp_metric' => array(
array(
'post_title' => 'Appearances',
'post_name' => 'appearances',
'meta' => array(
'sp_equation' => '$eventsplayed',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Height',
'post_name' => 'height',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
array(
'post_title' => 'Weight',
'post_name' => 'weight',
'meta' => array(
'sp_equation' => '',
'sp_format' => 'integer',
'sp_precision' => 1,
),
),
),
// Results
'sp_result' => array(
array(
'post_title' => 'Goals',
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array(
'sp_format' => 'integer',
),
),
),
// Outcomes
@@ -181,5 +26,120 @@ $sportspress_sports['soccer'] = array(
'post_name' => 'l',
),
),
// Table Columns
'sp_column' => array(
array(
'post_title' => 'P',
'post_name' => 'p',
'meta' => array(
'sp_equation' => '$eventsplayed',
'sp_precision' => 1,
),
),
array(
'post_title' => 'W',
'post_name' => 'w',
'meta' => array(
'sp_equation' => '$w',
'sp_precision' => 1,
),
),
array(
'post_title' => 'D',
'post_name' => 'd',
'meta' => array(
'sp_equation' => '$d',
'sp_precision' => 1,
),
),
array(
'post_title' => 'L',
'post_name' => 'l',
'meta' => array(
'sp_equation' => '$l',
'sp_precision' => 1,
),
),
array(
'post_title' => 'F',
'post_name' => 'f',
'meta' => array(
'sp_equation' => '$goalsfor',
'sp_precision' => 1,
'sp_priority' => '3',
'sp_order' => 'DESC',
),
),
array(
'post_title' => 'A',
'post_name' => 'a',
'meta' => array(
'sp_equation' => '$goalsagainst',
'sp_precision' => 1,
),
),
array(
'post_title' => 'GD',
'post_name' => 'gd',
'meta' => array(
'sp_equation' => '$goalsfor - $goalsagainst',
'sp_precision' => 1,
'sp_priority' => '2',
'sp_order' => 'DESC',
),
),
array(
'post_title' => 'Pts',
'post_name' => 'pts',
'meta' => array(
'sp_equation' => '$w * 3 + $d',
'sp_precision' => 1,
'sp_priority' => '1',
'sp_order' => 'DESC',
),
),
),
// Player Metrics
'sp_metric' => array(
array(
'post_title' => __( 'Height', 'sportspress' ),
'post_name' => 'height',
),
array(
'post_title' => __( 'Weight', 'sportspress' ),
'post_name' => 'weight',
),
),
// Player Statistics
'sp_statistic' => array(
array(
'post_title' => __( 'Goals', 'sportspress' ),
'post_name' => 'goals',
'meta' => array(
'sp_calculate' => 'sum',
),
),
array(
'post_title' => __( 'Assists', 'sportspress' ),
'post_name' => 'assists',
'meta' => array(
'sp_calculate' => 'sum',
),
),
array(
'post_title' => __( 'Yellow Cards', 'sportspress' ),
'post_name' => 'yellowcards',
'meta' => array(
'sp_calculate' => 'sum',
),
),
array(
'post_title' => __( 'Red Cards', 'sportspress' ),
'post_name' => 'redcards',
'meta' => array(
'sp_calculate' => 'sum',
),
),
),
),
);