• I dont understand.
    I paste code to my funccions.php in my theme but code is not work.
    I need Only show ‘open’ matches on the form

    2 problem,
    When i use 1 joker, in the next preddictions i cant use it again.

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

    (@antoineh)

    What code did you paste? And was it placed in the right functions.php file?

    I personally prefer to use the extension plugins posted in the forum. Easier to maintain and they don’t get overwritten when you update your theme. There is also a plugin for the ‘only open matches’ functionality: https://www.ads-software.com/support/topic/extension-plugins-for-the-football-pool-plugin/#post-8998122
    To use this, just download the file, place it in the plugins folder and activate it.

    About your second problem: a joker can only be used once. But if the match is not yet closed, then you should be able to change the joker to another match. Can you check if there is some kind of script blocking this functionality? Things you can check to determine what the cause of the problem is:

    – use a default theme
    – disable other plugins
    – use the DevTools in Google Chrome to check for javascript errors (console log)

    Thread Starter Kerovsky

    (@kerovsky)

    i add code from your plugin…

    
    <?php
    /**
     * Plugin Name: Football Pool Only Open Matches
     * Description: Extension to only show open matches on the prediction page.
     * Version: 1.1
     * Author: Antoine Hurkmans
     * Author URI: mailto:[email protected]
     * License: MIT
     */
     
    // Save this plugin in the wp-content/plugins folder and activate it //
     
    // set this to true if you want the plugin to also filter the user predictions page
    if ( ! defined( 'ONLY_OPEN_MATCHES_ON_ALL_PAGES' ) ) define( 'ONLY_OPEN_MATCHES_ON_ALL_PAGES', false );
     
    class FootballPoolOnlyOpenMatches {
        public static function init_extension() {
            add_filter( 'footballpool_predictionform_matches_filter', array( __CLASS__, 'filter_matches' ), null, 3 );
        }
         
        public static function filter_matches( $matches, $user_id, $is_user_page ) {
            if ( ONLY_OPEN_MATCHES_ON_ALL_PAGES || ! $is_user_page ) {
                $filtered_matches = array();
                foreach ( $matches as $match ) {
                    if ( $match['match_is_editable'] ) $filtered_matches[] = $match;
                }
                $matches = $filtered_matches;
            }
            return $matches;
        }
    }
     
    add_filter( 'plugins_loaded', array( 'FootballPoolOnlyOpenMatches', 'init_extension' ) );

    When i add file to wp-content/plugins/
    football-pool-only-open-matches.php
    Its not work… Where to paste this file ???

    What should I do to use the joker once in a row?

    • This reply was modified 7 years, 6 months ago by Kerovsky.
    Plugin Author AntoineH

    (@antoineh)

    When i add file to wp-content/plugins/
    football-pool-only-open-matches.php
    Its not work… Where to paste this file ???

    Just add the file with this code in the wp-content/plugins folder. Then go the the Installed Plugins in the WP admin and activate this plugin.

    What should I do to use the joker once in a row?

    Default behavior of the joker is explained in the help file. Unfortunately, there is no option to change this functionality.
    If you want to reset a joker that was already set by a user, then the only option is to open the ‘predictions’ table in the database and edit the ‘has_joker’ value (set it to 0).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PLugins instal’ is closed to new replies.