diff --git a/templates/event-list.php b/templates/event-list.php
index d9ec5e41..176dcd89 100644
--- a/templates/event-list.php
+++ b/templates/event-list.php
@@ -36,6 +36,8 @@ $defaults = array(
'columns' => null,
'show_all_events_link' => false,
'show_title' => get_option( 'sportspress_event_list_show_title', 'yes' ) == 'yes' ? true : false,
+ 'title_format' => get_option( 'sportspress_event_list_title_format', 'title' ),
+ 'time_format' => get_option( 'sportspress_event_list_time_format', 'combined' ),
);
extract( $defaults, EXTR_SKIP );
@@ -65,8 +67,6 @@ if ( $day != 'default' )
$calendar->day = $day;
$data = $calendar->data();
$usecolumns = $calendar->columns;
-$title_format = get_option( 'sportspress_event_list_title_format', 'title' );
-$time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
if ( isset( $columns ) ):
if ( is_array( $columns ) )
@@ -98,18 +98,20 @@ endif;
case 'homeaway':
if ( sp_column_active( $usecolumns, 'event' ) ) {
echo '
' . __( 'Home', 'sportspress' ) . ' | ';
+ }
- if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
- echo '' . __( 'Time/Results', 'sportspress' ) . ' | ';
- } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
- echo '' . __( 'Results', 'sportspress' ) . ' | ';
- }
+ if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
+ echo '' . __( 'Time/Results', 'sportspress' ) . ' | ';
+ } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
+ echo '' . __( 'Results', 'sportspress' ) . ' | ';
+ }
+ if ( sp_column_active( $usecolumns, 'event' ) ) {
echo '' . __( 'Away', 'sportspress' ) . ' | ';
+ }
- if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
- echo '' . __( 'Time', 'sportspress' ) . ' | ';
- }
+ if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
+ echo '' . __( 'Time', 'sportspress' ) . ' | ';
}
break;
default:
@@ -230,39 +232,41 @@ endif;
if ( sp_column_active( $usecolumns, 'event' ) ) {
$team = array_shift( $teams_array );
echo '' . $team . ' | ';
+ }
- if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
- echo '';
- if ( $link_events ) echo '';
- if ( ! empty( $main_results ) ):
- echo implode( ' - ', $main_results );
- else:
- echo ' ' . get_post_time( 'H:i:s', false, $event ) . '' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
- endif;
- if ( $link_events ) echo '';
- echo ' | ';
- } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
- echo '';
- if ( $link_events ) echo '';
- if ( ! empty( $main_results ) ):
- echo implode( ' - ', $main_results );
- else:
- echo '-';
- endif;
- if ( $link_events ) echo '';
- echo ' | ';
- }
+ if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
+ echo '';
+ if ( $link_events ) echo '';
+ if ( ! empty( $main_results ) ):
+ echo implode( ' - ', $main_results );
+ else:
+ echo ' ' . get_post_time( 'H:i:s', false, $event ) . '' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
+ endif;
+ if ( $link_events ) echo '';
+ echo ' | ';
+ } elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
+ echo '';
+ if ( $link_events ) echo '';
+ if ( ! empty( $main_results ) ):
+ echo implode( ' - ', $main_results );
+ else:
+ echo '-';
+ endif;
+ if ( $link_events ) echo '';
+ echo ' | ';
+ }
+ if ( sp_column_active( $usecolumns, 'event' ) ) {
$team = array_shift( $teams_array );
echo '' . $team . ' | ';
+ }
- if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
- echo '';
- if ( $link_events ) echo '';
- echo ' ' . get_post_time( 'H:i:s', false, $event ) . '' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
- if ( $link_events ) echo '';
- echo ' | ';
- }
+ if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
+ echo '';
+ if ( $link_events ) echo '';
+ echo ' ' . get_post_time( 'H:i:s', false, $event ) . '' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
+ if ( $link_events ) echo '';
+ echo ' | ';
}
break;
default: