1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Alert unread count?

Discussion in 'XenForo Development Discussions' started by dknife, Mar 4, 2015.

  1. dknife

    dknife Active Member

    Using xfloader for several functions and full integration on my website with Xenforo, I'm able to easy obtain unread messages, since it's a field provided by User model. I want to display unread alerts as well.

    I can pull the data from the Alert model however it pulls ALL the alerts when using either getAlertsForUser or countAlertsForUser. So I looked at the options for fetchRecent but it refers to days for expiry rather than just unread.

    If I pull the entire alerts I can see viewDate or whatever it is as zero or NULL which means it's unread but I was hoping for a solution where I didn't have to pull the entire contents of getAlertsForUser just to count the unread.

    What am I doing wrong here?
     
  2. dknife

    dknife Active Member

    uh duh, it's right in the user model just like conversations, just didn't see it. Was checking the navigation_visitor_tab template where it references it. Should have delved more.

    Nothing to see here!
     

Share This Page