• I am a seasoned programmer but very new to programming php in wordpress.
    |
    I would like to create a custom score system with this plugin. But I don’t know where to start.

    Where is the code for the calculations? And also where is is stored in the database.

    Also would like to edit how the predictions are shown. They are from oldest to newest. I would like to show the new ones first.

    If anyone can give me some pointers on where to find and edit this I would really apreciate it! Thanks!

    • This topic was modified 3 years, 9 months ago by andrechi.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AntoineH

    (@antoineh)

    I would like to create a custom score system with this plugin. But I don’t know where to start.

    Where is the code for the calculations? And also where is is stored in the database.

    Easiest would be to hook into one of the filters that are present in the plugin. The Football_Pool_Pool->calc_score method has 2:

    1. footballpool_score_calc_function_pre
    2. footballpool_score_calc_function_post

    The extensions post in this forum has an example that uses one of these filters.

    If you want to do more, then you can explore the file “/admin/class-football-pool-admin-score-calculations.php”. All scores are saved in the database in the tables “pool_wp_scorehistory_s1_t1” and “pool_wp_scorehistory_s1_t2” (the plugin uses one of these tables as active table and the other for executing a new calculation).

    Also would like to edit how the predictions are shown. They are from oldest to newest. I would like to show the new ones first.

    See Plugin Options page in the admin for an option to change the sorting of the matches. If this does not work for you, you can use the filter footballpool_predictionform_matches_filter to change the sorting of the matches array that is outputted in the form.

    Thread Starter andrechi

    (@andrechi)

    Great! thanks for the info. I’ll start digging!

    Thread Starter andrechi

    (@andrechi)

    I think I asked the wrong question. When I ment the order of the prediction I meant when I do a ranking for a specific week, and the user clicks his name.

    It shows ALL the predictions he has made. from the first one (top) to the last one (bottom)

    Whan I’m trying to do is show results specific of that week’s ranking

    I don;t know if i made muyself clear

    Plugin Author AntoineH

    (@antoineh)

    This is a bit harder to achieve. I had a quick look and I can’t really find a solution to filter the matches on the user’s page with the current code. This means you’ll have to build it yourself. One approach could be that you overwrite the ranking template to change the link that is added to the user name (this is relatively easy). If you link it to a page and add the ranking ID and user ID to the querystring, you can write a shortcode that displays the user’s predictions based on that ranking ID.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Create a custom point system’ is closed to new replies.