Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AntoineH

    (@antoineh)

    Could it be that there is a match and a question with the same end date, or several matches with the same end date? In that case the ordering of the results can go wrong in the shortcode.

    Can you try the following sql on your database? Change the user_id with the number for your user.

    SELECT total_score FROM pool_wp_scorehistory
    WHERE user_id = 1 AND ranking_id = 1
    ORDER BY score_date DESC

    It selects the rows from the score table ordered by date. If there is a total_score in the list that is higher than the first record, then we are facing this problem.

    A quick fix is changing the code for the shortcode to take the max score.
    File classes/class-football-pool-pool.php change line 148 to

    sprintf( "SELECT MAX( total_score ) FROM {$prefix}scorehistory

    Version 2.4.0 won’t have this problem as it calculates the score order differently.

    Thread Starter sillery4ever

    (@sillery4ever)

    result of sql select :

    4630
    4630
    4615
    4630
    4600
    4600
    4600
    4500
    4385
    4400 …

    Thread Starter sillery4ever

    (@sillery4ever)

    result of sql select :

    4630
    4630
    4615
    4630
    4600
    4600
    4600
    4500
    4385
    4400 …

    Thread Starter sillery4ever

    (@sillery4ever)

    i have fix the problem with

    sprintf( “SELECT MAX( total_score ) FROM {$prefix}scorehistory

    in line 148

    TY

    Nano

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Little mistake in shortcode user-score display’ is closed to new replies.