Add CS:GO preset and credits section
This commit is contained in:
@@ -110,7 +110,7 @@ class SP_Admin_Sports {
|
|||||||
$positions = sp_array_value( $preset, 'positions', array() );
|
$positions = sp_array_value( $preset, 'positions', array() );
|
||||||
foreach ( $positions as $index => $term ) {
|
foreach ( $positions as $index => $term ) {
|
||||||
$slug = $index . '-' . sanitize_title( $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
|
// Outcomes
|
||||||
@@ -228,7 +228,9 @@ class SP_Admin_Sports {
|
|||||||
$post_array['post_type'] = $post_type;
|
$post_array['post_type'] = $post_type;
|
||||||
|
|
||||||
// Add post excerpt
|
// 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;
|
return $post_array;
|
||||||
}
|
}
|
||||||
@@ -271,5 +273,6 @@ class SP_Admin_Sports {
|
|||||||
__( 'Water Polo', 'sportspress' );
|
__( 'Water Polo', 'sportspress' );
|
||||||
__( 'Dota 2', 'sportspress' );
|
__( 'Dota 2', 'sportspress' );
|
||||||
__( 'League of Legends', 'sportspress' );
|
__( 'League of Legends', 'sportspress' );
|
||||||
|
__( 'Counter-Strike: Global Offensive', 'sportspress' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -319,12 +319,31 @@ class SP_Admin_Welcome {
|
|||||||
public function credits_screen() {
|
public function credits_screen() {
|
||||||
?>
|
?>
|
||||||
<div class="wrap about-wrap about-sportspress-wrap">
|
<div class="wrap about-wrap about-sportspress-wrap">
|
||||||
|
|
||||||
<?php $this->intro(); ?>
|
<?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>
|
<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>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
21
presets/esports/csgo.json
Normal file
21
presets/esports/csgo.json
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user