• Hi Antoine,

    Loving the plugin so far. I have a couple of questions:

    1. Is there a way I can check, as an administrator, whether players have successfully submitted scores without actually seeing what they’ve submitted?

    2. How can I make a pool administrator a contributor as well so they can contribute posts and fill out actual results but not have full admin privileges?

    3. And finally is there a short code which can quickly and easily show the top five predictors’ last predictions on one page?

    Thanks so much for an excellent piece of coding!

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

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

    (@antoineh)

    Hi,

    1. No, there is no admin screen for that. You would have to query the database for it. Example below is for one user. The query selects users based on their login name.

    SELECT u.display_name AS user_name, m.id AS match_nr, t1.name AS home, t2.name AS away
    FROM pool_wp_predictions p
    INNER JOIN wp_users u ON ( u.ID = p.user_id )
    INNER JOIN pool_wp_matches m ON ( m.id = p.match_id )
    INNER JOIN pool_wp_teams t1 ON ( t1.id = m.home_team_id )
    INNER JOIN pool_wp_teams t2 ON ( t2.id = m.away_team_id )
    WHERE u.user_login = 'AntoineH'

    If you want to see results for all users, you can leave out the last line of the query.

    2. Unfortunately WordPress doesn’t support multiple roles for one user. Maybe there is a plugin that overcomes this lack in the security model. If there is no plugin, then the only option is to give the person two logins.

    3. No,there is no such shortcode. But it should be fairly easy to write one, so I’ll see if I can add it to the next version (and post the code here).

    Thread Starter danhinio

    (@danhinio)

    Hi,

    Thanks so much for the quick response. Sorry for the question but how do I implement the query code from point 1?

    Thanks again

    Plugin Author AntoineH

    (@antoineh)

    You don’t implement the SQL query, you run it in a tool like phpMyAdmin.

    If you want to run it, you need some code that uses the WordPress database class (wpdb) and output the results.
    I’ve written something like it before so I went ahead and implemented the above SQL in it and changed it a bit. You can download the file here and if you add it to your wp-content/plugins folder and activate the plugin you will get an extra menu option for the Football Pool.

    Thread Starter danhinio

    (@danhinio)

    Antoine,

    Seriously impressed. Thank you so much. One of the best supports for a plugin on WordPress.

    Thanks again, it’s just what I need.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Checking predictions’ is closed to new replies.