• Hi everyone!

    I’m working on a system to calculate points in a tournament, and I’d like to know if it’s possible to add customization elements such as bonuses and penalties. After assigning 1 point for a draw and 2 points for a win, I’d like to integrate the following rules:

    • Bonuses:
      • Goal difference (goals scored – goals conceded) >= 5 → +0.2 points
      • Clean sheet (goals conceded = 0) → +0.3 points
    • Penalties:
      • Each yellow card → -0.1 points

    I’ve attached an image to make the point calculation system clearer. Could someone let me know if this is feasible and which tools might support this kind of customization?

    Thank you very much for your help!

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

    (@savvasha)

    Hi there @fusionex ,

    I cannot see any image attached. Please use a free service like https://snipboard.io/ to share your screenshots/images here.

    You will need to create another event result at SportsPress->Configure->Event Results for your yellow cards. See the attahced screenshot for one I added for Red Cards. Then you can use an equation like shown below.

    ( ( $goalsfor - $goalsagainst ) > 5 ) * ( 2 / 10 ) + ( $goalsagainst == 0 ) * ( 3 / 10 ) - $totalredcardsfor * ( 1 / 10 )

    Thanks,
    Savvas

    Thread Starter fusionex

    (@fusionex)

    Thank you very much for your reply!

    Following your advice, I added a new “event result,” and it is now correctly available in the system. That part can be considered resolved.

    However, when I try to insert the suggested equation:
    ( ( $goalsfor - $goalsagainst ) > 5 ) * ( 2 / 10 )

    I get the following errors:

    Warning: Undefined array key 0 in /Users/giosemi/Local Sites/progetto-interschool-01/app/public/wp-content/plugins/sportspress/modules/sportspress-conditional-equations.php on line 101 [...]

    These warnings seem to repeat multiple times on the same lines of the file sportspress-conditional-equations.php.

    I’ve attached a screenshot for better clarity. What could be causing these issues? Could it be due to a misconfiguration or a bug in the plugin?

    Thanks again for your support!

    • This reply was modified 4 days, 2 hours ago by fusionex.
    Thread Starter fusionex

    (@fusionex)

    I forgot to tag you, I don’t know if it’s necessary

    @savvasha

    Thank you very much for the support

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