Add CS:GO preset and credits section

This commit is contained in:
Brian Miyaji
2015-02-02 23:27:47 +11:00
parent ffa6274918
commit 823782a38e
3 changed files with 48 additions and 5 deletions

View File

@@ -110,7 +110,7 @@ class SP_Admin_Sports {
$positions = sp_array_value( $preset, 'positions', array() );
foreach ( $positions as $index => $term ) {
$slug = $index . '-' . sanitize_title( $term );
wp_insert_term( $term, 'sp_position', array( 'description' => $term, 'slug' => $slug ) );
wp_insert_term( $term, 'sp_position', array( 'slug' => $slug ) );
}
// Outcomes
@@ -228,7 +228,9 @@ class SP_Admin_Sports {
$post_array['post_type'] = $post_type;
// Add post excerpt
$post_array['post_excerpt'] = sp_array_value( $post, 'description', $post_array['post_title'] );
if ( array_key_exists( 'description', $post ) ) {
$post_array['post_excerpt'] = $post['description'];
}
return $post_array;
}
@@ -271,5 +273,6 @@ class SP_Admin_Sports {
__( 'Water Polo', 'sportspress' );
__( 'Dota 2', 'sportspress' );
__( 'League of Legends', 'sportspress' );
__( 'Counter-Strike: Global Offensive', 'sportspress' );
}
}

View File

@@ -319,12 +319,31 @@ class SP_Admin_Welcome {
public function credits_screen() {
?>
<div class="wrap about-wrap about-sportspress-wrap">
<?php $this->intro(); ?>
<p class="about-description"><?php printf( __( 'SportsPress is developed and maintained by a worldwide team of passionate individuals and backed by an awesome developer community. Want to see your name? <a href="%s">Contribute to SportsPress</a>.', 'sportspress' ), 'https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md' ); ?></p>
<?php echo $this->contributors(); ?>
<div class="sp-feature feature-section col one-col">
<h4><?php _e( 'Developers', 'sportspress' ); ?></h4>
<?php echo $this->contributors(); ?>
</div>
<p class="about-description"><?php printf( __( 'Some presets have been submitted by our helpful and generous users. Want to see your name? <a href="%s">Add a Sport Preset</a>.', 'sportspress' ), 'http://themeboy.com/add-sport-preset/' ); ?></p>
<div class="sp-feature feature-section col one-col">
<h4><?php _e( 'Presets', 'sportspress' ); ?></h4>
<?php
$preset_credits = array(
__( 'Counter-Strike: Global Offensive', 'sportspress' ) => 'Oscar Wong',
);
?>
<dl class="sp-presets">
<?php foreach ( $preset_credits as $preset => $name ) { ?>
<dt><?php echo $preset; ?></dt>
<dd><em><?php echo $name; ?></em></dd>
<?php } ?>
</dl>
</div>
</div>
<?php
}

21
presets/esports/csgo.json Normal file
View File

@@ -0,0 +1,21 @@
{
"name": "Counter-Strike: Global Offensive",
"outcomes": [
{ "name" : "Win", "condition" : ">" },
{ "name" : "Loss", "condition" : "<" }
],
"results": [
"Map Score",
{ "name" : "Round Score", "primary" : 1 }
],
"performance": [
"Kills",
"Deaths",
"Assists"
],
"metrics": [
],
"statistics": [
{ "name" : "KDA Ratio", "equation" : "( $kills + $assists ) / $deaths", "precision" : 2, "description" : "Kills/deaths/assists ratio" }
]
}