Add div wrappers to templates
This commit is contained in:
@@ -28,43 +28,45 @@ extract( $defaults, EXTR_SKIP );
|
|||||||
|
|
||||||
if ( ! isset( $post ) ) return;
|
if ( ! isset( $post ) ) return;
|
||||||
?>
|
?>
|
||||||
<div id="sp-countdown-wrapper">
|
<div class="sp-template sp-template-countdown">
|
||||||
<h3 class="event-name"><a href="<?php echo get_permalink( $post->ID ); ?>"><?php echo $post->post_title; ?></a></h3>
|
<div id="sp-countdown-wrapper">
|
||||||
<?php
|
<h3 class="event-name"><a href="<?php echo get_permalink( $post->ID ); ?>"><?php echo $post->post_title; ?></a></h3>
|
||||||
if ( isset( $show_venue ) && $show_venue ):
|
<?php
|
||||||
$venues = get_the_terms( $post->ID, 'sp_venue' );
|
if ( isset( $show_venue ) && $show_venue ):
|
||||||
if ( $venues ):
|
$venues = get_the_terms( $post->ID, 'sp_venue' );
|
||||||
?>
|
if ( $venues ):
|
||||||
<h5 class="event-venue"><?php the_terms( $post->ID, 'sp_venue' ); ?></h5>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( isset( $show_league ) && $show_league ):
|
|
||||||
$leagues = get_the_terms( $post->ID, 'sp_league' );
|
|
||||||
if ( $leagues ):
|
|
||||||
foreach( $leagues as $league ):
|
|
||||||
$term = get_term( $league->term_id, 'sp_league' );
|
|
||||||
?>
|
?>
|
||||||
<h5 class="event-league"><?php echo $term->name; ?></h5>
|
<h5 class="event-venue"><?php the_terms( $post->ID, 'sp_venue' ); ?></h5>
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endif;
|
||||||
endif;
|
endif;
|
||||||
endif;
|
|
||||||
|
|
||||||
$now = new DateTime( current_time( 'mysql', 0 ) );
|
if ( isset( $show_league ) && $show_league ):
|
||||||
$date = new DateTime( $post->post_date );
|
$leagues = get_the_terms( $post->ID, 'sp_league' );
|
||||||
$interval = date_diff( $now, $date );
|
if ( $leagues ):
|
||||||
|
foreach( $leagues as $league ):
|
||||||
|
$term = get_term( $league->term_id, 'sp_league' );
|
||||||
|
?>
|
||||||
|
<h5 class="event-league"><?php echo $term->name; ?></h5>
|
||||||
|
<?php
|
||||||
|
endforeach;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
$days = $interval->invert ? 0 : $interval->days;
|
$now = new DateTime( current_time( 'mysql', 0 ) );
|
||||||
$h = $interval->invert ? 0 : $interval->h;
|
$date = new DateTime( $post->post_date );
|
||||||
$i = $interval->invert ? 0 : $interval->i;
|
$interval = date_diff( $now, $date );
|
||||||
$s = $interval->invert ? 0 : $interval->s;
|
|
||||||
?>
|
$days = $interval->invert ? 0 : $interval->days;
|
||||||
<p class="countdown sp-countdown<?php if ( $days >= 10 ): ?> long-countdown<?php endif; ?>"><time datetime="<?php echo $post->post_date; ?>"<?php if ( $live ): ?> data-countdown="<?php echo str_replace( '-', '/', $post->post_date ); ?>"<?php endif; ?>>
|
$h = $interval->invert ? 0 : $interval->h;
|
||||||
<span><?php echo sprintf( '%02s', $days ); ?> <small><?php _e( 'days', 'sportspress' ); ?></small></span>
|
$i = $interval->invert ? 0 : $interval->i;
|
||||||
<span><?php echo sprintf( '%02s', $h ); ?> <small><?php _e( 'hrs', 'sportspress' ); ?></small></span>
|
$s = $interval->invert ? 0 : $interval->s;
|
||||||
<span><?php echo sprintf( '%02s', $i ); ?> <small><?php _e( 'mins', 'sportspress' ); ?></small></span>
|
?>
|
||||||
<span><?php echo sprintf( '%02s', $s ); ?> <small><?php _e( 'secs', 'sportspress' ); ?></small></span>
|
<p class="countdown sp-countdown<?php if ( $days >= 10 ): ?> long-countdown<?php endif; ?>"><time datetime="<?php echo $post->post_date; ?>"<?php if ( $live ): ?> data-countdown="<?php echo str_replace( '-', '/', $post->post_date ); ?>"<?php endif; ?>>
|
||||||
</time></p>
|
<span><?php echo sprintf( '%02s', $days ); ?> <small><?php _e( 'days', 'sportspress' ); ?></small></span>
|
||||||
|
<span><?php echo sprintf( '%02s', $h ); ?> <small><?php _e( 'hrs', 'sportspress' ); ?></small></span>
|
||||||
|
<span><?php echo sprintf( '%02s', $i ); ?> <small><?php _e( 'mins', 'sportspress' ); ?></small></span>
|
||||||
|
<span><?php echo sprintf( '%02s', $s ); ?> <small><?php _e( 'secs', 'sportspress' ); ?></small></span>
|
||||||
|
</time></p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -37,71 +37,73 @@ $usecolumns = $calendar->columns;
|
|||||||
if ( isset( $columns ) )
|
if ( isset( $columns ) )
|
||||||
$usecolumns = $columns;
|
$usecolumns = $columns;
|
||||||
?>
|
?>
|
||||||
<div class="sp-table-wrapper">
|
<div class="sp-template sp-template-event-blocks">
|
||||||
<table class="sp-event-blocks sp-data-table<?php if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
<div class="sp-table-wrapper">
|
||||||
<thead><tr><th></th></tr></thead> <?php # Required for DataTables ?>
|
<table class="sp-event-blocks sp-data-table<?php if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
||||||
<tbody>
|
<thead><tr><th></th></tr></thead> <?php # Required for DataTables ?>
|
||||||
<?php
|
<tbody>
|
||||||
$i = 0;
|
<?php
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
if ( intval( $number ) > 0 )
|
if ( intval( $number ) > 0 )
|
||||||
$limit = $number;
|
$limit = $number;
|
||||||
|
|
||||||
foreach ( $data as $event ):
|
foreach ( $data as $event ):
|
||||||
if ( isset( $limit ) && $i >= $limit ) continue;
|
if ( isset( $limit ) && $i >= $limit ) continue;
|
||||||
|
|
||||||
$results = get_post_meta( $event->ID, 'sp_results', true );
|
$results = get_post_meta( $event->ID, 'sp_results', true );
|
||||||
|
|
||||||
$teams = array_unique( get_post_meta( $event->ID, 'sp_team' ) );
|
$teams = array_unique( get_post_meta( $event->ID, 'sp_team' ) );
|
||||||
$logos = array();
|
$logos = array();
|
||||||
$main_results = array();
|
$main_results = array();
|
||||||
|
|
||||||
$j = 0;
|
$j = 0;
|
||||||
foreach( $teams as $team ):
|
foreach( $teams as $team ):
|
||||||
$j++;
|
$j++;
|
||||||
if ( has_post_thumbnail ( $team ) ):
|
if ( has_post_thumbnail ( $team ) ):
|
||||||
if ( $link_teams ):
|
if ( $link_teams ):
|
||||||
$logo = '<a href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ) . '</a>';
|
$logo = '<a href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ) . '</a>';
|
||||||
else:
|
else:
|
||||||
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) );
|
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) );
|
||||||
|
endif;
|
||||||
|
$logos[] = $logo;
|
||||||
endif;
|
endif;
|
||||||
$logos[] = $logo;
|
$team_results = sp_array_value( $results, $team, null );
|
||||||
endif;
|
|
||||||
$team_results = sp_array_value( $results, $team, null );
|
|
||||||
|
|
||||||
if ( $primary_result ):
|
if ( $primary_result ):
|
||||||
$team_result = sp_array_value( $team_results, $primary_result, null );
|
$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:
|
else:
|
||||||
$team_result = null;
|
if ( is_array( $team_results ) ):
|
||||||
|
end( $team_results );
|
||||||
|
$team_result = prev( $team_results );
|
||||||
|
else:
|
||||||
|
$team_result = null;
|
||||||
|
endif;
|
||||||
endif;
|
endif;
|
||||||
endif;
|
if ( $team_result != null )
|
||||||
if ( $team_result != null )
|
$main_results[] = $team_result;
|
||||||
$main_results[] = $team_result;
|
|
||||||
|
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
<tr class="sp-row sp-post<?php echo ( $i % 2 == 0 ? ' alternate' : '' ); ?>">
|
||||||
|
<td>
|
||||||
|
<?php echo implode( $logos, ' ' ); ?>
|
||||||
|
<time class="event-date"><?php echo get_the_time( get_option( 'date_format' ), $event ); ?></time>
|
||||||
|
<?php if ( $event->post_status == 'future' ): ?>
|
||||||
|
<h5 class="event-time"><?php echo get_the_time( get_option( 'time_format' ), $event ); ?></h5>
|
||||||
|
<?php else: ?>
|
||||||
|
<h5 class="event-results"><?php echo implode( $main_results, ' - ' ); ?></h5>
|
||||||
|
<?php endif; ?>
|
||||||
|
<h4 class="event-title"><a href="<?php echo get_post_permalink( $event ); ?>"><?php echo $event->post_title; ?></a></h4>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$i++;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
<tr class="sp-row sp-post<?php echo ( $i % 2 == 0 ? ' alternate' : '' ); ?>">
|
</tbody>
|
||||||
<td>
|
</table>
|
||||||
<?php echo implode( $logos, ' ' ); ?>
|
</div>
|
||||||
<time class="event-date"><?php echo get_the_time( get_option( 'date_format' ), $event ); ?></time>
|
|
||||||
<?php if ( $event->post_status == 'future' ): ?>
|
|
||||||
<h5 class="event-time"><?php echo get_the_time( get_option( 'time_format' ), $event ); ?></h5>
|
|
||||||
<?php else: ?>
|
|
||||||
<h5 class="event-results"><?php echo implode( $main_results, ' - ' ); ?></h5>
|
|
||||||
<?php endif; ?>
|
|
||||||
<h4 class="event-title"><a href="<?php echo get_post_permalink( $event ); ?>"><?php echo $event->post_title; ?></a></h4>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
$i++;
|
|
||||||
endforeach;
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if ( $id && $show_all_events_link )
|
if ( $id && $show_all_events_link )
|
||||||
|
|||||||
@@ -209,5 +209,7 @@ $calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>";
|
|||||||
|
|
||||||
if ( $id && $show_all_events_link )
|
if ( $id && $show_all_events_link )
|
||||||
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
$calendar_output .= '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||||
|
?>
|
||||||
echo apply_filters( 'sportspress_event_calendar', $calendar_output );
|
<div class="sp-template sp-template-event-calendar">
|
||||||
|
<?php echo $calendar_output; ?>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -30,22 +30,24 @@ if ( $seasons ):
|
|||||||
$data[ __( 'Season', 'sportspress' ) ] = $season->name;
|
$data[ __( 'Season', 'sportspress' ) ] = $season->name;
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<h4 class="sp-table-caption"><?php _e( 'Details', 'sportspress' ); ?></h4>
|
<div class="sp-template sp-template-event-details">
|
||||||
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
<h4 class="sp-table-caption"><?php _e( 'Details', 'sportspress' ); ?></h4>
|
||||||
<table class="sp-event-details sp-data-table">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
<thead>
|
<table class="sp-event-details sp-data-table">
|
||||||
<tr>
|
<thead>
|
||||||
<?php $i = 0; foreach( $data as $label => $value ): ?>
|
<tr>
|
||||||
<th><?php echo $label; ?></th>
|
<?php $i = 0; foreach( $data as $label => $value ): ?>
|
||||||
<?php $i++; endforeach; ?>
|
<th><?php echo $label; ?></th>
|
||||||
</tr>
|
<?php $i++; endforeach; ?>
|
||||||
</thead>
|
</tr>
|
||||||
<tbody>
|
</thead>
|
||||||
<tr class="odd">
|
<tbody>
|
||||||
<?php $i = 0; foreach( $data as $value ): ?>
|
<tr class="odd">
|
||||||
<td><?php echo $value; ?></td>
|
<?php $i = 0; foreach( $data as $value ): ?>
|
||||||
<?php $i++; endforeach; ?>
|
<td><?php echo $value; ?></td>
|
||||||
</tr>
|
<?php $i++; endforeach; ?>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</tbody>
|
||||||
</div>
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -47,146 +47,148 @@ if ( isset( $columns ) ):
|
|||||||
$usecolumns = explode( ',', $columns );
|
$usecolumns = explode( ',', $columns );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
<div class="sp-template sp-template-event-list">
|
||||||
<table class="sp-event-list sp-data-table<?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
<thead>
|
<table class="sp-event-list sp-data-table<?php if ( $responsive ) { ?> sp-responsive-table<?php } if ( $paginated ) { ?> sp-paginated-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
||||||
<tr>
|
<thead>
|
||||||
<?php
|
<tr>
|
||||||
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
<?php
|
||||||
|
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
||||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) )
|
|
||||||
echo '<th class="data-event">' . __( 'Event', 'sportspress' ) . '</th>';
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'teams', $usecolumns ) )
|
|
||||||
echo '<th class="data-teams">' . __( 'Teams', 'sportspress' ) . '</th>';
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
|
|
||||||
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
|
|
||||||
echo '<th class="data-venue">' . __( 'Venue', 'sportspress' ) . '</th>';
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'article', $usecolumns ) )
|
|
||||||
echo '<th class="data-article">' . __( 'Article', 'sportspress' ) . '</th>';
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
if ( is_numeric( $number ) && $number > 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 = '';
|
|
||||||
|
|
||||||
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 ):
|
|
||||||
$teams_output .= '<a href="' . get_post_permalink( $team ) . '">' . $name . '</a>';
|
|
||||||
else:
|
|
||||||
$teams_output .= $name;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $team_result != null ):
|
|
||||||
$main_results[] = $team_result;
|
|
||||||
$teams_output .= ' (' . $team_result . ')';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
$teams_output .= '<br>';
|
|
||||||
endif;
|
|
||||||
endforeach;
|
|
||||||
else:
|
|
||||||
$teams_output .= '—';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
echo '<tr class="sp-row sp-post' . ( $i % 2 == 0 ? ' alternate' : '' ) . '">';
|
|
||||||
|
|
||||||
echo '<td class="data-date"><a href="' . get_permalink( $event->ID ) . '">' . get_post_time( get_option( 'date_format' ), false, $event, true ) . '</a></td>';
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) )
|
if ( $usecolumns == null || in_array( 'event', $usecolumns ) )
|
||||||
echo '<td class="data-event">' . $event->post_title . '</td>';
|
echo '<th class="data-event">' . __( 'Event', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ):
|
if ( $usecolumns == null || in_array( 'teams', $usecolumns ) )
|
||||||
echo '<td class="data-teams">';
|
echo '<th class="data-teams">' . __( 'Teams', 'sportspress' ) . '</th>';
|
||||||
echo $teams_output;
|
|
||||||
|
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
|
||||||
|
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
|
||||||
|
echo '<th class="data-venue">' . __( 'Venue', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'article', $usecolumns ) )
|
||||||
|
echo '<th class="data-article">' . __( 'Article', 'sportspress' ) . '</th>';
|
||||||
|
?>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
if ( is_numeric( $number ) && $number > 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 = '';
|
||||||
|
|
||||||
|
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 ):
|
||||||
|
$teams_output .= '<a href="' . get_post_permalink( $team ) . '">' . $name . '</a>';
|
||||||
|
else:
|
||||||
|
$teams_output .= $name;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( $team_result != null ):
|
||||||
|
$main_results[] = $team_result;
|
||||||
|
$teams_output .= ' (' . $team_result . ')';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$teams_output .= '<br>';
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
else:
|
||||||
|
$teams_output .= '—';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
echo '<tr class="sp-row sp-post' . ( $i % 2 == 0 ? ' alternate' : '' ) . '">';
|
||||||
|
|
||||||
|
echo '<td class="data-date"><a href="' . get_permalink( $event->ID ) . '">' . get_post_time( get_option( 'date_format' ), false, $event, true ) . '</a></td>';
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'event', $usecolumns ) )
|
||||||
|
echo '<td class="data-event">' . $event->post_title . '</td>';
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'teams', $usecolumns ) ):
|
||||||
|
echo '<td class="data-teams">';
|
||||||
|
echo $teams_output;
|
||||||
|
echo '</td>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'time', $usecolumns ) ):
|
||||||
|
echo '<td class="data-time">';
|
||||||
|
if ( ! empty( $main_results ) ):
|
||||||
|
echo implode( ' - ', $main_results );
|
||||||
|
else:
|
||||||
|
echo get_post_time( get_option( 'time_format' ), false, $event, true );
|
||||||
|
endif;
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) ):
|
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) ):
|
||||||
echo '<td class="data-time">';
|
echo '<td class="data-venue">';
|
||||||
if ( ! empty( $main_results ) ):
|
if ( $link_venues ):
|
||||||
echo implode( ' - ', $main_results );
|
the_terms( $event->ID, 'sp_venue' );
|
||||||
else:
|
else:
|
||||||
echo get_post_time( get_option( 'time_format' ), false, $event, true );
|
$venues = get_the_terms( $event->ID, 'sp_venue' );
|
||||||
endif;
|
foreach ( $venues as $venue ):
|
||||||
echo '</td>';
|
echo $venue->name;
|
||||||
endif;
|
endforeach;
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) ):
|
|
||||||
echo '<td class="data-venue">';
|
|
||||||
if ( $link_venues ):
|
|
||||||
the_terms( $event->ID, 'sp_venue' );
|
|
||||||
else:
|
|
||||||
$venues = get_the_terms( $event->ID, 'sp_venue' );
|
|
||||||
foreach ( $venues as $venue ):
|
|
||||||
echo $venue->name;
|
|
||||||
endforeach;
|
|
||||||
endif;
|
|
||||||
echo '</td>';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'article', $usecolumns ) ):
|
|
||||||
echo '<td class="data-article">
|
|
||||||
<a href="' . get_permalink( $event->ID ) . '">';
|
|
||||||
|
|
||||||
if ( $video ):
|
|
||||||
echo '<div class="dashicons dashicons-video-alt"></div>';
|
|
||||||
elseif ( has_post_thumbnail( $event->ID ) ):
|
|
||||||
echo '<div class="dashicons dashicons-camera"></div>';
|
|
||||||
endif;
|
endif;
|
||||||
if ( $event->post_content !== null ):
|
echo '</td>';
|
||||||
if ( $event->post_status == 'publish' ):
|
endif;
|
||||||
_e( 'Recap', 'sportspress' );
|
|
||||||
else:
|
if ( $usecolumns == null || in_array( 'article', $usecolumns ) ):
|
||||||
_e( 'Preview', 'sportspress' );
|
echo '<td class="data-article">
|
||||||
|
<a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
|
||||||
|
if ( $video ):
|
||||||
|
echo '<div class="dashicons dashicons-video-alt"></div>';
|
||||||
|
elseif ( has_post_thumbnail( $event->ID ) ):
|
||||||
|
echo '<div class="dashicons dashicons-camera"></div>';
|
||||||
|
endif;
|
||||||
|
if ( $event->post_content !== null ):
|
||||||
|
if ( $event->post_status == 'publish' ):
|
||||||
|
_e( 'Recap', 'sportspress' );
|
||||||
|
else:
|
||||||
|
_e( 'Preview', 'sportspress' );
|
||||||
|
endif;
|
||||||
endif;
|
endif;
|
||||||
endif;
|
|
||||||
|
|
||||||
echo '</a>
|
echo '</a>
|
||||||
</td>';
|
</td>';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if ( $id && $show_all_events_link )
|
if ( $id && $show_all_events_link )
|
||||||
|
|||||||
@@ -59,158 +59,160 @@ if ( is_array( $teams ) ):
|
|||||||
$data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
|
$data = sp_array_combine( $players, sp_array_value( $performance, $team_id, array() ) );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h4 class="sp-table-caption"><?php echo get_the_title( $team_id ); ?></h4>
|
<div class="sp-template sp-template-event-performance">
|
||||||
<?php
|
<h4 class="sp-table-caption"><?php echo get_the_title( $team_id ); ?></h4>
|
||||||
if ( get_option( 'sportspress_event_show_staff', 'yes' ) == 'yes' ):
|
<?php
|
||||||
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
|
if ( get_option( 'sportspress_event_show_staff', 'yes' ) == 'yes' ):
|
||||||
endif;
|
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
|
||||||
?>
|
endif;
|
||||||
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
?>
|
||||||
<table class="sp-event-performance sp-data-table <?php if ( $responsive ) { ?> sp-responsive-table<?php } ?>">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
<thead>
|
<table class="sp-event-performance sp-data-table <?php if ( $responsive ) { ?> sp-responsive-table<?php } ?>">
|
||||||
<tr>
|
<thead>
|
||||||
<?php if ( $has_players ): ?>
|
<tr>
|
||||||
<th class="data-number">#</th>
|
<?php if ( $has_players ): ?>
|
||||||
<th class="data-name"><?php _e( 'Player', 'sportspress' ); ?></th>
|
<th class="data-number">#</th>
|
||||||
<?php endif; ?>
|
<th class="data-name"><?php _e( 'Player', 'sportspress' ); ?></th>
|
||||||
<?php if ( $mode == 'values' ): foreach( $labels as $key => $label ): ?>
|
<?php endif; ?>
|
||||||
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
<?php if ( $mode == 'values' ): foreach( $labels as $key => $label ): ?>
|
||||||
<?php endforeach; else: ?>
|
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
||||||
<th class="sp-performance-icons"> </th>
|
<?php endforeach; else: ?>
|
||||||
<?php endif; ?>
|
<th class="sp-performance-icons"> </th>
|
||||||
</tr>
|
<?php endif; ?>
|
||||||
</thead>
|
</tr>
|
||||||
<?php if ( $show_players && $has_players ): ?>
|
</thead>
|
||||||
<tbody>
|
<?php if ( $show_players && $has_players ): ?>
|
||||||
<?php
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
$lineups = array_filter( $data, array( $event, 'lineup_filter' ) );
|
$lineups = array_filter( $data, array( $event, 'lineup_filter' ) );
|
||||||
$subs = array_filter( $data, array( $event, 'sub_filter' ) );
|
$subs = array_filter( $data, array( $event, 'sub_filter' ) );
|
||||||
|
|
||||||
$lineup_sub_relation = array();
|
$lineup_sub_relation = array();
|
||||||
foreach ( $subs as $sub_id => $sub ):
|
foreach ( $subs as $sub_id => $sub ):
|
||||||
if ( ! $sub_id )
|
if ( ! $sub_id )
|
||||||
continue;
|
|
||||||
$lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
|
|
||||||
endforeach;
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
foreach( $data as $player_id => $row ):
|
|
||||||
|
|
||||||
if ( ! $player_id )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$name = get_the_title( $player_id );
|
|
||||||
|
|
||||||
if ( ! $name )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
echo '<tr class="' . sp_array_value( $row, 'status', 'lineup' ) . ' ' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
|
||||||
|
|
||||||
$number = sp_array_value( $row, 'number', ' ' );
|
|
||||||
|
|
||||||
// Player number
|
|
||||||
echo '<td class="data-number">' . $number . '</td>';
|
|
||||||
|
|
||||||
if ( $link_posts ):
|
|
||||||
$permalink = get_post_permalink( $player_id );
|
|
||||||
$name = '<a href="' . $permalink . '">' . $name . '</a>';
|
|
||||||
if ( isset( $row['status'] ) && $row['status'] == 'sub' ):
|
|
||||||
$name = '(' . $name . ')';
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( array_key_exists( $player_id, $lineup_sub_relation ) ):
|
|
||||||
$name .= ' <span class="sub-in" title="' . get_the_title( $lineup_sub_relation[ $player_id ] ) . '">' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . '</span>';
|
|
||||||
elseif ( isset( $row['sub'] ) && $row['sub'] ):
|
|
||||||
$name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . '</span>';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
echo '<td class="data-name">' . $name . '</td>';
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ); echo '<td class="sp-performance-icons">';
|
|
||||||
|
|
||||||
foreach( $labels as $key => $label ):
|
|
||||||
if ( $key == 'name' )
|
|
||||||
continue;
|
continue;
|
||||||
$value = '—';
|
$lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
|
||||||
if ( $key == 'position' ):
|
endforeach;
|
||||||
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
$position = get_term_by( 'id', $row[ $key ], 'sp_position' );
|
$i = 0;
|
||||||
if ( $position ) $value = $position->name;
|
foreach( $data as $player_id => $row ):
|
||||||
|
|
||||||
|
if ( ! $player_id )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$name = get_the_title( $player_id );
|
||||||
|
|
||||||
|
if ( ! $name )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
echo '<tr class="' . sp_array_value( $row, 'status', 'lineup' ) . ' ' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
||||||
|
|
||||||
|
$number = sp_array_value( $row, 'number', ' ' );
|
||||||
|
|
||||||
|
// Player number
|
||||||
|
echo '<td class="data-number">' . $number . '</td>';
|
||||||
|
|
||||||
|
if ( $link_posts ):
|
||||||
|
$permalink = get_post_permalink( $player_id );
|
||||||
|
$name = '<a href="' . $permalink . '">' . $name . '</a>';
|
||||||
|
if ( isset( $row['status'] ) && $row['status'] == 'sub' ):
|
||||||
|
$name = '(' . $name . ')';
|
||||||
endif;
|
endif;
|
||||||
else:
|
endif;
|
||||||
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
|
if ( array_key_exists( $player_id, $lineup_sub_relation ) ):
|
||||||
|
$name .= ' <span class="sub-in" title="' . get_the_title( $lineup_sub_relation[ $player_id ] ) . '">' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . '</span>';
|
||||||
|
elseif ( isset( $row['sub'] ) && $row['sub'] ):
|
||||||
|
$name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . '</span>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
echo '<td class="data-name">' . $name . '</td>';
|
||||||
|
|
||||||
|
if ( $mode == 'icons' ); echo '<td class="sp-performance-icons">';
|
||||||
|
|
||||||
|
foreach( $labels as $key => $label ):
|
||||||
|
if ( $key == 'name' )
|
||||||
|
continue;
|
||||||
|
$value = '—';
|
||||||
|
if ( $key == 'position' ):
|
||||||
|
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
|
$position = get_term_by( 'id', $row[ $key ], 'sp_position' );
|
||||||
|
if ( $position ) $value = $position->name;
|
||||||
|
endif;
|
||||||
|
else:
|
||||||
|
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
|
$value = $row[ $key ];
|
||||||
|
else:
|
||||||
|
$value = 0;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
if ( ! array_key_exists( $key, $totals ) ):
|
||||||
|
$totals[ $key ] = 0;
|
||||||
|
endif;
|
||||||
|
$totals[ $key ] += $value;
|
||||||
|
|
||||||
|
if ( $mode == 'values' ):
|
||||||
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
|
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
|
||||||
|
if ( $mode == 'icons' ); echo '</td>';
|
||||||
|
|
||||||
|
echo '</tr>';
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ( $status == 'results' && get_option( 'sportspress_event_show_total', 'yes' ) == 'yes' && array_key_exists( 0, $data ) ): ?>
|
||||||
|
<<?php echo ( $show_players && $has_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
|
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
||||||
|
<?php
|
||||||
|
if ( $has_players ):
|
||||||
|
echo '<td class="data-number"> </td>';
|
||||||
|
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$row = $data[0];
|
||||||
|
|
||||||
|
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
||||||
|
|
||||||
|
foreach( $labels as $key => $label ):
|
||||||
|
if ( $key == 'name' )
|
||||||
|
continue;
|
||||||
|
if ( $key == 'position' ):
|
||||||
|
$value = '—';
|
||||||
|
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
$value = $row[ $key ];
|
$value = $row[ $key ];
|
||||||
else:
|
else:
|
||||||
$value = 0;
|
$value = sp_array_value( $totals, $key, 0 );
|
||||||
endif;
|
endif;
|
||||||
endif;
|
|
||||||
if ( ! array_key_exists( $key, $totals ) ):
|
|
||||||
$totals[ $key ] = 0;
|
|
||||||
endif;
|
|
||||||
$totals[ $key ] += $value;
|
|
||||||
|
|
||||||
if ( $mode == 'values' ):
|
if ( $mode == 'values' ):
|
||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
|
endif;
|
||||||
endif;
|
endif;
|
||||||
endif;
|
endforeach;
|
||||||
endforeach;
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ); echo '</td>';
|
|
||||||
|
|
||||||
echo '</tr>';
|
if ( $mode == 'icons' ) echo '</td>';
|
||||||
|
?>
|
||||||
$i++;
|
</tr>
|
||||||
|
</<?php echo ( $has_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
endforeach;
|
<?php endif; ?>
|
||||||
?>
|
</table>
|
||||||
</tbody>
|
</div>
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ( $status == 'results' && get_option( 'sportspress_event_show_total', 'yes' ) == 'yes' && array_key_exists( 0, $data ) ): ?>
|
|
||||||
<<?php echo ( $show_players && $has_players ? 'tfoot' : 'tbody' ); ?>>
|
|
||||||
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
|
||||||
<?php
|
|
||||||
if ( $has_players ):
|
|
||||||
echo '<td class="data-number"> </td>';
|
|
||||||
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
$row = $data[0];
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
|
||||||
|
|
||||||
foreach( $labels as $key => $label ):
|
|
||||||
if ( $key == 'name' )
|
|
||||||
continue;
|
|
||||||
if ( $key == 'position' ):
|
|
||||||
$value = '—';
|
|
||||||
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
$value = $row[ $key ];
|
|
||||||
else:
|
|
||||||
$value = sp_array_value( $totals, $key, 0 );
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $mode == 'values' ):
|
|
||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
endforeach;
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '</td>';
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
</<?php echo ( $has_players ? 'tfoot' : 'tbody' ); ?>>
|
|
||||||
<?php endif; ?>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
@@ -100,5 +100,7 @@ else:
|
|||||||
$output .= '</tbody>' . '</table>' . '</div>';
|
$output .= '</tbody>' . '</table>' . '</div>';
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
?>
|
||||||
echo $output;
|
<div class="sp-template sp-template-event-results">
|
||||||
|
<?php echo $output; ?>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -32,25 +32,27 @@ foreach( $venues as $venue ):
|
|||||||
$latitude = sp_array_value( $meta, 'sp_latitude', 0 );
|
$latitude = sp_array_value( $meta, 'sp_latitude', 0 );
|
||||||
$longitude = sp_array_value( $meta, 'sp_longitude', 0 );
|
$longitude = sp_array_value( $meta, 'sp_longitude', 0 );
|
||||||
?>
|
?>
|
||||||
<h4 class="sp-table-caption"><?php _e( 'Venue', 'sportspress' ); ?></h4>
|
<div class="sp-template sp-template-event-venue">
|
||||||
<table class="sp-data-table sp-event-venue">
|
<h4 class="sp-table-caption"><?php _e( 'Venue', 'sportspress' ); ?></h4>
|
||||||
<thead>
|
<table class="sp-data-table sp-event-venue">
|
||||||
<tr>
|
<thead>
|
||||||
<th><?php echo $name; ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<?php if ( $address != null || ( $show_maps && $latitude != null && $longitude != null ) ): ?>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $address; ?></td>
|
<th><?php echo $name; ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php if ( $show_maps && $latitude != null && $longitude != null ): ?>
|
</thead>
|
||||||
|
<?php if ( $address != null || ( $show_maps && $latitude != null && $longitude != null ) ): ?>
|
||||||
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php sp_get_template( 'venue-map.php', array( 'meta' => $meta ) ); ?></td>
|
<td><?php echo $address; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php if ( $show_maps && $latitude != null && $longitude != null ): ?>
|
||||||
</tbody>
|
<tr>
|
||||||
<?php endif; ?>
|
<td><?php sp_get_template( 'venue-map.php', array( 'meta' => $meta ) ); ?></td>
|
||||||
</table>
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ if ( ! isset( $id ) )
|
|||||||
|
|
||||||
$video_url = get_post_meta( $id, 'sp_video', true );
|
$video_url = get_post_meta( $id, 'sp_video', true );
|
||||||
if ( $video_url ):
|
if ( $video_url ):
|
||||||
global $wp_embed;
|
?>
|
||||||
echo $wp_embed->autoembed( $video_url );
|
<div class="sp-event-video">
|
||||||
|
<?php
|
||||||
|
global $wp_embed;
|
||||||
|
echo $wp_embed->autoembed( $video_url );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
|||||||
@@ -153,4 +153,7 @@ $output .= '</div>';
|
|||||||
if ( $show_full_table_link )
|
if ( $show_full_table_link )
|
||||||
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View full table', 'sportspress' ) . '</a>';
|
$output .= '<a class="sp-league-table-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View full table', 'sportspress' ) . '</a>';
|
||||||
|
|
||||||
echo $output;
|
?>
|
||||||
|
<div class="sp-template sp-template-league-table">
|
||||||
|
<?php echo $output; ?>
|
||||||
|
</div>
|
||||||
@@ -63,5 +63,5 @@ foreach( $data as $label => $value ):
|
|||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</dl></div>';
|
$output .= '</dl></div>';
|
||||||
|
?>
|
||||||
echo apply_filters( 'sportspress_player_details', $output );
|
<?php echo $output; ?>
|
||||||
@@ -91,56 +91,61 @@ if ( apply_filters( 'use_default_gallery_style', true ) )
|
|||||||
</style>";
|
</style>";
|
||||||
$size_class = sanitize_html_class( $size );
|
$size_class = sanitize_html_class( $size );
|
||||||
$gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
|
$gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
|
||||||
echo apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );
|
echo apply_filters( 'gallery_style', $gallery_style . "\n\t\t" );
|
||||||
|
?>
|
||||||
|
<div class="sp-template sp-template-player-gallery">
|
||||||
|
<?php echo $gallery_div; ?>
|
||||||
|
<?php
|
||||||
|
if ( intval( $number ) > 0 )
|
||||||
|
$limit = $number;
|
||||||
|
|
||||||
if ( intval( $number ) > 0 )
|
if ( $grouping === 'position' ):
|
||||||
$limit = $number;
|
$groups = get_terms( 'sp_position', array( 'orderby' => 'slug' ) );
|
||||||
|
else:
|
||||||
if ( $grouping === 'position' ):
|
$group = new stdClass();
|
||||||
$groups = get_terms( 'sp_position', array( 'orderby' => 'slug' ) );
|
$group->term_id = null;
|
||||||
else:
|
$group->name = null;
|
||||||
$group = new stdClass();
|
$group->slug = null;
|
||||||
$group->term_id = null;
|
$groups = array( $group );
|
||||||
$group->name = null;
|
|
||||||
$group->slug = null;
|
|
||||||
$groups = array( $group );
|
|
||||||
endif;
|
|
||||||
|
|
||||||
foreach ( $groups as $group ):
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
if ( ! empty( $group->name ) ):
|
|
||||||
echo '<a name="group-' . $group->slug . '" id="group-' . $group->slug . '"></a>';
|
|
||||||
echo '<' . $grouptag . ' class="player-group-name player-gallery-group-name">' . $group->name . '</' . $grouptag . '>';
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
foreach( $data as $player_id => $performance ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
|
foreach ( $groups as $group ):
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
if ( isset( $limit ) && $i >= $limit ) continue;
|
if ( ! empty( $group->name ) ):
|
||||||
|
echo '<a name="group-' . $group->slug . '" id="group-' . $group->slug . '"></a>';
|
||||||
|
echo '<' . $grouptag . ' class="player-group-name player-gallery-group-name">' . $group->name . '</' . $grouptag . '>';
|
||||||
|
endif;
|
||||||
|
|
||||||
$caption = get_the_title( $player_id );
|
foreach( $data as $player_id => $performance ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
|
||||||
$caption = trim( $caption );
|
|
||||||
|
|
||||||
sp_get_template( 'player-gallery-thumbnail.php', array(
|
if ( isset( $limit ) && $i >= $limit ) continue;
|
||||||
'id' => $player_id,
|
|
||||||
'performance' => $performance,
|
|
||||||
'itemtag' => $itemtag,
|
|
||||||
'icontag' => $icontag,
|
|
||||||
'captiontag' => $captiontag,
|
|
||||||
'caption' => $caption,
|
|
||||||
'size' => $size,
|
|
||||||
'link_posts' => $link_posts,
|
|
||||||
) );
|
|
||||||
|
|
||||||
$i++;
|
$caption = get_the_title( $player_id );
|
||||||
|
$caption = trim( $caption );
|
||||||
|
|
||||||
endif; endforeach;
|
sp_get_template( 'player-gallery-thumbnail.php', array(
|
||||||
|
'id' => $player_id,
|
||||||
|
'performance' => $performance,
|
||||||
|
'itemtag' => $itemtag,
|
||||||
|
'icontag' => $icontag,
|
||||||
|
'captiontag' => $captiontag,
|
||||||
|
'caption' => $caption,
|
||||||
|
'size' => $size,
|
||||||
|
'link_posts' => $link_posts,
|
||||||
|
) );
|
||||||
|
|
||||||
echo '<br style="clear: both;" />';
|
$i++;
|
||||||
|
|
||||||
endforeach;
|
endif; endforeach;
|
||||||
|
|
||||||
echo "</div>\n";
|
|
||||||
|
|
||||||
if ( $show_all_players_link )
|
echo '<br style="clear: both;" />';
|
||||||
echo '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
|
||||||
|
endforeach;
|
||||||
|
|
||||||
|
echo "</div>\n";
|
||||||
|
|
||||||
|
if ( $show_all_players_link )
|
||||||
|
echo '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
@@ -162,5 +162,7 @@ endforeach;
|
|||||||
|
|
||||||
if ( $show_all_players_link )
|
if ( $show_all_players_link )
|
||||||
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
$output .= '<a class="sp-player-list-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
||||||
|
?>
|
||||||
echo apply_filters( 'sportspress_player_list', $output );
|
<div class="sp-template sp-template-player-list">
|
||||||
|
<?php echo $output; ?>
|
||||||
|
</div>
|
||||||
@@ -60,7 +60,10 @@ if ( is_array( $leagues ) ):
|
|||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</tbody>' . '</table>' . '</div>';
|
$output .= '</tbody>' . '</table>' . '</div>';
|
||||||
|
?>
|
||||||
echo apply_filters( 'sportspress_player_statistics', $output );
|
<div class="sp-template sp-template-player-statistics">
|
||||||
|
<?php echo $output; ?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
endif;
|
endif;
|
||||||
|
|||||||
@@ -53,5 +53,7 @@ foreach( $data as $label => $value ):
|
|||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</dl></div>';
|
$output .= '</dl></div>';
|
||||||
|
?>
|
||||||
echo apply_filters( 'sportspress_staff_details', $output );
|
<div class="sp-template sp-template-staff-details">
|
||||||
|
<?php echo $output; ?>
|
||||||
|
</div>
|
||||||
@@ -67,4 +67,7 @@ foreach ( $leagues as $league ):
|
|||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
echo apply_filters( 'sportspress_team_columns', $output );
|
?>
|
||||||
|
<div class="sp-template sp-template-team-columns">
|
||||||
|
<?php echo $output; ?>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user