Forum Replies Created

Viewing 15 replies - 1 through 15 (of 27 total)
  • Thread Starter iul

    (@iul)

    Thank you. I don’t mean to pester you about it, but how is this coming along? ?? We have quite a few matches each week with different Match Types and ots of mistakes are happening.

    Than you for donating your time working on this.

    Hi, he has already answered this here: https://www.ads-software.com/support/topic/goal-difference-bonus-points-for-close-predictions?replies=13#post-5644334
    I’m the one whom he helped and I confirm that works.

    They are sorted by
    1. number of exact scores predicted;
    2. number of victories predicted;
    3. number of correctly answered questions

    If they are still equal after these criteria then I agree we should have more users on the same position, assuming that’s not too difficult to implement.

    Thread Starter iul

    (@iul)

    Another suggestion:

    7. in the ranking widget, put something like “Full Rankings” with a link to the full rankings page for that particular ranking.

    Thread Starter iul

    (@iul)

    Regarding suggestion no. 2… I just realized the grey bar doesn’t appear above every match. If there are multiple matches on the same date part of the same “Match Type” then the date bar only appears once. Still, It’d be nice if we could add some comments. Maybe the left part of each match’s listing could be split in two rows, with the kick off time on the first row and a bit of empty space on the second row where this text could be inserted.

    Thread Starter iul

    (@iul)

    4. Consider making giving the Goal Difference Bonus for matches ending in a draw a standard feature, or at least an option available to users. I don’t understand why it would make sense to give less points to those correctly predicting a goal difference of 0 than to those correctly predicting a goal difference of 1 or 2. It makes no sense to me.

    5. Display the time zone for each match’s kick off hour. For example, I chose to have all the games start hours be UTC, but it’s not displayed anywhere so users have no way of knowing.

    6. Allow us to give a name to the default ranking. For example, I have enabled the feature allowing users to choose what rankings they want to see when they go to the Rankings page, and the default ranking is there without any explanation to what it actually is and if you click on one of the other rankings from that drop down menu and wait for the page to load, if you open the drop down menu again you see an empty space for the default ranking.

    Thread Starter iul

    (@iul)

    Great. Thank you very much.

    In the mean time I have thought of some other suggestions but I won’t start a new thread just for them so I’ll post them here:

    1. On the Prediction Sheet, also add the “Save” button above the matches list. At the moment it only appears below the matches list, and if you have the matches ordered so the latest matches appear at the top, and you have dozens/hundreds of matches, the users have to scroll down a loooong way to get to where the Save button is.

    2. On the page where you create a new match (I’m talking about the page where you actually fill in the match details, such as the teams, match date, stadium, etc…), add a text input box where we can type in a bit of text that is then displayed on the Prediction Sheet on that gray bar on which the match date is displayed. The date only takes up a little bit of space on the left side and all that other space is left there empty for nothing when we could be using it to display important information, such as the match’s referees, or the weather forecast or the TV channel the game is broadcast on or some other information.

    3. Make it possible for us to only have users who have earned at least a point displayed in the rankings. The reason for this is that often users are registered and part of the pool but they no longer actually participate, and having a bunch of users listed there with 0 points is just unnecessary and it might give the active users a sort of sense of the tipping competition being abandoned.

    Thank you for spending your time developing this. It’s great!

    I’ve done some testing myself and here is what I’ve found:
    Goal difference points AREN’T added to the full score points. They’re only added to toto score.
    Goal difference points are only awarded to those that have correctly predicted the winner AND the goal difference. In my case I have modified the plugin with Antoine’s help (by “help” I mean he did all the work ?? ) to also award them for successfully predicted draws, however the goal difference points aren’t awarded to those that haven’t correctly predicted the winner.
    Example, you tipper TeamA 3 – 1 TeamB, but the final result is TeamA 1 – 3 TeamB. You will not get the points difference bonus.

    Thread Starter iul

    (@iul)

    Thanks. That solved it.

    Thread Starter iul

    (@iul)

    I still get an error. And the statement you gave me now is different than the one already existing in the file:

    INSERT INTO {$prefix}scorehistory
    ( score_order, type, score_date, source_id, user_id
    , score, full, toto, goal_bonus, goal_diff_bonus
    , ranking, ranking_id )
    SELECT
    0, %d AS score_type, m.play_date AS score_date, m.id AS match_id, u.ID AS user_id
    , IF ( p.has_joker = 1, %d, 1 ) AS score
    , IF ( m.home_score = p.home_score AND m.away_score = p.away_score, 1, NULL ) AS full
    , IF ( m.home_score = p.home_score AND m.away_score = p.away_score, NULL,
    IF (
    IF ( m.home_score > m.away_score, 1, IF ( m.home_score = m.away_score, 3, 2 ) )
    =
    IF ( p.home_score > p.away_score, 1, IF ( p.home_score = p.away_score, 3, 2 ) )
    , IF ( p.home_score IS NULL OR p.away_score IS NULL, NULL, 1 )
    , NULL
    )
    ) AS toto
    , IF ( m.home_score = p.home_score,
    IF ( m.away_score = p.away_score, 2, 1 ),
    IF ( m.away_score = p.away_score, 1, NULL )
    ) AS goal_bonus
    , IF( ( CAST( m.home_score AS SIGNED ) – CAST( p.home_score AS SIGNED ) )
    = ( CAST( m.away_score AS SIGNED ) – CAST( p.away_score AS SIGNED ) )
    , 1, NULL
    )
    ) AS goal_diff_bonus
    , 0 AS ranking
    , %d AS ranking_id
    FROM {$wpdb->users} u
    LEFT OUTER JOIN {$prefix}matches m ON ( 1 = 1 )
    LEFT OUTER JOIN {$prefix}predictions p
    ON ( p.match_id = m.id AND ( p.user_id = u.ID OR p.user_id IS NULL ) )
    WHERE m.home_score IS NOT NULL AND m.away_score IS NOT NULL AND u.ID IN ( {$user_ids} )

    Look at the very last line in the code you gave me and the one the file already contains. It’s quite different.

    Thread Starter iul

    (@iul)

    When you say “a copy&paste error” do you mean I didn’t correctly paste the code you gave me?
    I’ve managed to activate debugging and here is the error I get:

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) AS goal_diff_bonus
    , 0 AS ranking
    , 1 AS ranking_id
    ‘ at line 26 for query INSERT INTO pool_wp_rwno_scorehistory
    ( score_order, type, score_date, source_id, user_id
    , score, full, toto, goal_bonus, goal_diff_bonus
    , ranking, ranking_id )
    SELECT
    0, 0 AS score_type, m.play_date AS score_date, m.id AS match_id, u.ID AS user_id
    , IF ( p.has_joker = 1, 1, 1 ) AS score
    , IF ( m.home_score = p.home_score AND m.away_score = p.away_score, 1, NULL ) AS full
    , IF ( m.home_score = p.home_score AND m.away_score = p.away_score, NULL,
    IF (
    IF ( m.home_score > m.away_score, 1, IF ( m.home_score = m.away_score, 3, 2 ) )
    =
    IF ( p.home_score > p.away_score, 1, IF ( p.home_score = p.away_score, 3, 2 ) )
    , IF ( p.home_score IS NULL OR p.away_score IS NULL, NULL, 1 )
    , NULL
    )
    ) AS toto
    , IF ( m.home_score = p.home_score,
    IF ( m.away_score = p.away_score, 2, 1 ),
    IF ( m.away_score = p.away_score, 1, NULL )
    ) AS goal_bonus
    , IF( ( CAST( m.home_score AS SIGNED ) – CAST( p.home_score AS SIGNED ) )
    = ( CAST( m.away_score AS SIGNED ) – CAST( p.away_score AS SIGNED ) )
    , 1, NULL
    )
    ) AS goal_diff_bonus
    , 0 AS ranking
    , 1 AS ranking_id
    FROM wp_rwno_users u
    LEFT OUTER JOIN pool_wp_rwno_matches m ON ( 1 = 1 )
    LEFT OUTER JOIN pool_wp_rwno_predictions p
    ON ( p.match_id = m.id AND ( p.user_id = u.ID OR p.user_id IS NULL ) )
    WHERE m.home_score IS NOT NULL AND m.away_score IS NOT NULL AND u.ID IN ( 1 ) ORDER BY 1, 2, 3, 4 made by do_action(‘wp_ajax_footballpool_calculate_scorehistory’), call_user_func_array, Football_Pool_Admin_Score_Calculation::process

    Thank you for all your help.

    Thread Starter iul

    (@iul)

    OK, so I managed to make the changes you suggested. Whenever some score calculations are supposed to be done, even if none of the predictions and results are draws, I get this error:
    “Step 1: Something went wrong while (re)calculating the scores. Please check if TRUNCATE/DROP or DELETE rights are available at the database and try again.”

    Can you please take a look at the changes made to see what is going wrong?
    Thanks.

    Thread Starter iul

    (@iul)

    Sorry, I was wrong. I was looking at classes/class-football-pool.php

    Thread Starter iul

    (@iul)

    Thank you for the solution offered. There is a problem though.

    classes/class-football-pool-pool.php doesn’t contain
    if ( ! $full && $home != $away && ( $home - $user_home ) == ( $away - $user_away ) ) {
    anywhere.
    I’ve also searched only for “$away” and it doesn’t even contain that.

    Thread Starter iul

    (@iul)

    Again, thank you for your super fast, comprehensive response. My first request seems too complicated for me to implement, but if I could manage to do the second one I guess I could use it as it is, so, could you please tell me how to make the plugin give the “Goal difference bonus” for draws too?

    Thanks.

Viewing 15 replies - 1 through 15 (of 27 total)