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.

How to remove Sportsbook

Discussion in 'Sportsbook Support' started by ineedhelp, Feb 14, 2013.

  1. ineedhelp

    ineedhelp New Member Sportsbook

    …from the navbar?

    Thanks.
     
  2. Bob

    Bob Developer Staff Member

    You can hide a tab using CSS.

    Admin CP -> Appearance -> Templates -> EXTRA.css

    Code:
    .navTabs .navTab.sportsbook
    {
    display: none;
    }
    
    You must specify the tabid which can be seen in the HTML source.
     
  3. ineedhelp

    ineedhelp New Member Sportsbook

    Thanks.. I just copy and pasted the code and it's done the job… I didn't have to specify any tabid.
     
  4. Bob

    Bob Developer Staff Member

    sportsbook (in red) IS the tabid ;) Just saying that you can look at the source and use the tab id's of ANY tab to hide a specific tab :)
     
  5. ineedhelp

    ineedhelp New Member Sportsbook

    Oh thanks, very useful!
     
  6. ineedhelp

    ineedhelp New Member Sportsbook

    I just noticed, this code breaks the navbar once, you go into any of the Sportsbook pages.

    Any ideas?
     
  7. Bob

    Bob Developer Staff Member

    disable the listener then. You need to be in DEBUG mode to do this tho as you need to access the Development Tab

    Then click on code event listeners
    scroll down to Sportsbook
    then Uncheck navigation_tabs to disable it.

    Be sure you are unchecking the one for sportsbook and not another addon (each addon that has a navigation tab will have a navigation_tabs listener
     
    ineedhelp likes this.
  8. ineedhelp

    ineedhelp New Member Sportsbook

    Suggestion: In your next update, can you add an option to remove Sportsbook from the navbar in ACP Options?

    Because, if the navbar has too many items, it doesn't display well especially on mobile devices, username, aterts and logout options get messed up.
     
  9. ineedhelp

    ineedhelp New Member Sportsbook

    Unable to access Sportsbook submenu after removing Sporksbook from navbar via Debug mode.

    Is there anyway, I can display just the submenu within sportsbook pages?

    Or if I create a new Navbar menu called Extras can I include Sportsbook in there so when clicked it'll display the submenus correctly?

    The "Extras" tab will also hopefully include other add ons - so that the navbar isn't overloaded with links.
     
  10. Bob

    Bob Developer Staff Member

    A Submenu belongs to a Tab. If you disable a Tab, you also are disabling that tabs sub menu (if it has one). That is just how XenForo works. There is no "work around" for that.

    Trying to remember now who did custom sub menus. Think it was 8thos. You might want to drop him an inbox asking him how he did it.

    you can always copy the link syntax from the xi_sportsbook_tab_links template for use in the extras tab. That is what other people have done with other addons.
     
    ineedhelp likes this.
  11. ineedhelp

    ineedhelp New Member Sportsbook

    The Recent Events side block always displays the same events, regardless of new events being added. Any reason for this?
     
  12. Bob

    Bob Developer Staff Member

    Are these new events OPEN? If they are "Pending", only YOU will see them in your Bookie CP. Only OPEN events will display. Events that are Pending, Closed, Awaiting Settlement, Settled or Abandon won't be displayed.

    Mine works just fine. I had people that created events just a few hours ago and those are listed at the top of the list.

    I'd have to see your site to see both the Status of these events and the DATES that you have for them as the OPEN data plays a key part in the sort order.
     
  13. ineedhelp

    ineedhelp New Member Sportsbook

    All events are set to Open, I've just created a test event right now. It's displaying in Recent Events block but it's not at the top. It should be above the Pak vs SA event, as it was created last Friday.

    Screen Shot 2013-02-18 at 13.08.21.png
     
  14. Bob

    Bob Developer Staff Member

    They are not ordered by CREATE date, they are ordered by OPEN date (for a very specific functionality reason). If you want them sorted by CREATE date, then you can modify the method. This will effect everything that uses the method.

    The reason for ordering by OPEN date is so that you can create items now and have them OPEN in the future. That way those Future Events will display on the recent events list as "new" (top of the list) instead of way down on the list because of a create date 2 months ago.

    I am willing to bet that you have a FUTURE date set for your pakistan event and manually set the event to OPEN instead of having it set to CLOSED status and having CRON open it on the Future OPEN date (which is how the functionality works). Edit your Pakistan event and either CLOSE it to have CRON auto open it on the OPEN Date or change the OPEN date to friday (or the date that it opened)

    If you want to modify, do the below.

    /library/NFLJ/Sportsbook/Model/Event.php

    replace the getRecentEvents method with this one (or modify it to however you want).

    PHP:
        public function getRecentEvents($numEvents 0)
        {   
            return 
    $this->_getDb()->fetchAll('
                SELECT event.*,
                    cat.*,
                    status.*,
                    user.username, user.avatar_date, user.avatar_width, user.avatar_height, user.gravatar
                FROM xf_nflj_sportsbook_event AS event
                    LEFT JOIN xf_user AS user
                        ON (user.user_id = event.user_id)           
                    LEFT JOIN xf_nflj_sportsbook_category AS cat
                        ON (cat.category_id = event.category_id)
                    LEFT JOIN xf_nflj_sportsbook_status AS status
                        ON (status.status_id = event.status_id)                   
                WHERE event.status_id = 2
                ORDER BY  event.date_create DESC, event.date_close DESC, event.event_id ASC
                LIMIT ?
            '
    $numEvents);
        }
     
    ineedhelp likes this.
  15. ineedhelp

    ineedhelp New Member Sportsbook

    Yes, all Events are manually set Open and the Pakistan match isn't till 1st March. So if I set the status to Pending, will CRON auto open it according to the Event Open date?

    And if it's set to Closed, nothing will happen, because it's closed?
     
  16. Bob

    Bob Developer Staff Member

    no, not Pending, set it to CLOSED. The way the CRON works is it checks all CLOSED events, then looks at the OPEN dates and automatically changes the status from CLOSED to OPEN once it hits that date.

    Pending = Hidden from everyone and can only be accessed by the Owner of the event via the Bookie CP
    Closed = Can be viewed public, but no wagers can be placed. People can post comments as its just closed for placing wagers.
    Open = Can be viewed public and wagers can be placed

    To create events that will auto open, do the following.

    Create the Event (status is pending)
    Create some outcomes
    Set the OPEN Date to the date that you want the event to open
    Set the Event to CLOSED and hit save.

    The event will display in the Events Pages as a "CLOSED" event. People can post comments to closed events.
     
    ineedhelp likes this.
  17. Bob

    Bob Developer Staff Member

    Hope that made sense? lol I sometimes have hard time explaining :)
     
  18. ineedhelp

    ineedhelp New Member Sportsbook

    Lol so far it's made sense, I'll make some test events following the instructions, thanks. :)
     
  19. Bob

    Bob Developer Staff Member

    Just so you know, default CRON is set to check ever 5 minutes. You can bump this up if needed. 5 minutes works fairly well on a high traffic site.

    Just edit the CRON: Sportsbook: Change Event Status from Closed to Open and modify the Run at minutes values.
     
  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.