Add views counter and style tweaks

This commit is contained in:
Brian Miyaji
2014-01-22 17:33:25 +11:00
parent 86b06e3ec6
commit bb15a05338
18 changed files with 190 additions and 93 deletions

View File

@@ -9,16 +9,27 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
$defaults = array(
'number_label' => __( 'Pos', 'sportspress' ),
'thumbnails' => 1,
'thumbnails' => 0,
'thumbnail_size' => 'thumbnail'
);
$r = wp_parse_args( $args, $defaults );
$data = sportspress_get_league_table_data( $id );
$leagues = get_the_terms( $id, 'sp_league' );
$seasons = get_the_terms( $id, 'sp_season' );
$terms = array();
if ( isset( $leagues[0] ) )
$terms[] = $leagues[0]->name;
if ( isset( $seasons[0] ) )
$terms[] = $seasons[0]->name;
$title = sizeof( $terms ) ? implode( ' — ', $terms ) : get_the_title( $id );
$output = '<table class="sp-league-table sp-data-table">' .
'<caption>' . get_the_title( $id ) . '</caption>' . '<thead>' . '<tr>';
'<caption>' . $title . '</caption>' . '<thead>' . '<tr>';
$data = sportspress_get_league_table_data( $id );
// The first row should be column labels
$labels = $data[0];

View File

@@ -13,11 +13,9 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) {
$nationality = get_post_meta( $id, 'sp_nationality', true );
$metrics = sportspress_get_player_metrics_data( $id );
$flag_image = '<img src="' . SPORTSPRESS_PLUGIN_URL . 'assets/images/flags/' . strtolower( $nationality ) . '.png" class="sp-flag">';
$common = array(
__( 'Number', 'sportspress' ) => $number,
__( 'Nationality', 'sportspress' ) => $flag_image . ' ' . sportspress_array_value( $sportspress_countries, $nationality, '&mdash;' ),
__( 'Nationality', 'sportspress' ) => sportspress_array_value( $sportspress_countries, $nationality, '&mdash;' ),
);
$data = array_merge( $common, $metrics );