XF 1.5 Alerts Unread mismatch with data from xf_user_alert

LaxmiSathy

Member
Hello,

Am looking for the below data -
count of alerts unread by a user and the content_type for each of the alerts for the particular user.

For the count of the unread alerts for a particular user I got it from the table - xf_user - column : alerts_unread
But when I looked at the xf_user_alert table for content_type of these alerts by matching the "alerted_user_id" the number is not matched.

i.e say for user X in xf_user table , the record says alerts_unread is 615. But in the table xf_user_alert for this particular alerted_user_id, there are only 4 records. Why this mismatch? How to get the break up of the actual 615 unread alerts. Please clarify.
 
This is expected if the alerts are old. We bulk prune unread alerts after a length of time, but the counter isn't updated. It will be zeroed out next time they view the alerts.
 
Top Bottom