• Resolved fransjansen

    (@fransjansen)


    On my pool website I would like the amount of money in the pot to be shown in the lower left corner of the screen. I managed to reate this, but I wonder if there is a possibility to update the amount of money in the pot automatically eg via a shortcode.

    Thanks for your support.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author AntoineH

    (@antoineh)

    There is no automatic way to calculate this. But I like the idea and info is also easy to get from the plugin, so I crafted a new shortcode for it: [fp-money-in-the-pot].

    You’ll have to wait for the next update to use it, or download the updated class here and replace the file in your install:
    /classes/class-football-pool-shortcodes.php

    definition:

    	//[fp-money-in-the-pot]
    	//    Simple shortcode that displays the amount of users in a league (or all users) times a given amount to calculate
    	//    the total sum.
    	//    Can be useful if your players add a stake to the pot and you want to show this number in a post or other part
    	//    of the website.
    	//
    	//    League can be entered in the following formats:
    	//        league for the user   -> league="user"
    	//        league 1              -> league="1"
    	//        leagues 1 to 5        -> league="1-5"
    	//        leagues 1, 3 and 6    -> league="1,3,6"
    	//        leagues 1 to 5 and 10 -> league="1-5,10"
    	//
    	//    If you omit the league parameter, the shortcode will assume all players in the pool are paying participants.
    	//
    	//    league  : optional collection of league ids, or 'user' for the league of the currently logged on user
    	//    amount  : the stake
    	//    format  : optional format for the output (uses sprintf notation: https://php.net/sprintf)

    examples:
    [fp-money-in-the-pot amount="10"]

    [fp-money-in-the-pot league="2" amount="7.5" format="€ %.2f"]

    small disclaimer: not extensively tested.

Viewing 1 replies (of 1 total)
  • The topic ‘money in the pot’ is closed to new replies.