Add more front end glory

This commit is contained in:
Brian Miyaji
2014-01-15 17:24:50 +11:00
parent e3a04bc8c9
commit 5bbd3a179f
8 changed files with 276 additions and 111 deletions

View File

@@ -5,44 +5,59 @@ function sportspress_the_content( $content ) {
global $post;
// Display event details
$content = sportspress_event_details( $post->ID ) . $content;
$details = sportspress_event_details( $post->ID );
$results = sportspress_event_results( $post->ID );
$players = sportspress_event_players( $post->ID );
$staff = sportspress_event_staff( $post->ID );
if ( ! empty( $results ) ):
$content = $results . $details . $players . $staff . $content;
else:
$venue = sportspress_event_venue( $post->ID );
$content = $details . $venue . $players . $staff . $content;
endif;
elseif ( is_singular( 'sp_calendar' ) && in_the_loop() ):
global $post;
// Display events calendar
$content = sportspress_events_calendar( $post->ID ) . $content;
$calendar = sportspress_events_calendar( $post->ID );
$content = $calendar . $content;
elseif ( is_singular( 'sp_team' ) && in_the_loop() ):
global $post;
// Display team columns
$content = sportspress_team_columns( $post->ID ) . $content;
$columns = sportspress_team_columns( $post->ID );
$content = $columns . $content;
elseif ( is_singular( 'sp_table' ) && in_the_loop() ):
global $post;
// Display league table
$content = sportspress_league_table( $post->ID ) . $content;
sportspress_league_table( $post->ID );
$content = $table . $content;
elseif ( is_singular( 'sp_list' ) && in_the_loop() ):
global $post;
// Display player list
$content = sportspress_player_list( $post->ID ) . $content;
$list = sportspress_player_list( $post->ID );
$content = $list . $content;
elseif ( is_singular( 'sp_player' ) && in_the_loop() ):
global $post;
// Display player metrics and statistics
$content = sportspress_player_metrics( $post->ID ) . sportspress_player_statistics( $post->ID ) . $content;
$metrics = sportspress_player_metrics( $post->ID );
$statistics = sportspress_player_statistics( $post->ID );
$content = $metrics . $statistics . $content;
endif;

View File

@@ -6,6 +6,7 @@ function sportspress_enqueue_scripts() {
// Scripts
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'google-maps', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array(), '3.exp', true );
wp_enqueue_script( 'jquery-datatables', SPORTSPRESS_PLUGIN_URL .'/assets/js/jquery.dataTables.min.js', array( 'jquery' ), '1.9.4', true );
wp_enqueue_script( 'sportspress', SPORTSPRESS_PLUGIN_URL .'/assets/js/sportspress.js', array( 'jquery' ), time(), true );
}

View File

@@ -38,8 +38,8 @@ function sportspress_event_meta_init( $post ) {
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'sportspress_event_details_meta', 'sp_event', 'side', 'high' );
add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'sportspress_event_team_meta', 'sp_event', 'side', 'high' );
if ( sizeof( $teams ) > 0 ):
add_meta_box( 'sp_playersdiv', __( 'Players', 'sportspress' ), 'sportspress_event_players_meta', 'sp_event', 'normal', 'high' );
add_meta_box( 'sp_resultsdiv', __( 'Results', 'sportspress' ), 'sportspress_event_results_meta', 'sp_event', 'normal', 'high' );
add_meta_box( 'sp_playersdiv', __( 'Players', 'sportspress' ), 'sportspress_event_players_meta', 'sp_event', 'normal', 'high' );
endif;
add_meta_box( 'sp_articlediv', __( 'Article', 'sportspress' ), 'sportspress_event_article_meta', 'sp_event', 'normal', 'high' );
}
@@ -157,7 +157,7 @@ function sportspress_event_players_meta( $post ) {
?>
<div>
<p><strong><?php echo get_the_title( $team_id ); ?></strong></p>
<?php sportspress_event_players_table( $columns, $data, $team_id ); ?>
<?php sportspress_edit_event_players_table( $columns, $data, $team_id ); ?>
</div>
<?php