WordPress.org

Forums

Football Pool
[resolved] Little mistake in shortcode user-score display (4 posts)

  1. sillery4ever
    Member
    Posted 2 years ago #

    Hello Antoine,

    I have just seen a mistake

    Today My points (Nano) are 4630 on this page :
    http://www.tyknauspro.fr/classement-general/

    but my short code [fp-user-score date="now"] display on an other page only : 4615 pts.... why ?

    4630 is the correct number of points !

    could you help me to fix this ?

    TY

    Nano

    https://wordpress.org/plugins/football-pool/

  2. AntoineH
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. sillery4ever
    Member
    Posted 2 years ago #

    result of sql select :

    4630
    4630
    4615
    4630
    4600
    4600
    4600
    4500
    4385
    4400 ...

  4. sillery4ever
    Member
    Posted 2 years ago #

    result of sql select :

    4630
    4630
    4615
    4630
    4600
    4600
    4600
    4500
    4385
    4400 ...

  5. sillery4ever
    Member
    Posted 2 years ago #

    i have fix the problem with

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

    in line 148

    TY

    Nano

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Football Pool
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.