• Resolved flaviopitta

    (@flaviopitta)


    Hi, is it possible that the user page only shows the matches in which he actually bet?
    Currently appear all finished games

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

    (@antoineh)

    At the moment this is not supported. I will include this as an option in the next update (will be released in January if all goes well).

    If you can’t wait for this, you can add it yourself by hooking into the footballpool_user_page_matches filter and remove the matches that don’t have a prediction for that user. This is fairly easy by just looping through the array and removing some elements. E.g. with the array_filter function from PHP:

    
    $match_rows = array_filter( $match_rows, function( $m ) {
    	return $m['home_score'] !== NULL || $m['away_score'] !== NULL;
    } );
    

    And then returning this array back in the hook.

    Thread Starter flaviopitta

    (@flaviopitta)

    Ok thank you so much, your plugins are fantastic

    Thread Starter flaviopitta

    (@flaviopitta)

    Can you please help me to add this code?

    $match_rows = array_filter( $match_rows, function( $m ) {
    return $m[‘home_score’] !== NULL || $m[‘away_score’] !== NULL;
    } );

    I have tried everything but nothing works, I’m afraid I don’t know where to add that.
    Thank you so much.

    • This reply was modified 7 years, 11 months ago by flaviopitta.
    Plugin Author AntoineH

    (@antoineh)

    The code must be placed in a separate plugin or a file that is loaded in your website (e.g. functions.php) and attached to the before-mentioned hook. There are examples in the first post of this support forum and/or the help page in the admin. But still, this requires some PHP knowledge and understanding of how hooks work in WordPress.

    I already checked in the code changes I did for this, so you can also give the dev version of the plugin a try. Just copy the files from the zip and replace the current plugin files. No guarantee though that this version is bug free ?? The functionality can be activated in the plugin options screen.

    Thread Starter flaviopitta

    (@flaviopitta)

    I did several tests and I did not find any bug, thanks for the excellent work,
    Deserve to win that coffee ??

    Do you plan to put some kind of search in the next updates?

    Plugin Author AntoineH

    (@antoineh)

    Good to hear I didn’t mess things up ??

    What kind of search do you want?

    Thread Starter flaviopitta

    (@flaviopitta)

    Need to do a simple search for subscribers
    Just add a search box on the top of the table
    To act like a filter

    Plugin Author AntoineH

    (@antoineh)

    On which page?

    Hi folks, I′m folowing this topic and will be pretty good if we can add this type of search form on the Ranking page, for the non logged in users I mean, anyone even if is not a member search for the users on the ranking page.
    Is that possible?
    Thank you

    Plugin Author AntoineH

    (@antoineh)

    See this post for a basic example of a user search.

    • This reply was modified 7 years, 10 months ago by AntoineH.
    Thread Starter flaviopitta

    (@flaviopitta)

    Omg Antoine that’s what I wanted, it was perfect

    You are the boss
    thank you so much!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘User page only shows the matches in which he actually bet?’ is closed to new replies.