- future ) ? $count->future : 0;
- $published_count = isset( $count->publish ) ? $count->publish : 0;
- $next_event = sp_get_next_event();
- if ( $next_event ):
- $now = new DateTime( current_time( 'mysql', 0 ) );
- $date = new DateTime( $next_event->post_date );
- $interval = date_diff( $now, $date );
- ?>
- -
-
- %s until next event', 'sportspress' ), $interval->days . ' ' . __( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', $interval->h, $interval->i, $interval->s ) ); ?>
- (post_title; ?>)
-
-
-
- -
-
- %s event scheduled', '%s events scheduled', $scheduled_count, 'sportspress' ), $scheduled_count ); ?>
-
-
- -
-
- %s event published', '%s events published', $published_count, 'sportspress' ), $published_count ); ?>
-
-
+ ?>
+
+ future ) ? $count->future : 0;
+ $published_count = isset( $count->publish ) ? $count->publish : 0;
+ $next_event = sp_get_next_event();
+ if ( $next_event ):
+ $now = new DateTime( current_time( 'mysql', 0 ) );
+ $date = new DateTime( $next_event->post_date );
+ $interval = date_diff( $now, $date );
+ ?>
+ -
+
+ %s until next event', 'sportspress' ), $interval->days . ' ' . __( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', $interval->h, $interval->i, $interval->s ) ); ?>
+ (post_title; ?>)
+
+
+
+ -
+
+ %s event scheduled', '%s events scheduled', $scheduled_count, 'sportspress' ), $scheduled_count ); ?>
+
+
+ -
+
+ %s event published', '%s events published', $published_count, 'sportspress' ), $published_count ); ?>
+
+
+
+ get_item_quantity(5);
+ // Build an array of all the items, starting with element 0 (first element).
+ $rss_items = $rss->get_items(0, $maxitems);
+ }
+ if (!empty($maxitems)) {
+ ?>
+
-
\ No newline at end of file
diff --git a/templates/event-performance.php b/templates/event-performance.php
index 684abb8b..cff616fb 100644
--- a/templates/event-performance.php
+++ b/templates/event-performance.php
@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
- * @version 2.6
+ * @version 2.6.16
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -96,7 +96,7 @@ if ( is_array( $teams ) ):
$formats[ $column->post_name ] = $format;
}
- do_action( 'sportspress_before_event_performance' );
+ do_action( 'sportspress_before_event_performance', $columns );
if ( $is_individual ) {
// Combined table
@@ -217,6 +217,8 @@ if ( is_array( $teams ) ):
}
sp_get_template( 'event-performance-table.php', array(
+ 'id' => $id,
+ 'index' => $index,
'section' => $section_id,
'section_label' => $section_label,
'scrollable' => $scrollable,
@@ -236,6 +238,7 @@ if ( is_array( $teams ) ):
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
'primary' => 'primary' == $total ? $primary : null,
'class' => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id,
+ 'show_staff' => $show_staff,
) );
}
@@ -256,9 +259,12 @@ if ( is_array( $teams ) ):
}
sp_get_template( 'event-performance-table.php', array(
+ 'id' => $id,
+ 'index' => $index,
'scrollable' => $scrollable,
'sortable' => $sortable,
'show_players' => $show_team_players,
+ 'show_staff' => $show_staff,
'show_numbers' => $show_numbers,
'show_minutes' => $show_minutes,
'show_total' => $show_total,
@@ -272,14 +278,9 @@ if ( is_array( $teams ) ):
'link_posts' => $link_posts,
'performance_ids' => isset( $performance_ids ) ? $performance_ids : null,
'primary' => 'primary' == $total ? $primary : null,
-
) );
}
}
-
- if ( $show_staff ):
- sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
- endif;
}
?>
Teams > Order > Reverse order" is enabled.
+$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
+if ( $reverse_teams ) {
+ $data = array_reverse( $data, true );
+}
+
foreach( $data as $team_id => $result ):
if ( $show_outcomes ):
$outcomes = array();
diff --git a/templates/event-venue.php b/templates/event-venue.php
index 719ef4a6..2a73de8c 100644
--- a/templates/event-venue.php
+++ b/templates/event-venue.php
@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
- * @version 1.9
+ * @version 2.7.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -29,9 +29,8 @@ foreach( $venues as $venue ):
if ( $link_venues )
$name = '' . $name . '';
- $address = sp_array_value( $meta, 'sp_address', '' );
- $latitude = sp_array_value( $meta, 'sp_latitude', 0 );
- $longitude = sp_array_value( $meta, 'sp_longitude', 0 );
+ $address = sp_array_value( $meta, 'sp_address', null );
+ $address = urlencode( $address );
?>
@@ -41,14 +40,14 @@ foreach( $venues as $venue ):
|
-
+
| $meta ) ); ?> |
- |
+ |
@@ -57,4 +56,4 @@ foreach( $venues as $venue ):
\ No newline at end of file
+?>
diff --git a/templates/league-table.php b/templates/league-table.php
index 5c35c5ae..8b5d16b4 100644
--- a/templates/league-table.php
+++ b/templates/league-table.php
@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
- * @version 2.5.5
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -48,6 +48,13 @@ if ( $show_title && false === $title && $id ):
$title = get_the_title( $id );
endif;
+//Check if we have event status sent from shortcode
+if ( isset( $show_published_events ) )
+ $table->show_published_events = $show_published_events ;
+
+if ( isset( $show_future_events ) )
+ $table->show_future_events = $show_future_events ;
+
//Create a unique identifier based on the current time in microseconds
$identifier = uniqid( 'table_' );
diff --git a/templates/official-details.php b/templates/official-details.php
index 48be84c1..3837ce33 100644
--- a/templates/official-details.php
+++ b/templates/official-details.php
@@ -51,7 +51,7 @@ if ( $show_nationality ):
$values = array();
foreach ( $nationalities as $nationality ):
$country_name = sp_array_value( $countries, $nationality, null );
- $values[] = $country_name ? ( $show_nationality_flags ? '
' : '' ) . $country_name : '—';
+ $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—';
endforeach;
$common[ __( 'Nationality', 'sportspress' ) ] = implode( '
', $values );
endif;
diff --git a/templates/player-details.php b/templates/player-details.php
index 3a2c742d..7dbf55de 100644
--- a/templates/player-details.php
+++ b/templates/player-details.php
@@ -51,7 +51,7 @@ if ( $show_nationality ):
$values = array();
foreach ( $nationalities as $nationality ):
$country_name = sp_array_value( $countries, $nationality, null );
- $values[] = $country_name ? ( $show_nationality_flags ? '
' : '' ) . $country_name : '—';
+ $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—';
endforeach;
$common[ __( 'Nationality', 'sportspress' ) ] = implode( '
', $values );
endif;
diff --git a/templates/player-events.php b/templates/player-events.php
index 039695d4..ebcfb04d 100644
--- a/templates/player-events.php
+++ b/templates/player-events.php
@@ -15,7 +15,16 @@ if ( ! isset( $id ) )
$format = get_option( 'sportspress_player_events_format', 'blocks' );
if ( 'calendar' === $format )
sp_get_template( 'event-calendar.php', array( 'player' => $id ) );
-elseif ( 'list' === $format )
- sp_get_template( 'event-list.php', array( 'player' => $id, 'order' => 'DESC', 'title_format' => 'homeaway', 'time_format' => 'separate', 'columns' => array( 'event', 'time', 'results' ) ) );
+elseif ( 'list' === $format ) {
+ $args = array(
+ 'player' => $id,
+ 'title_format' => 'homeaway',
+ 'time_format' => 'separate',
+ 'columns' => array( 'event', 'time', 'results' ),
+ 'order' => 'DESC',
+ );
+ $args = apply_filters( 'sp_player_events_list_args', $args );
+ sp_get_template( 'event-list.php', $args );
+}
else
sp_get_template( 'event-fixtures-results.php', array( 'player' => $id ) );
diff --git a/templates/player-list.php b/templates/player-list.php
index 46fac369..114e201c 100644
--- a/templates/player-list.php
+++ b/templates/player-list.php
@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
- * @version 2.6.10
+ * @version 2.7.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -22,6 +22,7 @@ $defaults = array(
'show_title' => get_option( 'sportspress_list_show_title', 'yes' ) == 'yes' ? true : false,
'show_player_photo' => get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false,
'show_player_flag' => get_option( 'sportspress_list_show_flags', 'no' ) == 'yes' ? true : false,
+ 'team_format' => get_option( 'sportspress_list_team_format', 'name' ),
'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,
'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false,
@@ -54,7 +55,8 @@ $list = new SP_Player_List( $id );
if ( isset( $columns ) && null !== $columns ):
$list->columns = $columns;
endif;
-$data = $list->data( false, $leagues, $seasons, $team );
+
+$data = apply_filters('sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ) , $id );
// The first row should be labels
$labels = $data[0];
@@ -138,8 +140,6 @@ foreach ( $groups as $group ):
foreach( $labels as $key => $label ):
if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) )
$thead .= ''. $label . ' | ';
- if ( preg_match ( "/title=\"(.*?)\"/", $label, $new_label ) )
- $labels[$key] = $label[1];
endforeach;
$thead .= '' . '';
@@ -179,7 +179,7 @@ foreach ( $groups as $group ):
$nationalities = $player->nationalities();
if ( ! empty( $nationalities ) ):
foreach ( $nationalities as $nationality ):
- $name = '
' . $name;
+ $name = '' . sp_flags( $nationality ) . '' . $name;
endforeach;
$name_class .= ' has-photo';
endif;
@@ -193,8 +193,12 @@ foreach ( $groups as $group ):
$tbody .= '' . $name . ' | ';
if ( array_key_exists( 'team', $labels ) ):
- $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_current_team', true ) );
+ $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_current_team', true ) );
$team_name = $team ? sp_team_short_name( $team ) : '-';
+ if ( $team_format == 'logo' && has_post_thumbnail( $team ) ){
+ $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'title' => ''.$team_name.'' ) );
+ $team_name = '' . $logo . '';
+ }
if ( $link_teams && false !== get_post_status( $team ) ):
$team_name = '' . $team_name . '';
endif;
@@ -215,8 +219,13 @@ foreach ( $groups as $group ):
foreach( $labels as $key => $value ):
if ( in_array( $key, array( 'number', 'name', 'team', 'position' ) ) )
continue;
- if ( ! is_array( $columns ) || in_array( $key, $columns ) )
- $tbody .= '' . sp_array_value( $row, $key, '—' ) . ' | ';
+ if ( ! is_array( $columns ) || in_array( $key, $columns ) ) {
+ $label = $labels[$key];
+ if ( preg_match ( "/title=\"(.*?)\"/", $value, $new_label ) ) {
+ $label = $new_label[1];
+ }
+ $tbody .= '' . sp_array_value( $row, $key, '—' ) . ' | ';
+ }
endforeach;
$tbody .= '';
diff --git a/templates/staff-details.php b/templates/staff-details.php
index ce04eb61..9fca30a9 100644
--- a/templates/staff-details.php
+++ b/templates/staff-details.php
@@ -41,7 +41,7 @@ if ( $show_nationality && $nationalities && is_array( $nationalities ) ):
$nationality = sp_array_value( $legacy, $nationality, null );
endif;
$country_name = sp_array_value( $countries, $nationality, null );
- $values[] = $country_name ? ( $show_nationality_flags ? '
' : '' ) . $country_name : '—';
+ $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—';
endforeach;
$data[ __( 'Nationality', 'sportspress' ) ] = implode( '
', $values );
endif;
diff --git a/templates/team-details.php b/templates/team-details.php
index b0598e28..704586ef 100644
--- a/templates/team-details.php
+++ b/templates/team-details.php
@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
- * @version 2.5
+ * @version 2.7.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -36,7 +36,7 @@ endif;
$terms = get_the_terms( $id, 'sp_venue' );
if ( $terms ):
if ( get_option( 'sportspress_team_link_venues', 'no' ) === 'yes' ):
- $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue' );
+ $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue', '', ', ' );
else:
$venues = array();
foreach ( $terms as $term ):
@@ -59,4 +59,4 @@ $output .= '';
?>
-
\ No newline at end of file
+
diff --git a/templates/venue-map.php b/templates/venue-map.php
index dd07e851..1691e81d 100644
--- a/templates/venue-map.php
+++ b/templates/venue-map.php
@@ -4,7 +4,7 @@
*
* @author ThemeBoy
* @package SportsPress/Templates
- * @version 2.6.8
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -12,6 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! isset( $meta ) )
return;
+if ( is_tax( 'sp_venue' ) )
+ do_action ( 'sportspress_before_venue_map' );
+
$address = sp_array_value( $meta, 'sp_address', null );
$address = urlencode( $address );
$latitude = sp_array_value( $meta, 'sp_latitude', null );
@@ -23,17 +26,8 @@ $maptype = strtolower( $maptype );
if ( '' === $address ) $address = '+';
if ( 'satellite' !== $maptype ) $maptype = 'roadmap';
-if ( $latitude != null && $longitude != null ):
- ?>
-
-