'default', 'number' => -1, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_calendar_rows', 10 ), 'order' => 'default', 'show_all_events_link' => false, ); extract( $defaults, EXTR_SKIP ); $calendar = new SP_Calendar( $id ); if ( $status != 'default' ) $calendar->status = $status; if ( $order != 'default' ) $calendar->order = $order; $data = $calendar->data(); $usecolumns = $calendar->columns; if ( isset( $columns ) ) $usecolumns = $columns; ?>
' . SP()->text->string('Date') . ''; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) echo ''; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ) echo ''; if ( $usecolumns == null || in_array( 'time', $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 ); $main_results = array(); $video = get_post_meta( $event->ID, 'sp_video', true ); echo ''; echo ''; if ( $usecolumns == null || in_array( 'event', $usecolumns ) ) echo ''; if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ): echo ''; endif; if ( $usecolumns == null || in_array( 'time', $usecolumns ) ): echo ''; endif; if ( $usecolumns == null || in_array( 'venue', $usecolumns ) ): echo ''; endif; if ( $usecolumns == null || in_array( 'article', $usecolumns ) ): echo ''; endif; echo ''; $i++; endforeach; ?>
' . SP()->text->string('Event') . '' . SP()->text->string('Teams') . '' . SP()->text->string('Time/Results') . '' . SP()->text->string('Venue') . '' . SP()->text->string('Article') . '
' . get_post_time( get_option( 'date_format' ), false, $event ) . '' . $event->post_title . ''; $teams = get_post_meta( $event->ID, 'sp_team', false ); 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 ) ): end( $team_results ); $team_result = prev( $team_results ); else: $team_result = null; endif; endif; echo $name; if ( $team_result != null ): $main_results[] = $team_result; echo ' (' . $team_result . ')'; endif; echo '
'; endif; endforeach; else: echo '—'; endif; echo '
'; if ( ! empty( $main_results ) ): echo implode( ' - ', $main_results ); else: echo get_post_time( get_option( 'time_format' ), false, $event ); endif; echo ''; the_terms( $event->ID, 'sp_venue' ); echo ' '; if ( $video ): echo '
'; elseif ( has_post_thumbnail( $event->ID ) ): echo '
'; endif; if ( $event->post_content !== null ): if ( $event->post_status == 'publish' ): echo SP()->text->string('Recap'); else: echo SP()->text->string('Preview'); endif; endif; echo '
' . SP()->text->string('View all events') . ''; ?>