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

Alert unread count?


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?


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!