null, 'status' => 'default', 'date' => 'default', 'date_to' => 'default', 'date_from' => 'default', 'number' => -1, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_link_venues', 'yes' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_event_list_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_event_list_rows', 10 ), 'order' => 'default', 'columns' => null, 'show_all_events_link' => false, ); extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); if ( $status != 'default' ) $calendar->status = $status; if ( $date != 'default' ) $calendar->date = $date; if ( $date_from != 'default' ) $calendar->from = $date_from; if ( $date_to != 'default' ) $calendar->to = $date_to; if ( $order != 'default' ) $calendar->order = $order; $data = $calendar->data(); $usecolumns = $calendar->columns; $title_format = $calendar->title_format; if ( isset( $columns ) ): if ( is_array( $columns ) ) $usecolumns = $columns; else $usecolumns = explode( ',', $columns ); endif; ?>
' . __( 'Date', 'sportspress' ) . ''; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ): if ( $title_format == 'homeaway' ): echo ''; elseif ( $title_format == 'teams' ): echo ''; else: echo ''; endif; endif; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ): if ( $usecolumns == null || in_array( 'event', $usecolumns ) && $title_format == 'homeaway' ) echo ''; else echo ''; endif; if ( $usecolumns == null || in_array( 'event', $usecolumns ) && $title_format == 'homeaway' ) echo ''; if ( $usecolumns == null || in_array( 'league', $usecolumns ) ) echo ''; if ( $usecolumns == null || in_array( 'season', $usecolumns ) ) echo ''; if ( $usecolumns == null || in_array( 'venue', $usecolumns ) ) echo ''; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ) echo ''; ?> 0 ) $limit = $number; foreach ( $data as $event ): if ( isset( $limit ) && $i >= $limit ) continue; $teams = get_post_meta( $event->ID, 'sp_team' ); $results = get_post_meta( $event->ID, 'sp_results', true ); $video = get_post_meta( $event->ID, 'sp_video', true ); $main_results = array(); $teams_output = ''; $teams_array = ''; if ( $teams ): foreach ( $teams as $team ): $name = get_the_title( $team ); if ( $name ): $team_results = sp_array_value( $results, $team, null ); if ( $primary_result ): $team_result = sp_array_value( $team_results, $primary_result, null ); else: if ( is_array( $team_results ) ): unset( $team_results['outcome'] ); $team_result = end( $team_results ); else: $team_result = null; endif; endif; if ( $link_teams ): $team_output = '' . $name . ''; else: $team_output = $name; endif; if ( $team_result != null ): $main_results[] = $team_result; if ( $usecolumns != null && ! in_array( 'time', $usecolumns ) ): $team_output .= ' (' . $team_result . ')'; endif; endif; $teams_array[] = $team_output; $teams_output .= $team_output . '
'; endif; endforeach; else: $teams_output .= '—'; endif; echo ''; echo ''; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ): if ( $title_format == 'homeaway' ): $team = array_shift( $teams_array ); echo ''; else: if ( $title_format == 'teams' ): echo ''; else: echo ''; endif; endif; endif; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ): echo ''; endif; if ( $usecolumns == null || in_array( 'event', $usecolumns ) && $title_format == 'homeaway' ): $team = array_shift( $teams_array ); echo ''; endif; if ( $usecolumns == null || in_array( 'league', $usecolumns ) ): echo ''; endif; if ( $usecolumns == null || in_array( 'season', $usecolumns ) ): echo ''; endif; if ( $usecolumns == null || in_array( 'venue', $usecolumns ) ): echo ''; endif; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ): echo ''; endif; echo ''; $i++; endforeach; ?>
' . __( 'Home', 'sportspress' ) . '' . __( 'Teams', 'sportspress' ) . '' . __( 'Event', 'sportspress' ) . ' ' . __( 'Time/Results', 'sportspress' ) . '' . __( 'Away', 'sportspress' ) . '' . __( 'Competition', 'sportspress' ) . '' . __( 'Season', 'sportspress' ) . '' . __( 'Venue', 'sportspress' ) . '' . __( 'Article', 'sportspress' ) . '
' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '' . get_post_time( get_option( 'date_format' ), false, $event, true ) . '' . $team . '' . $teams_output . '' . $event->post_title . ''; if ( ! empty( $main_results ) ): echo implode( ' - ', $main_results ); else: echo ' ' . get_post_time( 'H:i:s', false, $event ) . '' . get_post_time( get_option( 'time_format' ), false, $event, true ); endif; echo '' . $team . ''; $leagues = get_the_terms( $event->ID, 'sp_league' ); if ( $leagues ): foreach ( $leagues as $league ): echo $league->name; endforeach; endif; echo ''; $seasons = get_the_terms( $event->ID, 'sp_season' ); if ( $seasons ): foreach ( $seasons as $season ): echo $season->name; endforeach; endif; echo ''; if ( $link_venues ): the_terms( $event->ID, 'sp_venue' ); else: $venues = get_the_terms( $event->ID, 'sp_venue' ); if ( $venues ): foreach ( $venues as $venue ): echo $venue->name; endforeach; endif; endif; echo ' '; if ( $video ): echo '
'; elseif ( has_post_thumbnail( $event->ID ) ): echo '
'; endif; if ( $event->post_content !== null ): if ( $event->post_status == 'publish' ): _e( 'Recap', 'sportspress' ); else: _e( 'Preview', 'sportspress' ); endif; endif; echo '
' . __( 'View all events', 'sportspress' ) . ''; ?>