• Resolved fimo66

    (@fimo66)


    Hi,
    i am still a very happy user of this plugin and can see that after an update to
    Version 2.10.0, there is a Multiple joker support (for the entire pool or per match type). …renamed the Joker to ‘multiplier’.

    I have a few questions which i hope you can clarify for me :o)

    1) Multiplier Options, i can enable or disable this feature but if i disable this, it
    still shows the footboll icons (toggle your multiplier)
    Can i hide these icons on my users guess page, its still visable when i disable this feature ?
    And if its disable and i still click on the icon, it says available multiplier already used, and when i want to leave the webpage in chrome it ask if i want to save my changes ? but i didnt make any changes beacause the feature was not activated.
    https://ibb.co/PtykJrV

    2) If i would like to use this new feature then it says “for the entire pool or per match type”
    https://ibb.co/sV0KT19
    How does this works if i have ie 6 round in my pool at the beginning and i set the
    The number of multipliers a user can use to 4 but then later on in the middle of a pool i want to add 10 more rounds to the same pool, how will that effect the users that have already used their 4 score multipliers or only used ie 3 of them and then i add 10 mores rounds + instead of 4 multiplayers guess i change that number to 8 ?
    i dont know if this makes any sense, sry for that…

    3) last question, is there any way a user can see how many multipliers he/she has used or has left of the giving numbers set by the admin ?
    Is there any way other users can see how many multipliers a specific user has used or has left ?

    I think the above could be a fun info in the compatition when ie 3 users are head to head in the end and then one users has spend all his multipliers and the two others still have ie one or two remaining.

    But once again, thank you for all these updates, improvement to a great plugin

    • This topic was modified 3 years, 10 months ago by fimo66.
    • This topic was modified 3 years, 10 months ago by fimo66.
    • This topic was modified 3 years, 10 months ago by fimo66.
Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author AntoineH

    (@antoineh)

    1) Multiplier Options, i can enable or disable this feature but if i disable this, it
    still shows the footboll icons (toggle your multiplier)
    Can i hide these icons on my users guess page, its still visable when i disable this feature ?

    That’s not supposed to happen. If you disable the multiplier option, then the icon should not show. Do you perhaps have an extension enabled that overwrites the prediction table? Or some kind of caching that needs to be cleared first?
    If we can’t figure out what is wrong, you can of course also hide the icons via CSS, but I’d really like to know if this is a bug or not.

    And if its disable and i still click on the icon, it says available multiplier already used, and when i want to leave the webpage in chrome it ask if i want to save my changes ? but i didnt make any changes beacause the feature was not activated.

    I have some code that tries to check if there are any unsaved changes. Could be helpful for people with slow connections that didn’t wait for an AJAX save to complete. But if I hear more complaints that this is causing false warnings, then I can also disable it with an option, or remove it entirely.

    How does this works if i have ie 6 round in my pool at the beginning and i set the
    The number of multipliers a user can use to 4 but then later on in the middle of a pool i want to add 10 more rounds to the same pool, how will that effect the users that have already used their 4 score multipliers or only used ie 3 of them and then i add 10 mores rounds + instead of 4 multiplayers guess i change that number to 8 ?

    The code will simply check how many multipliers a user has used compared to how many there are available. But there is a difference in the setting: per pool or per match type. So, in your example and with the setting “per pool”, the users that have used 4 will get 4 extra and the users that have used 3 will get 5 extra.

    But if you group your matches in match types (the first six rounds in match type 1 and the next 10 rounds in match type 2) and set the setting to “per match type” and the amount to 4, then all users get 4 for the last 10 rounds. Also the ones that only used 3 multipliers in the previous match type.

    3) last question, is there any way a user can see how many multipliers he/she has used or has left of the giving numbers set by the admin ?

    I added a %jokers_used% placeholder to the ranking table template. But that only counts the jokers that were actually activated and calculated in the ranking. It doesn’t take into account the jokers that were set on future matches (that a user can still change or remove). It will not tell you how many you have left (you will need to do that simple math yourself).

    The parameter is already added as a CSS class (e.g. “jokers-used-0” or “jokers-used-2”) to the table row of the ranking table. If you know some CSS you can use this to display something for every user. If you want to do something else with this value, you can also extend the ranking template and include the parameter somewhere else. This post has a basic example on how to do that.

    Thread Starter fimo66

    (@fimo66)

    Hi again,

    Thanks for the support, answers….

    1) i will recheck this again during the week and return with an update :o)

    2) …… Could be helpful for people with slow connections that didn’t wait for an AJAX save to complete. But if I hear more complaints that this is causing false warnings, then I can also disable it with an option, –
    if this will be a problem for some users with slow connections, will it be possible to have the choice to enable / disable this from the admin ? for those who wants that, so you dont have to remove it for all ?
    But again, perhaps its just me who have this issue at the moment, so its better to wait a bit longer to see / hear from other users about this….

    3)……Great – i will try this first and hear from the users in the future…..
    “only counts the jokers that were actually activated and calculated in the ranking”

    once again thank you for all support

    Plugin Author AntoineH

    (@antoineh)

    Update regarding 2: I’ve added this as an option to the plugin for the next release. You can disable the check if you don’t like it.

    Thread Starter fimo66

    (@fimo66)

    …….Update regarding 2: I’ve added this as an option to the plugin for the next release. You can disable the check if you don’t like it.

    GREAT, thanks….

    Im still seing if i can find the reason to item 1 and will report back to you when i find the cause :o)

    Thread Starter fimo66

    (@fimo66)

    Hi again,
    I found the reason WHY the Multiplier Options icon was still visable on my site
    when it was disabled in the admin section, if this can be be any help to other users if they forget what ekstra addon/plugins they have installed in the past :o)

    The reason was this plugin which i didnt uninstall before installing the new footboll pool update 2.10.0

    But now when i uninstalled this add on plugin, the new Multiplier Options ws working as it should, enable,disable (visable,non visable view)..

    ……”Football Pool Golden Game Matches
    Add the ability to mark matches for extra points (and disable the Joker for users). The joker multiplier is used to calculate the extra points. You’ll have to manually reset the has_joker values in the predictions table after you deactivate the plugin (if needed).
    Version 2.1 | Af Antoine Hurkmans”

    Thread Starter fimo66

    (@fimo66)

    Last thing here:

    widget-football-pool-ranking.php

    Is this the file i have to edit to show how many jokers that was activated + used by each users ?

    sry for my lack of knowledge :o)

    I added a %jokers_used% placeholder to the ranking table template. But that only counts the jokers that were actually activated and calculated in the ranking. It doesn’t take into account the jokers that were set on future matches (that a user can still change or remove). It will not tell you how many you have left (you will need to do that simple math yourself).
    
    The parameter is already added as a CSS class (e.g. “jokers-used-0” or “jokers-used-2”) to the table row of the ranking table. If you know some CSS you can use this to display something for every user. If you want to do something else with this value, you can also extend the ranking template and include the parameter somewhere else. This post has a basic example on how to do that.

    ……”`public static function change_template( $all_user_view, $type ) {
    // Both views now return the same template, so the ‘if’ statement is a bit useless. But I left it here
    // for people who do want to learn how to differentiate between the two views.
    if ( $all_user_view ) {
    $ranking_template = ‘<tr class=”%css_class% jokers-used-%jokers_used%”>
    <td class=”user-rank”>%rank%.</td>
    <td class=”user-name”><a href=”%user_link%”>%user_name%</a></td>
    <td class=”user-score ranking score”>%points%</td>
    <td class=”user-league”>%league_image%</td>
    </tr>’;
    } else {
    $ranking_template = ‘<tr class=”%css_class% jokers-used-%jokers_used%”>
    <td class=”user-rank”>%rank%.</td>
    <td class=”user-name”><a href=”%user_link%”>%user_name%</a></td>
    <td class=”user-score ranking score”>%points%</td>
    <td class=”user-league”>%league_image%</td>
    </tr>’;`

    • This reply was modified 3 years, 10 months ago by fimo66.
    Plugin Author AntoineH

    (@antoineh)

    No, try not to change any of the files in the plugin itself because any changes that you do will be overwritten with every plugin upgrade. My advice is to only use plugin files to find any filters that you want to use in an extension, or to copy pieces of code that you want to use as a basis for own extensions.

    If you want to change the template, then simply use this example as a start.

    Thread Starter fimo66

    (@fimo66)

    Hi again,

    Thanks for this but im so stupid, and its above my skills, but i found an old templete from you and tried to “copy,pase,replace what i guess i should do (have no clue)….

    because this one which was easy for me to use :o)
    https://ibb.co/jZztssV
    only shows what i inserted in the admin “Scores are multiplied with this number when the multiplier is set.”

    so for this part
    “I added a %jokers_used% placeholder to the ranking table template. But that only counts the jokers that were actually activated and calculated in the ranking. It doesn’t take into account the jokers that were set on future matches (that a user can still change or remove).

    The parameter is already added as a CSS class (e.g. “jokers-used-0” or “jokers-used-2”) to the table row of the ranking table. If you know some CSS you can use this to display something for every user. If you want to do something else with this value, you can also extend the ranking template and include the parameter somewhere else`

    This is what i came upp with as a non skilled user :o)
    and offcause i couldnt get it to work with the “%jokers_used% or jokers-used-0” or “jokers-used-2”

    so perhaps i should just let this be untill it might come as a shortcut like these
    https://ibb.co/SncLrLj
    in the future :o)

    <?php
    
    // Save this plugin in the wp-content/plugins folder and activate it //
    
    class FootballPoolExtensionJoker {
    	public static function init_extension() {
    		add_filter( 'footballpool_predictionform_template_start', array( __CLASS__, 'add_joker' ), null, 2 );
    	}
    	
    	public static function add_joker( $html, $is_user_page ) {
    		if ( ! $is_user_page ) {
    			$pool = new Football_Pool_Pool();
    			$html = $pool->joker( 'matches' ) . $html;
    		}
    		
    		return $html;
    	}
    }
    
    add_filter( 'plugins_loaded', array( 'FootballPoolExtensionJoker', 'init_extension' ) );
    • This reply was modified 3 years, 10 months ago by fimo66.
    Plugin Author AntoineH

    (@antoineh)

    Okay, I’m a bit lost now 🙂
    When you said

    Is this the file i have to edit to show how many jokers that was activated + used by each users ?

    I was thinking that you wanted to show the amount of used jokers in the ranking table. And therefore I advised to take the ranking template extension as a basis. But in your previous post you are talking about shortcodes. Those two principles do not match. It is either showing the value in the ranking for all users, or using a shortcode that will show the value for one user (or we should think of the shortcode as one that generates a list of users with their used jokers, that’s also possible).

    Anyway, I do not have such a shortcode on my to-do list, so don’t expect to create one in the near future.

    If creating something in PHP yourself is a bit out of your league, then you can also try fiddling around with some CSS as I suggested earlier. See below code as a simple example of what you can do:

    /* jokers-used visualizer */
    tr.jokers-used-0 td.user-name:after {
    	content: " (0 multipliers used)";
    	font-size: 60%;
    }
    tr.jokers-used-1 td.user-name:after {
    	content: " (1 multiplier used)";
    	font-size: 60%;
    }
    tr.jokers-used-2 td.user-name:after {
    	content: " (2 multipliers used)";
    	font-size: 60%;
    }
    /* etc etc etc */

    Instead of adding content, you can of course also add background images and have them repeat for every multiplier used. Etc. Etc. Your own creativity is the limit. Just remember that with CSS you’ll have to define a class rule for every amount of multipliers that can be used.

    Thread Starter fimo66

    (@fimo66)

    Thanks once again for all your support / help 🙂

    Thread Starter fimo66

    (@fimo66)

    Hi again @antoineh,

    Just a quick question from a non skilled user 🙂

    I really appreciate all the help / time you gave me above but i still cant
    in a simple way solve how to show how many jokers a user or users have used sofar,
    so my question is, do you think in the future you will hvae time look into this for me = a simple way of showing that perhaps via a shorcode i can insert on a blank page or besides the ranking names, because my users is asking me how they can view other users total spend jokers compared to theirs, and now i have to manually count every jokers used from each users, again i am not that smart regarding how to do that via ie css or other
    so i hope that you will have time to look at this in the future to help me or others who would like to show that on their page 🙂

    Thanks again for all help, support….

    • This reply was modified 3 years, 7 months ago by fimo66.
    • This reply was modified 3 years, 7 months ago by fimo66.
    • This reply was modified 3 years, 7 months ago by fimo66.
    • This reply was modified 3 years, 7 months ago by fimo66.
    Plugin Author AntoineH

    (@antoineh)

    hi @fimo66,

    If you use a theme that has a Customize option with an Additional CSS field, you can simply copy & paste the CSS code I put above in that field and publish it. This will show the amount of jokers used in the ranking*. If your theme does not have this option, then you can use a plugin that adds the ability to insert custom styling (e.g. Scripts n styles).

    See this screenshot from my dev install.

    The only thing that is left, is to make sure we have CSS rules for every amount of jokers that you allowed in your config. The code example is for max 2 jokers. If you allow more, we need to create some extra lines (copy & paste and change the number).

    * one note: if you have an old ranking extension enabled, then this extension does not include the new placeholder yet that I introduced in a recent version. If so, we can easily solve this if you tell me which extension you use.

    Thread Starter fimo66

    (@fimo66)

    Hi again

    I tried this and inserted via CSS – theme

    https://ibb.co/wLjkc0Q

    but i think im missing something, because there is nothing showing here on my rank page

    or with jokers

    Plugin Author AntoineH

    (@antoineh)

    Do you have a plugin extension enabled?

    Thread Starter fimo66

    (@fimo66)

    …..Do you have a plugin extension enabled?

    Like this ?

    https://www.boiseweb.net/articles/how-to-install-plugins-and-extensions-with-wordpress/

    yes i have or do you mean a specific plugin ?

    regarding the CSS from my above post is from the build in theme CSS “generate press theme”

Viewing 15 replies - 1 through 15 (of 19 total)

The topic ‘multipliers’ is closed to new replies.