Option to split time and results in event list
This commit is contained in:
@@ -101,7 +101,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
|||||||
|
|
||||||
$selected = isset( $_REQUEST['sp_league'] ) ? $_REQUEST['sp_league'] : null;
|
$selected = isset( $_REQUEST['sp_league'] ) ? $_REQUEST['sp_league'] : null;
|
||||||
$args = array(
|
$args = array(
|
||||||
'show_option_all' => __( 'Show all leagues', 'sportspress' ),
|
'show_option_all' => __( 'Show all competitions', 'sportspress' ),
|
||||||
'taxonomy' => 'sp_league',
|
'taxonomy' => 'sp_league',
|
||||||
'name' => 'sp_league',
|
'name' => 'sp_league',
|
||||||
'selected' => $selected
|
'selected' => $selected
|
||||||
|
|||||||
@@ -22,22 +22,23 @@ class SP_Meta_Box_Calendar_Data {
|
|||||||
$calendar = new SP_Calendar( $post );
|
$calendar = new SP_Calendar( $post );
|
||||||
$data = $calendar->data();
|
$data = $calendar->data();
|
||||||
$usecolumns = $calendar->columns;
|
$usecolumns = $calendar->columns;
|
||||||
$title_format = $calendar->title_format;
|
self::table( $data, $usecolumns );
|
||||||
self::table( $data, $usecolumns, $title_format );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save meta box data
|
* Save meta box data
|
||||||
*/
|
*/
|
||||||
public static function save( $post_id, $post ) {
|
public static function save( $post_id, $post ) {
|
||||||
update_post_meta( $post_id, 'sp_title_format', sp_array_value( $_POST, 'sp_title_format', 'title' ) );
|
|
||||||
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin edit table
|
* Admin edit table
|
||||||
*/
|
*/
|
||||||
public static function table( $data = array(), $usecolumns = null, $title_format = null ) {
|
public static function table( $data = array(), $usecolumns = null ) {
|
||||||
|
$title_format = get_option( 'sportspress_event_list_title_format', 'title' );
|
||||||
|
$time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
|
||||||
|
|
||||||
if ( is_array( $usecolumns ) )
|
if ( is_array( $usecolumns ) )
|
||||||
$usecolumns = array_filter( $usecolumns );
|
$usecolumns = array_filter( $usecolumns );
|
||||||
?>
|
?>
|
||||||
@@ -51,19 +52,37 @@ class SP_Meta_Box_Calendar_Data {
|
|||||||
<th class="column-event">
|
<th class="column-event">
|
||||||
<label for="sp_columns_event">
|
<label for="sp_columns_event">
|
||||||
<input type="checkbox" name="sp_columns[]" value="event" id="sp_columns_event" <?php checked( ! is_array( $usecolumns ) || in_array( 'event', $usecolumns ) ); ?>>
|
<input type="checkbox" name="sp_columns[]" value="event" id="sp_columns_event" <?php checked( ! is_array( $usecolumns ) || in_array( 'event', $usecolumns ) ); ?>>
|
||||||
<select name="sp_title_format" class="sp-title-format-select">
|
<?php
|
||||||
<option value="title" <?php selected( $title_format, 'title' ); ?>><?php _e( 'Title', 'sportspress' ); ?></option>
|
if ( 'teams' == $title_format ) {
|
||||||
<option value="teams" <?php selected( $title_format, 'teams' ); ?>><?php _e( 'Teams', 'sportspress' ); ?></option>
|
_e( 'Home', 'sportspress' ); ?> | <?php _e( 'Away', 'sportspress' );
|
||||||
<option value="homeaway" <?php selected( $title_format, 'homeaway' ); ?>><?php _e( 'Home', 'sportspress' ); ?> | <?php _e( 'Away', 'sportspress' ); ?></option>
|
} elseif ( 'homeaway' == $title_format ) {
|
||||||
</select>
|
_e( 'Teams', 'sportspress' );
|
||||||
|
} else {
|
||||||
|
_e( 'Title', 'sportspress' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
</label>
|
</label>
|
||||||
</th>
|
</th>
|
||||||
<th class="column-time">
|
<th class="column-time">
|
||||||
<label for="sp_columns_time">
|
<label for="sp_columns_time">
|
||||||
<input type="checkbox" name="sp_columns[]" value="time" id="sp_columns_time" <?php checked( ! is_array( $usecolumns ) || in_array( 'time', $usecolumns ) ); ?>>
|
<input type="checkbox" name="sp_columns[]" value="time" id="sp_columns_time" <?php checked( ! is_array( $usecolumns ) || in_array( 'time', $usecolumns ) ); ?>>
|
||||||
<?php _e( 'Time/Results', 'sportspress' ); ?>
|
<?php
|
||||||
|
if ( 'time' == $time_format || 'separate' == $time_format ) {
|
||||||
|
_e( 'Time', 'sportspress' );
|
||||||
|
} else {
|
||||||
|
_e( 'Time/Results', 'sportspress' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
</label>
|
</label>
|
||||||
</th>
|
</th>
|
||||||
|
<?php if ( in_array( $time_format, array( 'separate', 'results' ) ) ) { ?>
|
||||||
|
<th class="column-results">
|
||||||
|
<label for="sp_columns_results">
|
||||||
|
<input type="checkbox" name="sp_columns[]" value="results" id="sp_columns_results" <?php checked( ! is_array( $usecolumns ) || in_array( 'results', $usecolumns ) ); ?>>
|
||||||
|
<?php _e( 'Results', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</th>
|
||||||
|
<?php } ?>
|
||||||
<th class="column-league">
|
<th class="column-league">
|
||||||
<label for="sp_columns_league">
|
<label for="sp_columns_league">
|
||||||
<input type="checkbox" name="sp_columns[]" value="league" id="sp_columns_league" <?php checked( ! is_array( $usecolumns ) || in_array( 'league', $usecolumns ) ); ?>>
|
<input type="checkbox" name="sp_columns[]" value="league" id="sp_columns_league" <?php checked( ! is_array( $usecolumns ) || in_array( 'league', $usecolumns ) ); ?>>
|
||||||
@@ -139,15 +158,30 @@ class SP_Meta_Box_Calendar_Data {
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<?php if ( 'separate' == $time_format ) { ?>
|
||||||
<?php
|
<td>
|
||||||
if ( ! empty( $main_results ) ):
|
<?php echo get_post_time( get_option( 'time_format' ), false, $event, true ); ?>
|
||||||
echo implode( ' - ', $main_results );
|
</td>
|
||||||
else:
|
<td>
|
||||||
echo get_post_time( get_option( 'time_format' ), false, $event, true );
|
<?php
|
||||||
endif;
|
if ( ! empty( $main_results ) ):
|
||||||
?>
|
echo implode( ' - ', $main_results );
|
||||||
</td>
|
else:
|
||||||
|
echo '-';
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<?php } else { ?>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
if ( ! empty( $main_results ) ):
|
||||||
|
echo implode( ' - ', $main_results );
|
||||||
|
else:
|
||||||
|
echo get_post_time( get_option( 'time_format' ), false, $event, true );
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<?php } ?>
|
||||||
<td><?php the_terms( $event->ID, 'sp_league' ); ?></td>
|
<td><?php the_terms( $event->ID, 'sp_league' ); ?></td>
|
||||||
<td><?php the_terms( $event->ID, 'sp_season' ); ?></td>
|
<td><?php the_terms( $event->ID, 'sp_season' ); ?></td>
|
||||||
<td><?php the_terms( $event->ID, 'sp_venue' ); ?></td>
|
<td><?php the_terms( $event->ID, 'sp_venue' ); ?></td>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Core
|
* @category Core
|
||||||
* @package SportsPress/Functions
|
* @package SportsPress/Functions
|
||||||
* @version 1.4.4
|
* @version 1.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -297,6 +297,12 @@ if ( !function_exists( 'sp_numbers_to_words' ) ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !function_exists( 'sp_column_active' ) ) {
|
||||||
|
function sp_column_active( $array = null, $value = null ) {
|
||||||
|
return $array == null || in_array( $value, $array );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( !function_exists( 'sp_get_the_term_id' ) ) {
|
if ( !function_exists( 'sp_get_the_term_id' ) ) {
|
||||||
function sp_get_the_term_id( $post_id, $taxonomy ) {
|
function sp_get_the_term_id( $post_id, $taxonomy ) {
|
||||||
$terms = get_the_terms( $post_id, $taxonomy );
|
$terms = get_the_terms( $post_id, $taxonomy );
|
||||||
@@ -477,10 +483,11 @@ if ( !function_exists( 'sp_dropdown_taxonomies' ) ) {
|
|||||||
'selected' => null,
|
'selected' => null,
|
||||||
'hide_empty' => false,
|
'hide_empty' => false,
|
||||||
'values' => 'slug',
|
'values' => 'slug',
|
||||||
'class' => null,
|
'class' => null,
|
||||||
'property' => null,
|
'property' => null,
|
||||||
'placeholder' => null,
|
'placeholder' => null,
|
||||||
'chosen' => false,
|
'chosen' => false,
|
||||||
|
'parent' => 0,
|
||||||
);
|
);
|
||||||
$args = array_merge( $defaults, $args );
|
$args = array_merge( $defaults, $args );
|
||||||
if ( ! $args['taxonomy'] ) return false;
|
if ( ! $args['taxonomy'] ) return false;
|
||||||
@@ -539,6 +546,26 @@ if ( !function_exists( 'sp_dropdown_taxonomies' ) ) {
|
|||||||
endif;
|
endif;
|
||||||
|
|
||||||
printf( '<option value="%s" %s>%s</option>', $this_value, $selected_prop, $term->name );
|
printf( '<option value="%s" %s>%s</option>', $this_value, $selected_prop, $term->name );
|
||||||
|
|
||||||
|
$term_children = get_term_children( $term->term_id, $args['taxonomy'] );
|
||||||
|
|
||||||
|
foreach ( $term_children as $term_child_id ):
|
||||||
|
$term_child = get_term_by( 'id', $term_child_id, $args['taxonomy'] );
|
||||||
|
|
||||||
|
if ( $args['values'] == 'term_id' ):
|
||||||
|
$this_value = $term_child->term_id;
|
||||||
|
else:
|
||||||
|
$this_value = $term_child->slug;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( strpos( $property, 'multiple' ) !== false ):
|
||||||
|
$selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';
|
||||||
|
else:
|
||||||
|
$selected_prop = selected( $this_value, $selected, false );
|
||||||
|
endif;
|
||||||
|
|
||||||
|
printf( '<option value="%s" %s>%s</option>', $this_value, $selected_prop, '— ' . $term_child->name );
|
||||||
|
endforeach;
|
||||||
endforeach;
|
endforeach;
|
||||||
print( '</select>' );
|
print( '</select>' );
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class SP_Widget_Event_List extends WP_Widget {
|
|||||||
<?php
|
<?php
|
||||||
$the_columns = array(
|
$the_columns = array(
|
||||||
'event' => __( 'Event', 'sportspress' ),
|
'event' => __( 'Event', 'sportspress' ),
|
||||||
'time' => __( 'Time', 'sportspress' ),
|
'time' => __( 'Time/Results', 'sportspress' ),
|
||||||
'venue' => __( 'Venue', 'sportspress' ),
|
'venue' => __( 'Venue', 'sportspress' ),
|
||||||
'article' => __( 'Article', 'sportspress' ),
|
'article' => __( 'Article', 'sportspress' ),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ if ( $order != 'default' )
|
|||||||
$calendar->order = $order;
|
$calendar->order = $order;
|
||||||
$data = $calendar->data();
|
$data = $calendar->data();
|
||||||
$usecolumns = $calendar->columns;
|
$usecolumns = $calendar->columns;
|
||||||
$title_format = $calendar->title_format;
|
$title_format = get_option( 'sportspress_event_list_title_format', 'title' );
|
||||||
|
$time_format = get_option( 'sportspress_event_list_time_format', 'combined' );
|
||||||
|
|
||||||
if ( isset( $columns ) ):
|
if ( isset( $columns ) ):
|
||||||
if ( is_array( $columns ) )
|
if ( is_array( $columns ) )
|
||||||
@@ -51,6 +52,10 @@ if ( isset( $columns ) ):
|
|||||||
else
|
else
|
||||||
$usecolumns = explode( ',', $columns );
|
$usecolumns = explode( ',', $columns );
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
if ( $id ) {
|
||||||
|
echo '<h4 class="sp-table-caption">' . get_the_title( $id ) . '</h4>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<div class="sp-template sp-template-event-list">
|
<div class="sp-template sp-template-event-list">
|
||||||
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
@@ -60,25 +65,47 @@ endif;
|
|||||||
<?php
|
<?php
|
||||||
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) ):
|
switch ( $title_format ) {
|
||||||
if ( $title_format == 'homeaway' ):
|
case 'homeaway':
|
||||||
echo '<th class="data-home">' . __( 'Home', 'sportspress' ) . '</th>';
|
if ( sp_column_active( $usecolumns, 'event' ) ) {
|
||||||
elseif ( $title_format == 'teams' ):
|
echo '<th class="data-home">' . __( 'Home', 'sportspress' ) . '</th>';
|
||||||
echo '<th class="data-teams">' . __( 'Teams', 'sportspress' ) . '</th>';
|
|
||||||
else:
|
|
||||||
echo '<th class="data-event">' . __( 'Event', 'sportspress' ) . '</th>';
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) ):
|
if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
|
||||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) && $title_format == 'homeaway' )
|
echo '<th class="data-time"> </th>';
|
||||||
echo '<th class="data-time"> </th>';
|
} elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
|
||||||
else
|
echo '<th class="data-results"> </th>';
|
||||||
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
}
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) && $title_format == 'homeaway' )
|
echo '<th class="data-away">' . __( 'Away', 'sportspress' ) . '</th>';
|
||||||
echo '<th class="data-away">' . __( 'Away', 'sportspress' ) . '</th>';
|
|
||||||
|
if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
|
||||||
|
echo '<th class="data-time">' . __( 'Time', 'sportspress' ) . '</th>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if ( sp_column_active( $usecolumns, 'event' ) ) {
|
||||||
|
if ( $title_format == 'teams' )
|
||||||
|
echo '<th class="data-teams">' . __( 'Teams', 'sportspress' ) . '</th>';
|
||||||
|
else
|
||||||
|
echo '<th class="data-event">' . __( 'Event', 'sportspress' ) . '</th>';
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( $time_format ) {
|
||||||
|
case 'separate':
|
||||||
|
echo '<th class="data-time">' . __( 'Time', 'sportspress' ) . '</th>';
|
||||||
|
echo '<th class="data-results">' . __( 'Results', 'sportspress' ) . '</th>';
|
||||||
|
break;
|
||||||
|
case 'time':
|
||||||
|
echo '<th class="data-time">' . __( 'Time', 'sportspress' ) . '</th>';
|
||||||
|
break;
|
||||||
|
case 'results':
|
||||||
|
echo '<th class="data-results">' . __( 'Results', 'sportspress' ) . '</th>';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'league', $usecolumns ) )
|
if ( $usecolumns == null || in_array( 'league', $usecolumns ) )
|
||||||
echo '<th class="data-league">' . __( 'Competition', 'sportspress' ) . '</th>';
|
echo '<th class="data-league">' . __( 'Competition', 'sportspress' ) . '</th>';
|
||||||
@@ -110,7 +137,7 @@ endif;
|
|||||||
$main_results = sp_get_main_results( $event );
|
$main_results = sp_get_main_results( $event );
|
||||||
|
|
||||||
$teams_output = '';
|
$teams_output = '';
|
||||||
$teams_array = '';
|
$teams_array = array();
|
||||||
|
|
||||||
if ( $teams ):
|
if ( $teams ):
|
||||||
foreach ( $teams as $team ):
|
foreach ( $teams as $team ):
|
||||||
@@ -143,33 +170,95 @@ endif;
|
|||||||
|
|
||||||
echo '<td class="data-date"><a href="' . get_permalink( $event->ID ) . '"><date>' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '</date>' . get_post_time( get_option( 'date_format' ), false, $event, true ) . '</a></td>';
|
echo '<td class="data-date"><a href="' . get_permalink( $event->ID ) . '"><date>' . get_post_time( 'Y-m-d H:i:s', false, $event ) . '</date>' . get_post_time( get_option( 'date_format' ), false, $event, true ) . '</a></td>';
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) ):
|
switch ( $title_format ) {
|
||||||
if ( $title_format == 'homeaway' ):
|
case 'homeaway':
|
||||||
$team = array_shift( $teams_array );
|
if ( sp_column_active( $usecolumns, 'event' ) ) {
|
||||||
echo '<td class="data-home">' . $team . '</td>';
|
$team = array_shift( $teams_array );
|
||||||
else:
|
echo '<td class="data-home">' . $team . '</td>';
|
||||||
if ( $title_format == 'teams' ):
|
|
||||||
echo '<td class="data-event">' . $teams_output . '</td>';
|
|
||||||
else:
|
|
||||||
echo '<td class="data-event"><a href="' . get_permalink( $event->ID ) . '">' . $event->post_title . '</a></td>';
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) ):
|
if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
|
||||||
echo '<td class="data-time"><a href="' . get_permalink( $event->ID ) . '">';
|
echo '<td class="data-time"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
if ( ! empty( $main_results ) ):
|
if ( ! empty( $main_results ) ):
|
||||||
echo implode( ' - ', $main_results );
|
echo implode( ' - ', $main_results );
|
||||||
else:
|
else:
|
||||||
echo '<date> ' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
|
echo '<date> ' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
|
||||||
endif;
|
endif;
|
||||||
echo '</a></td>';
|
echo '</a></td>';
|
||||||
endif;
|
} elseif ( in_array( $time_format, array( 'separate', 'results' ) ) && sp_column_active( $usecolumns, 'results' ) ) {
|
||||||
|
echo '<td class="data-results"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
if ( ! empty( $main_results ) ):
|
||||||
|
echo implode( ' - ', $main_results );
|
||||||
|
else:
|
||||||
|
echo '-';
|
||||||
|
endif;
|
||||||
|
echo '</a></td>';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'event', $usecolumns ) && $title_format == 'homeaway' ):
|
$team = array_shift( $teams_array );
|
||||||
$team = array_shift( $teams_array );
|
echo '<td class="data-away">' . $team . '</td>';
|
||||||
echo '<td class="data-away">' . $team . '</td>';
|
|
||||||
endif;
|
if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
|
||||||
|
echo '<td class="data-time"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
echo '<date> ' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
|
||||||
|
echo '</a></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if ( sp_column_active( $usecolumns, 'event' ) ) {
|
||||||
|
if ( $title_format == 'teams' )
|
||||||
|
echo '<td class="data-event">' . $teams_output . '</td>';
|
||||||
|
else
|
||||||
|
echo '<td class="data-event"><a href="' . get_permalink( $event->ID ) . '">' . $event->post_title . '</a></td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( $time_format ) {
|
||||||
|
case 'separate':
|
||||||
|
if ( sp_column_active( $usecolumns, 'time' ) ) {
|
||||||
|
echo '<td class="data-time"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
echo '<date> ' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
|
||||||
|
echo '</a></td>';
|
||||||
|
}
|
||||||
|
if ( sp_column_active( $usecolumns, 'results' ) ) {
|
||||||
|
echo '<td class="data-results"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
if ( ! empty( $main_results ) ):
|
||||||
|
echo implode( ' - ', $main_results );
|
||||||
|
else:
|
||||||
|
echo '-';
|
||||||
|
endif;
|
||||||
|
echo '</a></td>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'time':
|
||||||
|
if ( sp_column_active( $usecolumns, 'time' ) ) {
|
||||||
|
echo '<td class="data-time"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
echo '<date> ' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
|
||||||
|
echo '</a></td>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'results':
|
||||||
|
if ( sp_column_active( $usecolumns, 'results' ) ) {
|
||||||
|
echo '<td class="data-results"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
if ( ! empty( $main_results ) ):
|
||||||
|
echo implode( ' - ', $main_results );
|
||||||
|
else:
|
||||||
|
echo '-';
|
||||||
|
endif;
|
||||||
|
echo '</a></td>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if ( sp_column_active( $usecolumns, 'time' ) ) {
|
||||||
|
echo '<td class="data-time"><a href="' . get_permalink( $event->ID ) . '">';
|
||||||
|
if ( ! empty( $main_results ) ):
|
||||||
|
echo implode( ' - ', $main_results );
|
||||||
|
else:
|
||||||
|
echo '<date> ' . get_post_time( 'H:i:s', false, $event ) . '</date>' . sp_get_time( $event );
|
||||||
|
endif;
|
||||||
|
echo '</a></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'league', $usecolumns ) ):
|
if ( $usecolumns == null || in_array( 'league', $usecolumns ) ):
|
||||||
echo '<td class="data-league">';
|
echo '<td class="data-league">';
|
||||||
@@ -231,8 +320,8 @@ endif;
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<?php
|
||||||
<?php
|
if ( $id && $show_all_events_link )
|
||||||
if ( $id && $show_all_events_link )
|
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||||
echo '<a class="sp-calendar-link sp-view-all-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
?>
|
||||||
?>
|
</div>
|
||||||
Reference in New Issue
Block a user