1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then 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.

Fixed 1.1.0 Small problem with user criteria for trophies

Discussion in 'Sportsbook Resolved Bug Reports' started by SneakyDave, Apr 18, 2013.

  1. SneakyDave

    SneakyDave Member Sportsbook

    Bob, the new trophies for sportsbook, like:
    "User has wagered at least X amount:
    "User has won at least X amount"

    I assume those are TOTAL amounts, or are they PER event?

    Also, maybe a small bug? When I click the "User has won at least X wagers" trophy input box to set the minimum number of wagers, the "User has won at least X amount" checkbox gets selected. Just a duplication error on the js?


    Actually, the "minimum number of wagers" criteria doesn't seem to save like all the other ones because of this glitch.

    The way to temporarily fix it is to choose the "minimal number of wagers" you want to use on the trophy, and then choose "0" for the "User has won at least X amount:" user criteria.

    Then the value will save.
     
  2. Bob

    Bob Developer Staff Member

    Fix it.. was an ID with the same name, so the disabler was enabling both.. quick fix..

    This is an ADMIN Template, so you need to be in debug mode to access the development tab.

    Development >> Admin Styling >> Admin Templates

    Edit Template: nflj_sportsbook_trophy_user_criteria_content

    replace entire template with this template

    HTML:
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_events][rule]" value="sportsbook_events" class="Disabler" id="ucrit_sportsbook_events" {xen:checked $userCriteria.sportsbook_events} />
        {xen:phrase nflj_sportsbook_user_has_created_at_least_x_events}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_events_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_events][data][events]" value="{$userCriteria.sportsbook_events.events}" size="5" min="0" step="1" />
        </div>
    </li>
     
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_wagers][rule]" value="sportsbook_wagers" class="Disabler" id="ucrit_sportsbook_wagers" {xen:checked $userCriteria.sportsbook_wagers} />
        {xen:phrase nflj_sportsbook_user_has_placed_at_least_x_wagers}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_wagers_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_wagers][data][wagers]" value="{$userCriteria.sportsbook_wagers.wagers}" size="5" min="0" step="1" />
        </div>
    </li>
     
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_wins][rule]" value="sportsbook_wins" class="Disabler" id="ucrit_sportsbook_wins" {xen:checked $userCriteria.sportsbook_wins} />
        {xen:phrase nflj_sportsbook_user_has_won_at_least_x_wagers}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_wins_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_wins][data][wins]" value="{$userCriteria.sportsbook_wins.wins}" size="5" min="0" step="1" />
        </div>
    </li>
     
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_losses][rule]" value="sportsbook_losses" class="Disabler" id="ucrit_sportsbook_losses" {xen:checked $userCriteria.sportsbook_losses} />
        {xen:phrase nflj_sportsbook_user_has_lost_at_least_x_wagers}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_losses_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_losses][data][losses]" value="{$userCriteria.sportsbook_losses.losses}" size="5" min="0" step="1" />
        </div>
    </li>
     
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_amount_wagered][rule]" value="sportsbook_amount_wagered" class="Disabler" id="ucrit_sportsbook_amount_wagered" {xen:checked $userCriteria.sportsbook_amount_wagered} />
        {xen:phrase nflj_sportsbook_user_has_wagered_at_least_x_amount}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_amount_wagered_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_amount_wagered][data][amount_wagered]" value="{$userCriteria.sportsbook_amount_wagered.amount_wagered}" size="10" min="0" step="100" />
        </div>
    </li>
     
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_amount_won][rule]" value="sportsbook_amount_won" class="Disabler" id="ucrit_sportsbook_amount_won" {xen:checked $userCriteria.sportsbook_amount_won} />
        {xen:phrase nflj_sportsbook_user_has_won_at_least_x_amount}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_amount_won_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_amount_won][data][amount_won]" value="{$userCriteria.sportsbook_amount_won.amount_won}" size="10" min="0" step="100" />
        </div>
    </li>
     
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_amount_lost][rule]" value="sportsbook_amount_lost" class="Disabler" id="ucrit_sportsbook_amount_lost" {xen:checked $userCriteria.sportsbook_amount_lost} />
        {xen:phrase nflj_sportsbook_user_has_lost_at_least_x_amount}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_amount_lost_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_amount_lost][data][amount_lost]" value="{$userCriteria.sportsbook_amount_lost.amount_lost}" size="10" min="0" step="100" />
        </div>
    </li>
     
    SneakyDave likes this.
  3. Bob

    Bob Developer Staff Member

    Cumulative, its about a users total, so that would include all events.
     
  4. SneakyDave

    SneakyDave Member Sportsbook

    Is that the correct template edit? I made the change you mentioned, and it still has the problem from the first post

    Is this li correct, referencing the id "ucrit_sportsbook_wins", should it be "ucrit_sportsbook_amount_won"?
    Code:
    <li><label>
        <input type="checkbox" name="user_criteria[sportsbook_amount_won][rule]" value="sportsbook_amount_won" class="Disabler" id="ucrit_sportsbook_wins" {xen:checked $userCriteria.sportsbook_amount_won} />
        {xen:phrase nflj_sportsbook_user_has_won_at_least_x_amount}:</label>
        <div class="criteriaQualifier" id="ucrit_sportsbook_amount_won_Disabler">
            <xen:spinbox name="user_criteria[sportsbook_amount_won][data][amount_won]" value="{$userCriteria.sportsbook_amount_won.amount_won}" size="10" min="0" step="100" />
        </div>
    </li>
    
     
    Bob likes this.
  5. Bob

    Bob Developer Staff Member

    yes, it was the right fix for the one you initially reported. You just found a SECOND one :/ grab the updated template in post one!
     
    SneakyDave likes this.
  6. Bob

    Bob Developer Staff Member

    Dave, Reapply the newest change in post #2
     
  7. SneakyDave

    SneakyDave Member Sportsbook

    Yep yep, looks like everything is fine now, the trophy editing works ok, and I don't get any errors running cron. Thanks.
     
    Bob likes this.
  8. Bob

    Bob Developer Staff Member

    wonder why I couldn't get the error to reproduce. Could be the way my development environment is set up.
     
  9. SneakyDave

    SneakyDave Member Sportsbook

    Could it have been because I'm not using the default sportsbook cash/points system? I've been trying to create it on my localhost instance to no available. It only happen on my live install, that uses Brivium credits.

    I'm also on php5.4, and had debug on at the time (to edit the admin template)
     
  10. Bob

    Bob Developer Staff Member

    Can you test something for me since you are using Brivium Credits? Edit a user via the Admin CP and see if it resets their Credits.
     
  11. SneakyDave

    SneakyDave Member Sportsbook

    I created a new user, set their Brivium credits to 5000, then went back in and edited their location, saved it, and their credits were still 5000.

    I did the same with an existing user, and their credits didn't get reset.
     
    Bob likes this.
  12. Bob

    Bob Developer Staff Member

    ok, super! thank you!
     
  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.