• Resolved xppc

    (@xppc)


    Hello, I am currently setting up a website using Sportspress. I am having trouble with showing the OUTCOME of matches in my events. I am only using WIN or LOSS as my outcomes for events. Currently event details show Time/Result as just the time that I input the data with no option for changing to the outcome. I cannot show OUTCOME in event details or event list / event blocks (calendar shortcodes). On the event list block for the calendar, if I select “Event Specs” it just has two columns for WIN and LOSS with no data in it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Savvas

    (@savvasha)

    Hi there @xppc ,

    Can you share a link to an event that has this issue? Share some screenshots from the edit page of this event to see how you set your scores and outcomes.

    Thanks,
    Savvas

    Thread Starter xppc

    (@xppc)

    Hi thank you for your help. Here is the screenshot of the event edit page where I’ve input the results and what I’m seeing on a page I put an event block and also event details in:

    As you can see, the Time/Results show as just the time of when I input the data in. I am trying to show the WIN and LOSS outcomes.

    • This reply was modified 2 months, 1 week ago by xppc.
    Plugin Contributor Savvas

    (@savvasha)

    Please go to SportsPress->Settings->Events->Event List and confirm that you DONT have selected at Time/Results Format the Time only option.

    Thread Starter xppc

    (@xppc)

    I tried that and am just getting the Time (as expected). I’m looking for just the result or outcome.

    I tried “Results only” in the settings as that makes more sense to me for what I am trying to do, but I am still not seeing WIN or LOSS (the outcome) under Results. Under the Event Details on the team, I’m still seeing the time.

    Plugin Contributor Savvas

    (@savvasha)

    Can you share the link to this page please?

    Thanks, Savvas

    Thread Starter xppc

    (@xppc)

    Plugin Contributor Savvas

    (@savvasha)

    Hi @xppc ,

    It seems like you are not using any “results” info, and thats why it show empty space before and after “-” on results column. If you want to show Outcomes, instead of Results you will need to modify event-list.php template by copy it from wp-content/plugins/sportspress/templates/ to wp-content/themes/your-child-theme/sportspress/ .

    The line you need to alter is probably 251:

    $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );

    Change it to something like

    $main_results = array();
    $outcomes_array = sp_get_outcomes( $event->ID );
    // Loop through the original array
    foreach ( $outcomes_array as $team_id => $outcome ) {
    if ( isset( $outcome[0] ) ) {
    $main_results[] = $outcome[0];
    }else{
    $main_results[] = null;
    }
    }

    Thanks,
    Savvas

    Thread Starter xppc

    (@xppc)

    Hi Savvas,

    Appreciate the guidance on this!

    Is there a way to use the Results info to report WIN or LOSS for each team?

    Plugin Contributor Savvas

    (@savvasha)

    Hi there @xppc ,

    I am not sure I understand exactly what you want to achieve ?? Can you give some examples?

    Thanks,
    Savvas

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.