1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Display Winnings in Message User Info

Discussion in 'Sportsbook Support' started by nick-harper, Jun 21, 2018.

  1. nick-harper

    nick-harper New Member Pickem Sportsbook

    I have tried to edit this and take some of the variables from the statistics template but I assume they aren't set globally so won't show?

    I tried to put the following:

    Code:
    {$xenOptions.sbCurrencySymbol}{xen:number $user.total_won, 2}
    It just shows as 0.00 though sadly.
     
  2. Bob

    Bob Developer Staff Member

    Ya, that won't work. You can display Sportsbook cash, as that is a static field in the xf_user table, which is part of the array of data that is always available with the user record.

    total_won is not a field in the xf_user table, its is a php generated stat, that is fetched and prepared at run time by specific actions within specific sportsbook controllers.
     
  3. nick-harper

    nick-harper New Member Pickem Sportsbook

    Thanks, I thought that might be the case.

    I guess to calculate it, it is going to need a query run to add it up for every user displayed?
     
  4. Bob

    Bob Developer Staff Member

    In a nut shell, yes.

    In theory, you could also do something like extend the xf_user table to add a new field that would store that data, then it could be accessed directly like you are attempting in your first post. You'd have to develop a CRON with a set of functions that would fetch and prepare the data, initially populate the field and then update that data every so often (like once a day or once ever 6 hours or so). If you have a large site, it would be an intensive process, so you wouldn't be storing REAL TIME data, it would have to be limited to processing once a day.
     
  5. nick-harper

    nick-harper New Member Pickem Sportsbook

    I might look to just create a leaderboard instead like is used on the Statistics page to show it there!
     
    TerryP and Bob like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.