• 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

nick-harper

New Member
Pick'em
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.
 
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.
 
I guess to calculate it, it is going to need a query run to add it up for every user displayed?
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.
 
Back
Top