Fix Plugin-Check warnings
This commit is contained in:
@@ -1,12 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
function sportspress_admin_menu( $position ) {
|
function sportspress_admin_menu( $position ) {
|
||||||
add_options_page(
|
|
||||||
__( 'SportsPress', 'sportspress' ),
|
|
||||||
__( 'SportsPress', 'sportspress' ),
|
|
||||||
'manage_options',
|
|
||||||
'sportspress',
|
|
||||||
'sportspress_settings'
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'manage_options' ) )
|
if ( ! current_user_can( 'manage_options' ) )
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
|||||||
|
|
||||||
if ( is_admin() ):
|
if ( is_admin() ):
|
||||||
|
|
||||||
switch ( $typenow ):
|
if ( 'sp_team' == $typenow ):
|
||||||
case 'sp_team':
|
|
||||||
switch ( $untranslated_text ):
|
switch ( $untranslated_text ):
|
||||||
case 'Enter title here':
|
case 'Enter title here':
|
||||||
$translated_text = __( 'Team', 'sportspress' );
|
$translated_text = __( 'Team', 'sportspress' );
|
||||||
@@ -20,22 +19,7 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
|||||||
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
|
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
|
||||||
break;
|
break;
|
||||||
endswitch;
|
endswitch;
|
||||||
case 'sp_event':
|
elseif ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff' ) ) ):
|
||||||
switch ( $untranslated_text ):
|
|
||||||
case 'Enter title here':
|
|
||||||
$translated_text = __( '(auto)', 'sportspress' );
|
|
||||||
break;
|
|
||||||
case 'Scheduled for: <b>%1$s</b>':
|
|
||||||
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );
|
|
||||||
break;
|
|
||||||
case 'Published on: <b>%1$s</b>':
|
|
||||||
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );
|
|
||||||
break;
|
|
||||||
case 'Publish <b>immediately</b>':
|
|
||||||
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );
|
|
||||||
break;
|
|
||||||
endswitch;
|
|
||||||
case 'sp_player':
|
|
||||||
switch ( $untranslated_text ):
|
switch ( $untranslated_text ):
|
||||||
case 'Enter title here':
|
case 'Enter title here':
|
||||||
$translated_text = __( 'Name', 'sportspress' );
|
$translated_text = __( 'Name', 'sportspress' );
|
||||||
@@ -50,41 +34,18 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
|||||||
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
||||||
break;
|
break;
|
||||||
case 'Scheduled for: <b>%1$s</b>':
|
case 'Scheduled for: <b>%1$s</b>':
|
||||||
$translated_text = __( 'Joined: <b>%1$s</b>', 'sportspress' );
|
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );
|
||||||
break;
|
break;
|
||||||
case 'Published on: <b>%1$s</b>':
|
case 'Published on: <b>%1$s</b>':
|
||||||
$translated_text = __( 'Joined: <b>%1$s</b>', 'sportspress' );
|
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );
|
||||||
break;
|
break;
|
||||||
case 'Publish <b>immediately</b>':
|
case 'Publish <b>immediately</b>':
|
||||||
$translated_text = __( 'Joined: <b>%1$s</b>', 'sportspress' );
|
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );
|
||||||
break;
|
break;
|
||||||
endswitch;
|
endswitch;
|
||||||
case 'sp_staff':
|
|
||||||
switch ( $untranslated_text ):
|
|
||||||
case 'Enter title here':
|
|
||||||
$translated_text = __( 'Name', 'sportspress' );
|
|
||||||
break;
|
|
||||||
case 'Set featured image':
|
|
||||||
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
|
||||||
break;
|
|
||||||
case 'Set Featured Image':
|
|
||||||
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
|
||||||
break;
|
|
||||||
case 'Remove featured image':
|
|
||||||
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
|
||||||
break;
|
|
||||||
case 'Scheduled for: <b>%1$s</b>':
|
|
||||||
$translated_text = __( 'Joined: <b>%1$s</b>', 'sportspress' );
|
|
||||||
break;
|
|
||||||
case 'Published on: <b>%1$s</b>':
|
|
||||||
$translated_text = __( 'Joined: <b>%1$s</b>', 'sportspress' );
|
|
||||||
break;
|
|
||||||
case 'Publish <b>immediately</b>':
|
|
||||||
$translated_text = __( 'Joined: <b>%1$s</b>', 'sportspress' );
|
|
||||||
break;
|
|
||||||
endswitch;
|
|
||||||
endswitch;
|
|
||||||
endif;
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
return $translated_text;
|
return $translated_text;
|
||||||
}
|
}
|
||||||
add_filter( 'gettext', 'sportspress_gettext', 20, 3 );
|
add_filter( 'gettext', 'sportspress_gettext', 20, 3 );
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
|
|||||||
edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-icon' ), '', '', $post_id );
|
edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-icon' ), '', '', $post_id );
|
||||||
break;
|
break;
|
||||||
case 'sp_position':
|
case 'sp_position':
|
||||||
echo get_the_terms( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : '—';
|
echo get_the_terms( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : '—';
|
||||||
break;
|
break;
|
||||||
case 'sp_positions':
|
case 'sp_positions':
|
||||||
echo get_the_terms ( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : sprintf( __( 'All %s', 'sportspress' ), __( 'positions', 'sportspress' ) );
|
echo get_the_terms ( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : sprintf( __( 'All %s', 'sportspress' ), __( 'positions', 'sportspress' ) );
|
||||||
@@ -15,7 +15,7 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
|
|||||||
$post_type = get_post_type( $post );
|
$post_type = get_post_type( $post );
|
||||||
$teams = get_post_meta ( $post_id, 'sp_team', false );
|
$teams = get_post_meta ( $post_id, 'sp_team', false );
|
||||||
if ( empty( $teams ) ):
|
if ( empty( $teams ) ):
|
||||||
echo '—';
|
echo '—';
|
||||||
break;
|
break;
|
||||||
elseif ( $post_type == 'sp_event' ):
|
elseif ( $post_type == 'sp_event' ):
|
||||||
$results = get_post_meta( $post_id, 'sp_results', true );
|
$results = get_post_meta( $post_id, 'sp_results', true );
|
||||||
@@ -33,7 +33,7 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
|
|||||||
);
|
);
|
||||||
$outcomes = get_posts( $args );
|
$outcomes = get_posts( $args );
|
||||||
|
|
||||||
echo $team->post_title . ( $outcomes ? ' — ' . $outcomes[0]->post_title : '' ) . '<br>';
|
echo $team->post_title . ( $outcomes ? ' — ' . $outcomes[0]->post_title : '' ) . '<br>';
|
||||||
else:
|
else:
|
||||||
echo $team->post_title . '<br>';
|
echo $team->post_title . '<br>';
|
||||||
endif;
|
endif;
|
||||||
@@ -70,19 +70,19 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
|
|||||||
echo sportspress_the_posts( $post_id, 'sp_player' );
|
echo sportspress_the_posts( $post_id, 'sp_player' );
|
||||||
break;
|
break;
|
||||||
case 'sp_event':
|
case 'sp_event':
|
||||||
echo get_post_meta ( $post_id, 'sp_event' ) ? sizeof( get_post_meta ( $post_id, 'sp_event' ) ) : '—';
|
echo get_post_meta ( $post_id, 'sp_event' ) ? sizeof( get_post_meta ( $post_id, 'sp_event' ) ) : '—';
|
||||||
break;
|
break;
|
||||||
case 'sp_league':
|
case 'sp_league':
|
||||||
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : '—';
|
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : '—';
|
||||||
break;
|
break;
|
||||||
case 'sp_season':
|
case 'sp_season':
|
||||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
|
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
|
||||||
break;
|
break;
|
||||||
case 'sp_venue':
|
case 'sp_venue':
|
||||||
echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : '—';
|
echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : '—';
|
||||||
break;
|
break;
|
||||||
case 'sp_sponsor':
|
case 'sp_sponsor':
|
||||||
echo get_the_terms ( $post_id, 'sp_sponsor' ) ? the_terms( $post_id, 'sp_sponsor' ) : '—';
|
echo get_the_terms ( $post_id, 'sp_sponsor' ) ? the_terms( $post_id, 'sp_sponsor' ) : '—';
|
||||||
break;
|
break;
|
||||||
case 'sp_kickoff':
|
case 'sp_kickoff':
|
||||||
if ( $post->post_status == 'future' ):
|
if ( $post->post_status == 'future' ):
|
||||||
@@ -94,10 +94,10 @@ function sportspress_manage_posts_custom_column( $column, $post_id ) {
|
|||||||
else:
|
else:
|
||||||
_e( 'Pending Review', 'sportspress' );
|
_e( 'Pending Review', 'sportspress' );
|
||||||
endif;
|
endif;
|
||||||
echo '<br />' . date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) );
|
echo '<br />' . date_i18n( __( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) );
|
||||||
break;
|
break;
|
||||||
case 'sp_address':
|
case 'sp_address':
|
||||||
echo get_post_meta( $post_id, 'sp_address', true ) ? get_post_meta( $post_id, 'sp_address', true ) : '—';
|
echo get_post_meta( $post_id, 'sp_address', true ) ? get_post_meta( $post_id, 'sp_address', true ) : '—';
|
||||||
break;
|
break;
|
||||||
endswitch;
|
endswitch;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ function sportspress_post_updated_messages( $messages ) {
|
|||||||
$messages['post'][6] = sprintf( __( '%s published.', 'sportspress' ), $obj->labels->singular_name ) .
|
$messages['post'][6] = sprintf( __( '%s published.', 'sportspress' ), $obj->labels->singular_name ) .
|
||||||
' <a href="' . esc_url( get_permalink($post->ID) ) . '">' . $obj->labels->view_item . '</a>';
|
' <a href="' . esc_url( get_permalink($post->ID) ) . '">' . $obj->labels->view_item . '</a>';
|
||||||
|
|
||||||
$messages['post'][7] = sprintf( __( '%s saved.'), $obj->labels->singular_name );
|
$messages['post'][7] = sprintf( __( '%s saved.', 'sportspress' ), $obj->labels->singular_name );
|
||||||
|
|
||||||
$messages['post'][8] = sprintf( __( '%s submitted.', 'sportspress' ), $obj->labels->singular_name ) .
|
$messages['post'][8] = sprintf( __( '%s submitted.', 'sportspress' ), $obj->labels->singular_name ) .
|
||||||
' <a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '">' .
|
' <a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '">' .
|
||||||
@@ -28,7 +28,7 @@ function sportspress_post_updated_messages( $messages ) {
|
|||||||
|
|
||||||
$messages['post'][9] = sprintf(
|
$messages['post'][9] = sprintf(
|
||||||
__( '%s scheduled for: <strong>%s</strong>.', 'sportspress' ),
|
__( '%s scheduled for: <strong>%s</strong>.', 'sportspress' ),
|
||||||
date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ) .
|
date_i18n( __( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ) .
|
||||||
' <a target="_blank" href="' . esc_url( get_permalink($post->ID) ) . '">' .
|
' <a target="_blank" href="' . esc_url( get_permalink($post->ID) ) . '">' .
|
||||||
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';
|
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ add_action( 'init', 'sportspress_calendar_post_init' );
|
|||||||
function sportspress_calendar_edit_columns() {
|
function sportspress_calendar_edit_columns() {
|
||||||
$columns = array(
|
$columns = array(
|
||||||
'cb' => '<input type="checkbox" />',
|
'cb' => '<input type="checkbox" />',
|
||||||
'title' => __( 'Title' ),
|
'title' => __( 'Title', 'sportspress' ),
|
||||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||||
'sp_venue' => __( 'Venues', 'sportspress' ),
|
'sp_venue' => __( 'Venues', 'sportspress' ),
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ add_action( 'init', 'sportspress_list_post_init' );
|
|||||||
function sportspress_list_edit_columns() {
|
function sportspress_list_edit_columns() {
|
||||||
$columns = array(
|
$columns = array(
|
||||||
'cb' => '<input type="checkbox" />',
|
'cb' => '<input type="checkbox" />',
|
||||||
'title' => __( 'Title' ),
|
'title' => __( 'Title', 'sportspress' ),
|
||||||
'sp_player' => __( 'Players', 'sportspress' ),
|
'sp_player' => __( 'Players', 'sportspress' ),
|
||||||
'sp_league' => __( 'League', 'sportspress' ),
|
'sp_league' => __( 'League', 'sportspress' ),
|
||||||
'sp_season' => __( 'Season', 'sportspress' ),
|
'sp_season' => __( 'Season', 'sportspress' ),
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ function sportspress_player_meta_init( $post ) {
|
|||||||
$seasons = (array)get_the_terms( $post->ID, 'sp_season' );
|
$seasons = (array)get_the_terms( $post->ID, 'sp_season' );
|
||||||
|
|
||||||
remove_meta_box( 'submitdiv', 'sp_player', 'side' );
|
remove_meta_box( 'submitdiv', 'sp_player', 'side' );
|
||||||
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', 'sp_player', 'side', 'high' );
|
add_meta_box( 'submitdiv', __( 'Publish', 'sportspress' ), 'post_submit_meta_box', 'sp_player', 'side', 'high' );
|
||||||
remove_meta_box( 'postimagediv', 'sp_player', 'side' );
|
remove_meta_box( 'postimagediv', 'sp_player', 'side' );
|
||||||
add_meta_box( 'postimagediv', __( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_player', 'side', 'low' );
|
add_meta_box( 'postimagediv', __( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_player', 'side', 'low' );
|
||||||
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'sportspress_player_details_meta', 'sp_player', 'side', 'high' );
|
add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'sportspress_player_details_meta', 'sp_player', 'side', 'high' );
|
||||||
@@ -49,7 +49,7 @@ function sportspress_player_meta_init( $post ) {
|
|||||||
endif;
|
endif;
|
||||||
|
|
||||||
add_meta_box( 'sp_metricsdiv', __( 'Metrics', 'sportspress' ), 'sportspress_player_metrics_meta', 'sp_player', 'normal', 'high' );
|
add_meta_box( 'sp_metricsdiv', __( 'Metrics', 'sportspress' ), 'sportspress_player_metrics_meta', 'sp_player', 'normal', 'high' );
|
||||||
add_meta_box( 'sp_profilediv', __( 'Profile' ), 'sportspress_player_profile_meta', 'sp_player', 'normal', 'high' );
|
add_meta_box( 'sp_profilediv', __( 'Profile', 'sportspress' ), 'sportspress_player_profile_meta', 'sp_player', 'normal', 'high' );
|
||||||
}
|
}
|
||||||
|
|
||||||
function sportspress_player_details_meta( $post ) {
|
function sportspress_player_details_meta( $post ) {
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ add_action( 'init', 'sportspress_staff_post_init' );
|
|||||||
|
|
||||||
function sportspress_staff_meta_init() {
|
function sportspress_staff_meta_init() {
|
||||||
remove_meta_box( 'submitdiv', 'sp_staff', 'side' );
|
remove_meta_box( 'submitdiv', 'sp_staff', 'side' );
|
||||||
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', 'sp_staff', 'side', 'high' );
|
add_meta_box( 'submitdiv', __( 'Publish', 'sportspress' ), 'post_submit_meta_box', 'sp_staff', 'side', 'high' );
|
||||||
remove_meta_box( 'postimagediv', 'sp_staff', 'side' );
|
remove_meta_box( 'postimagediv', 'sp_staff', 'side' );
|
||||||
add_meta_box( 'postimagediv', __( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_staff', 'side', 'low' );
|
add_meta_box( 'postimagediv', __( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_staff', 'side', 'low' );
|
||||||
add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'sportspress_staff_team_meta', 'sp_staff', 'side', 'high' );
|
add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'sportspress_staff_team_meta', 'sp_staff', 'side', 'high' );
|
||||||
add_meta_box( 'sp_profilediv', __( 'Profile' ), 'sportspress_staff_profile_meta', 'sp_staff', 'normal', 'high' );
|
add_meta_box( 'sp_profilediv', __( 'Profile', 'sportspress' ), 'sportspress_staff_profile_meta', 'sp_staff', 'normal', 'high' );
|
||||||
}
|
}
|
||||||
function sportspress_staff_team_meta( $post ) {
|
function sportspress_staff_team_meta( $post ) {
|
||||||
sportspress_post_checklist( $post->ID, 'sp_team' );
|
sportspress_post_checklist( $post->ID, 'sp_team' );
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ add_action( 'init', 'sportspress_table_post_init' );
|
|||||||
function sportspress_table_edit_columns() {
|
function sportspress_table_edit_columns() {
|
||||||
$columns = array(
|
$columns = array(
|
||||||
'cb' => '<input type="checkbox" />',
|
'cb' => '<input type="checkbox" />',
|
||||||
'title' => __( 'Title' ),
|
'title' => __( 'Title', 'sportspress' ),
|
||||||
'sp_league' => __( 'League', 'sportspress' ),
|
'sp_league' => __( 'League', 'sportspress' ),
|
||||||
'sp_season' => __( 'Season', 'sportspress' ),
|
'sp_season' => __( 'Season', 'sportspress' ),
|
||||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function sportspress_team_meta_init( $post ) {
|
|||||||
$seasons = get_the_terms( $post->ID, 'sp_season' );
|
$seasons = get_the_terms( $post->ID, 'sp_season' );
|
||||||
|
|
||||||
remove_meta_box( 'submitdiv', 'sp_team', 'side' );
|
remove_meta_box( 'submitdiv', 'sp_team', 'side' );
|
||||||
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', 'sp_team', 'side', 'high' );
|
add_meta_box( 'submitdiv', __( 'Publish', 'sportspress' ), 'post_submit_meta_box', 'sp_team', 'side', 'high' );
|
||||||
remove_meta_box( 'postimagediv', 'sp_team', 'side' );
|
remove_meta_box( 'postimagediv', 'sp_team', 'side' );
|
||||||
add_meta_box( 'postimagediv', __( 'Logo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_team', 'side', 'low' );
|
add_meta_box( 'postimagediv', __( 'Logo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_team', 'side', 'low' );
|
||||||
|
|
||||||
|
|||||||
@@ -1,184 +0,0 @@
|
|||||||
<?php
|
|
||||||
$args = array(
|
|
||||||
'post_type' => 'sp_column',
|
|
||||||
'numberposts' => -1,
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'orderby' => 'menu_order',
|
|
||||||
'order' => 'ASC'
|
|
||||||
);
|
|
||||||
$data = get_posts( $args );
|
|
||||||
?>
|
|
||||||
<h3 class="title"><?php _e( 'Table Columns', 'sportspress' ); ?></h3>
|
|
||||||
<table class="widefat sp-admin-config-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Key', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Format', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
|
||||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
|
||||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
|
||||||
<td><?php echo $row->post_name; ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_equation( $row->ID ); ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_order( $row->ID ); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php $i++; endforeach; ?>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Table Columns', 'sportspress' ) ); ?></a></th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$args = array(
|
|
||||||
'post_type' => 'sp_statistic',
|
|
||||||
'numberposts' => -1,
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'orderby' => 'menu_order',
|
|
||||||
'order' => 'ASC'
|
|
||||||
);
|
|
||||||
$data = get_posts( $args );
|
|
||||||
?>
|
|
||||||
<h3 class="title"><?php _e( 'Player Statistics', 'sportspress' ); ?></h3>
|
|
||||||
<table class="widefat sp-admin-config-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Key', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Format', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
|
||||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
|
||||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
|
||||||
<td><?php echo $row->post_name; ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
|
|
||||||
<td>Σ <?php echo $row->post_name; ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_order( $row->ID ); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php $i++; endforeach; ?>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Player Statistics', 'sportspress' ) ); ?></a></th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$args = array(
|
|
||||||
'post_type' => 'sp_metric',
|
|
||||||
'numberposts' => -1,
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'orderby' => 'menu_order',
|
|
||||||
'order' => 'ASC'
|
|
||||||
);
|
|
||||||
$data = get_posts( $args );
|
|
||||||
?>
|
|
||||||
<h3 class="title"><?php _e( 'Player Metrics', 'sportspress' ); ?></h3>
|
|
||||||
<table class="widefat sp-admin-config-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Key', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Format', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
|
||||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
|
||||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
|
||||||
<td><?php echo $row->post_name; ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_equation( $row->ID ); ?></td>
|
|
||||||
<td><?php echo sportspress_get_post_order( $row->ID ); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php $i++; endforeach; ?>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_metric' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Player Metrics', 'sportspress' ) ); ?></a></th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$args = array(
|
|
||||||
'post_type' => 'sp_result',
|
|
||||||
'numberposts' => -1,
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'orderby' => 'menu_order',
|
|
||||||
'order' => 'ASC'
|
|
||||||
);
|
|
||||||
$data = get_posts( $args );
|
|
||||||
?>
|
|
||||||
<h3 class="title"><?php _e( 'Results', 'sportspress' ); ?></h3>
|
|
||||||
<table class="widefat sp-admin-config-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Key', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Format', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
|
||||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
|
||||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
|
||||||
<td><?php echo $row->post_name; ?>for / <?php echo $row->post_name; ?>against</td>
|
|
||||||
<td><?php echo sportspress_get_post_format( $row->ID ); ?></td>
|
|
||||||
<td>—</td>
|
|
||||||
<td>—</td>
|
|
||||||
</tr>
|
|
||||||
<?php $i++; endforeach; ?>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_result' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Results', 'sportspress' ) ); ?></a></th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$args = array(
|
|
||||||
'post_type' => 'sp_outcome',
|
|
||||||
'numberposts' => -1,
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'orderby' => 'menu_order',
|
|
||||||
'order' => 'ASC'
|
|
||||||
);
|
|
||||||
$data = get_posts( $args );
|
|
||||||
?>
|
|
||||||
<h3 class="title"><?php _e( 'Outcomes', 'sportspress' ); ?></h3>
|
|
||||||
<table class="widefat sp-admin-config-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?php _e( 'Label', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Key', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Format', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Equation', 'sportspress' ); ?></th>
|
|
||||||
<th><?php _e( 'Sort Order', 'sportspress' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<?php $i = 0; foreach ( $data as $row ): ?>
|
|
||||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
|
||||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
|
||||||
<td><?php echo $row->post_name; ?></td>
|
|
||||||
<td>—</td>
|
|
||||||
<td>—</td>
|
|
||||||
<td>—</td>
|
|
||||||
</tr>
|
|
||||||
<?php $i++; endforeach; ?>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_outcome' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Outcomes', 'sportspress' ) ); ?></a></th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
@@ -186,3 +186,14 @@ function sportspress_validate( $input ) {
|
|||||||
|
|
||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sportspress_add_options_page() {
|
||||||
|
add_options_page(
|
||||||
|
__( 'SportsPress', 'sportspress' ),
|
||||||
|
__( 'SportsPress', 'sportspress' ),
|
||||||
|
'manage_options',
|
||||||
|
'sportspress',
|
||||||
|
'sportspress_settings'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
add_action( 'admin_menu', 'sportspress_add_options_page' );
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ if ( !function_exists( 'sportspress_event_details' ) ) {
|
|||||||
$data = array( __( 'Date', 'sportspress' ) => $date, __( 'Time', 'sportspress' ) => $time );
|
$data = array( __( 'Date', 'sportspress' ) => $date, __( 'Time', 'sportspress' ) => $time );
|
||||||
|
|
||||||
if ( $leagues )
|
if ( $leagues )
|
||||||
$data[ __( 'League', 'sportspress' ) ] = sportspress_array_value( $leagues, 0, '—' )->name;
|
$data[ __( 'League', 'sportspress' ) ] = sportspress_array_value( $leagues, 0, '—' )->name;
|
||||||
|
|
||||||
if ( $seasons )
|
if ( $seasons )
|
||||||
$data[ __( 'Season', 'sportspress' ) ] = sportspress_array_value( $seasons, 0, '—' )->name;
|
$data[ __( 'Season', 'sportspress' ) ] = sportspress_array_value( $seasons, 0, '—' )->name;
|
||||||
|
|
||||||
|
|
||||||
$output = '<h3>' . __( 'Details', 'sportspress' ) . '</h3>';
|
$output = '<h3>' . __( 'Details', 'sportspress' ) . '</h3>';
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ if ( !function_exists( 'sportspress_event_players' ) ) {
|
|||||||
if ( $key == 'name' ):
|
if ( $key == 'name' ):
|
||||||
continue;
|
continue;
|
||||||
endif;
|
endif;
|
||||||
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</tr></tfoot>';
|
$output .= '</tr></tfoot>';
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if ( !function_exists( 'sportspress_event_results' ) ) {
|
|||||||
if ( array_key_exists( $key, $result ) && $result[ $key ] != '' ):
|
if ( array_key_exists( $key, $result ) && $result[ $key ] != '' ):
|
||||||
$value = $result[ $key ];
|
$value = $result[ $key ];
|
||||||
else:
|
else:
|
||||||
$value = '—';
|
$value = '—';
|
||||||
endif;
|
endif;
|
||||||
$table_rows .= '<td class="data-' . $key . '">' . $value . '</td>';
|
$table_rows .= '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if ( !function_exists( 'sportspress_events_calendar' ) ) {
|
|||||||
LIMIT 1");
|
LIMIT 1");
|
||||||
|
|
||||||
/* translators: Calendar caption: 1: month name, 2: 4-digit year */
|
/* translators: Calendar caption: 1: month name, 2: 4-digit year */
|
||||||
$calendar_caption = _x('%1$s %2$s', 'calendar caption');
|
$calendar_caption = _x('%1$s %2$s', 'calendar caption', 'sportspress');
|
||||||
$calendar_output = '<table id="wp-calendar">
|
$calendar_output = '<table id="wp-calendar">
|
||||||
<caption>' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '</caption>
|
<caption>' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '</caption>
|
||||||
<thead>
|
<thead>
|
||||||
@@ -82,7 +82,7 @@ if ( !function_exists( 'sportspress_events_calendar' ) ) {
|
|||||||
<tr>';
|
<tr>';
|
||||||
|
|
||||||
if ( $previous ) {
|
if ( $previous ) {
|
||||||
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . esc_attr( sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year)))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
|
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . esc_attr( sprintf(__('View posts for %1$s %2$s', 'sportspress'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year)))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
|
||||||
} else {
|
} else {
|
||||||
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad"> </td>';
|
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad"> </td>';
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ if ( !function_exists( 'sportspress_events_calendar' ) ) {
|
|||||||
$calendar_output .= "\n\t\t".'<td class="pad"> </td>';
|
$calendar_output .= "\n\t\t".'<td class="pad"> </td>';
|
||||||
|
|
||||||
if ( $next ) {
|
if ( $next ) {
|
||||||
$calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . get_month_link($next->year, $next->month) . '" title="' . esc_attr( sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($next->month), date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) ) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' »</a></td>';
|
$calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . get_month_link($next->year, $next->month) . '" title="' . esc_attr( sprintf(__('View posts for %1$s %2$s', 'sportspress'), $wp_locale->get_month($next->month), date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) ) . '">' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' »</a></td>';
|
||||||
} else {
|
} else {
|
||||||
$calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad"> </td>';
|
$calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad"> </td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ if ( !function_exists( 'sportspress_league_table' ) ) {
|
|||||||
foreach( $labels as $key => $value ):
|
foreach( $labels as $key => $value ):
|
||||||
if ( $key == 'name' )
|
if ( $key == 'name' )
|
||||||
continue;
|
continue;
|
||||||
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</tr>';
|
$output .= '</tr>';
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ if ( !function_exists( 'sportspress_player_league_statistics' ) ) {
|
|||||||
$output .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
$output .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
||||||
|
|
||||||
foreach( $labels as $key => $value ):
|
foreach( $labels as $key => $value ):
|
||||||
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</tr>';
|
$output .= '</tr>';
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
|
|||||||
foreach( $labels as $key => $value ):
|
foreach( $labels as $key => $value ):
|
||||||
if ( $key == 'name' )
|
if ( $key == 'name' )
|
||||||
continue;
|
continue;
|
||||||
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</tr>';
|
$output .= '</tr>';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) {
|
|||||||
|
|
||||||
$common = array(
|
$common = array(
|
||||||
__( 'Number', 'sportspress' ) => $number,
|
__( 'Number', 'sportspress' ) => $number,
|
||||||
__( 'Nationality', 'sportspress' ) => $flag_image . ' ' . sportspress_array_value( $sportspress_countries, $nationality, '—' ),
|
__( 'Nationality', 'sportspress' ) => $flag_image . ' ' . sportspress_array_value( $sportspress_countries, $nationality, '—' ),
|
||||||
);
|
);
|
||||||
|
|
||||||
$data = array_merge( $common, $metrics );
|
$data = array_merge( $common, $metrics );
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ if ( !function_exists( 'sportspress_team_columns' ) ) {
|
|||||||
$output .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
$output .= '<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
||||||
|
|
||||||
foreach( $labels as $key => $value ):
|
foreach( $labels as $key => $value ):
|
||||||
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
$output .= '<td class="data-' . $key . '">' . sportspress_array_value( $row, $key, '—' ) . '</td>';
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</tr>';
|
$output .= '</tr>';
|
||||||
|
|||||||
@@ -41,24 +41,6 @@ table.widefat td.column-sp_icon {
|
|||||||
height: 320px;
|
height: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu #menu-posts-sp_event .wp-menu-name:after,
|
|
||||||
#adminmenu #menu-posts-sp_team .wp-menu-name:after,
|
|
||||||
#adminmenu #menu-posts-sp_staff .wp-menu-name:after {
|
|
||||||
content: ' \03b2';
|
|
||||||
display: inline-block;
|
|
||||||
margin: 1px 0 0 6px;
|
|
||||||
vertical-align: top;
|
|
||||||
-webkit-border-radius: 10px;
|
|
||||||
border-radius: 10px;
|
|
||||||
z-index: 26;
|
|
||||||
background-color: #0074a2;
|
|
||||||
color: #fff;
|
|
||||||
width: 17px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: 17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 768px) {
|
@media only screen and (max-width: 768px) {
|
||||||
|
|
||||||
|
|||||||
@@ -112,14 +112,14 @@ if ( !function_exists( 'sportspress_get_post_format' ) ) {
|
|||||||
$format = get_post_meta ( $post_id, 'sp_format', true );
|
$format = get_post_meta ( $post_id, 'sp_format', true );
|
||||||
if ( $format ):
|
if ( $format ):
|
||||||
$formats = sportspress_get_config_formats();
|
$formats = sportspress_get_config_formats();
|
||||||
$format_str = sportspress_array_value( $formats, $format, '—' );
|
$format_str = sportspress_array_value( $formats, $format, '—' );
|
||||||
if ( in_array( $format, array( 'decimal', 'time' ) ) ):
|
if ( in_array( $format, array( 'decimal', 'time' ) ) ):
|
||||||
return $format_str . ' (' . sportspress_get_post_precision( $post_id ) . ')';
|
return $format_str . ' (' . sportspress_get_post_precision( $post_id ) . ')';
|
||||||
else:
|
else:
|
||||||
return $format_str;
|
return $format_str;
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
return '—';
|
return '—';
|
||||||
endif;
|
endif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ if ( !function_exists( 'sportspress_get_post_equation' ) ) {
|
|||||||
$equation
|
$equation
|
||||||
);
|
);
|
||||||
else:
|
else:
|
||||||
return '—';
|
return '—';
|
||||||
endif;
|
endif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ if ( !function_exists( 'sportspress_get_post_order' ) ) {
|
|||||||
get_post_meta ( $post_id, 'sp_order', true )
|
get_post_meta ( $post_id, 'sp_order', true )
|
||||||
);
|
);
|
||||||
else:
|
else:
|
||||||
return '—';
|
return '—';
|
||||||
endif;
|
endif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -330,7 +330,7 @@ if ( !function_exists( 'sportspress_post_checklist' ) ) {
|
|||||||
<?php
|
<?php
|
||||||
$title = $post->post_title;
|
$title = $post->post_title;
|
||||||
if ( empty( $title ) )
|
if ( empty( $title ) )
|
||||||
$title = __( '(no title)' );
|
$title = __( '(no title)', 'sportspress' );
|
||||||
echo $title;
|
echo $title;
|
||||||
?>
|
?>
|
||||||
</label>
|
</label>
|
||||||
@@ -809,7 +809,7 @@ if ( !function_exists( 'sportspress_event_player_status_selector' ) ) {
|
|||||||
function sportspress_event_player_status_selector( $team_id, $player_id, $value = null ) {
|
function sportspress_event_player_status_selector( $team_id, $player_id, $value = null ) {
|
||||||
|
|
||||||
if ( ! $team_id || ! $player_id )
|
if ( ! $team_id || ! $player_id )
|
||||||
return '—';
|
return '—';
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'lineup' => __( 'Starting Lineup', 'sportspress' ),
|
'lineup' => __( 'Starting Lineup', 'sportspress' ),
|
||||||
@@ -833,7 +833,7 @@ if ( !function_exists( 'sportspress_event_player_sub_selector' ) ) {
|
|||||||
function sportspress_event_player_sub_selector( $team_id, $player_id, $value, $data = array() ) {
|
function sportspress_event_player_sub_selector( $team_id, $player_id, $value, $data = array() ) {
|
||||||
|
|
||||||
if ( ! $team_id || ! $player_id )
|
if ( ! $team_id || ! $player_id )
|
||||||
return '—';
|
return '—';
|
||||||
|
|
||||||
$output = '<select name="sp_players[' . $team_id . '][' . $player_id . '][sub]" style="display: none;">';
|
$output = '<select name="sp_players[' . $team_id . '][' . $player_id . '][sub]" style="display: none;">';
|
||||||
|
|
||||||
@@ -1030,7 +1030,7 @@ if ( !function_exists( 'sportspress_solve' ) ) {
|
|||||||
if ( array_sum( $last10 ) > 0 ):
|
if ( array_sum( $last10 ) > 0 ):
|
||||||
return implode( '-', $last10 );
|
return implode( '-', $last10 );
|
||||||
else:
|
else:
|
||||||
return '—';
|
return '—';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -1479,10 +1479,10 @@ if ( !function_exists( 'sportspress_get_league_table_data' ) ) {
|
|||||||
$outcome = $outcomes[0];
|
$outcome = $outcomes[0];
|
||||||
$totals[ $team_id ]['streak'] = $outcome->post_title . $streak['count'];
|
$totals[ $team_id ]['streak'] = $outcome->post_title . $streak['count'];
|
||||||
else:
|
else:
|
||||||
$totals[ $team_id ]['streak'] = '—';
|
$totals[ $team_id ]['streak'] = '—';
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
$totals[ $team_id ]['streak'] = '—';
|
$totals[ $team_id ]['streak'] = '—';
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
|
|||||||
@@ -341,8 +341,6 @@ class eqEOS {
|
|||||||
|
|
||||||
//remove all white-space
|
//remove all white-space
|
||||||
preg_replace("/\s/", "", $infix);
|
preg_replace("/\s/", "", $infix);
|
||||||
if(DEBUG)
|
|
||||||
$hand=fopen("eq.txt","a");
|
|
||||||
|
|
||||||
//Find all the variables that were passed and replaces them
|
//Find all the variables that were passed and replaces them
|
||||||
while((preg_match('/(.){0,1}[&$]([a-zA-Z]+)(.){0,1}/', $infix, $match)) != 0) {
|
while((preg_match('/(.){0,1}[&$]([a-zA-Z]+)(.){0,1}/', $infix, $match)) != 0) {
|
||||||
@@ -352,8 +350,6 @@ class eqEOS {
|
|||||||
$match[3] = "";
|
$match[3] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DEBUG)
|
|
||||||
fwrite($hand, "{$match[1]} || {$match[3]}\n");
|
|
||||||
// Ensure that the variable has an operator or something of that sort in front and back - if it doesn't, add an implied '*'
|
// Ensure that the variable has an operator or something of that sort in front and back - if it doesn't, add an implied '*'
|
||||||
if((!in_array($match[1], array_merge($this->ST, $this->ST1, $this->ST2, $this->SEP['open'])) && $match[1] != "") || is_numeric($match[1])) //$this->SEP['close'] removed
|
if((!in_array($match[1], array_merge($this->ST, $this->ST1, $this->ST2, $this->SEP['open'])) && $match[1] != "") || is_numeric($match[1])) //$this->SEP['close'] removed
|
||||||
$front = "*";
|
$front = "*";
|
||||||
@@ -376,9 +372,6 @@ class eqEOS {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DEBUG)
|
|
||||||
fwrite($hand, "$infix\n");
|
|
||||||
|
|
||||||
// Finds all the 'functions' within the equation and calculates them
|
// Finds all the 'functions' within the equation and calculates them
|
||||||
// NOTE - when using function, only 1 set of paranthesis will be found, instead use brackets for sets within functions!!
|
// NOTE - when using function, only 1 set of paranthesis will be found, instead use brackets for sets within functions!!
|
||||||
while((preg_match("/(". implode("|", $this->FNC) . ")\(([^\)\(]*(\([^\)]*\)[^\(\)]*)*[^\)\(]*)\)/", $infix, $match)) != 0) {
|
while((preg_match("/(". implode("|", $this->FNC) . ")\(([^\)\(]*(\([^\)]*\)[^\(\)]*)*[^\)\(]*)\)/", $infix, $match)) != 0) {
|
||||||
@@ -422,8 +415,6 @@ class eqEOS {
|
|||||||
}
|
}
|
||||||
$infix = str_replace($match[0], $ans, $infix);
|
$infix = str_replace($match[0], $ans, $infix);
|
||||||
}
|
}
|
||||||
if(DEBUG)
|
|
||||||
fclose($hand);
|
|
||||||
return $this->solvePF($this->in2post($infix));
|
return $this->solvePF($this->in2post($infix));
|
||||||
|
|
||||||
|
|
||||||
@@ -500,19 +491,10 @@ class eqGraph extends eqEOS {
|
|||||||
|
|
||||||
$xScale = $this->width/($xHigh-$xLow);
|
$xScale = $this->width/($xHigh-$xLow);
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
if(DEBUG) {
|
|
||||||
$hand=fopen("eqgraph.txt","w");
|
|
||||||
fwrite($hand, "$eq\n");
|
|
||||||
}
|
|
||||||
for($i=$xLow;$i<=$xHigh;$i+=$xStep) {
|
for($i=$xLow;$i<=$xHigh;$i+=$xStep) {
|
||||||
$tester = sprintf("%10.3f",$i);
|
$tester = sprintf("%10.3f",$i);
|
||||||
if($tester == "-0.000") $i = 0;
|
if($tester == "-0.000") $i = 0;
|
||||||
$y = $this->solveIF($eq, $i);
|
$y = $this->solveIF($eq, $i);
|
||||||
//eval('$y='. str_replace('&x', $i, $eq).";"); /* used to debug my eqEOS class results */
|
|
||||||
if(DEBUG) {
|
|
||||||
$tmp1 = sprintf("y(%5.3f) = %10.3f\n", $i, $y);
|
|
||||||
fwrite($hand, $tmp1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If developer asked us to find the upper and lower bounds for y...
|
// If developer asked us to find the upper and lower bounds for y...
|
||||||
if($yGuess==true) {
|
if($yGuess==true) {
|
||||||
@@ -522,8 +504,6 @@ class eqGraph extends eqEOS {
|
|||||||
$xVars[$counter] = $y;
|
$xVars[$counter] = $y;
|
||||||
$counter++;
|
$counter++;
|
||||||
}
|
}
|
||||||
if(DEBUG)
|
|
||||||
fclose($hand);
|
|
||||||
// add 0.01 to each side so that if y is from 1 to 5, the lines at 1 and 5 are seen
|
// add 0.01 to each side so that if y is from 1 to 5, the lines at 1 and 5 are seen
|
||||||
$yLow-=0.01;$yHigh+=0.01;
|
$yLow-=0.01;$yHigh+=0.01;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user