XF 1.2 100 post missed

AndreaMarucci

Well-known member
One of my members had a little over 5000 messages and I know for sure since he posted a messing stating so and I've seen the counter.

Now he has written me asking why I've reduced the number of his post but It's not my fault. I've checked and now he has 4910 messages.

What could have happened considering the nor me nor my user have deleted any message?
 
Can you check the admin and moderator logs to see if any member of the stuff deleted/pruned posts/threads?

What were the latest changes that you did to your forum prior to this happening?
 
Nothing in the moderator log and the last thing I've done is to install an addon that show the birthdays on the calendar from AndyB but I don't think this one is related to the messages missed...
 
Have you mass moved any threads recently? The only time I've had this happen is when I moved people's threads/posts into a forum where posts do not count - XenForo removes the number of posts from the user's total count.
 
In that case we have a mystery in out hands as the posts should not vanish like that, out of nowhere.

P.s. Maybe one of the staff lowered that user 's post count from his profile in the Acp and his/her posts were not really deleted?

You can also try to run this query at the SQL Box of your db 's phpmyadmin.

Code:
SELECT u.username as Username,
       COUNT(*) AS messagecount
       FROM xf_post p
       LEFT JOIN xf_user u ON (p.user_id=u.user_id)
       WHERE u.user_id = x
       ORDER BY messagecount

Replace x with the id of that user whose post count has been deleted.

What this query will do is it will return the user 's post count based on all the posts that he/she has done at your forum. And if the number returned does not match the current post count then someone has messed with the post count from their profile. If it matches then his/her posts have been really deleted. Hope it helps.
 
Last edited:
I'm the only one authorized to access the admin.php so I exclude that someone can mess up with the number of messages...

Let me try with your query and I'll let you know...
 
You can also try to run this query at the SQL Box of your db 's phpmyadmin.

Code:
SELECT u.username as Username,
       COUNT(*) AS messagecount
       FROM xf_post p
       LEFT JOIN xf_user u ON (p.user_id=u.user_id)
       WHERE u.user_id = x
       ORDER BY messagecount

Replace x with the id of that user whose post count has been deleted.

Ok tried this and the result is 5.081 but on the forum the message count is 4.917 so what's happened?
 
Ok tried this and the result is 5.081 but on the forum the message count is 4.917 so what's happened?

That means that that user 's posts have not been deleted. You can set his/her post count according to the number returned in the query to bring his/her post count en par with this/her posts made in the forum.

Regarding as to why that happened the only thing that I can think of is that somehow his/her post count got messed up in the profile field. Or someone did that from the phpmyadmin as well.
 
No one but me can access the admin. I've checked my messages count. 14.393 is displayed in the forum and 14.595 using the query so I can assume that also other counts are wrong.

What can I do to fix this? Which number is correct? The one using phpmyadmin or the one displayed in the forum? but the questionis, where do the system takes the number displayed if not from the message count ???
 
In that case we have a mystery in out hands as the posts should not vanish like that, out of nowhere.

P.s. Maybe one of the staff lowered that user 's post count from his profile in the Acp and his/her posts were not really deleted?

You can also try to run this query at the SQL Box of your db 's phpmyadmin.

Code:
SELECT u.username as Username,
       COUNT(*) AS messagecount
       FROM xf_post p
       LEFT JOIN xf_user u ON (p.user_id=u.user_id)
       WHERE u.user_id = x
       ORDER BY messagecount

Replace x with the id of that user whose post count has been deleted.

What this query will do is it will return the user 's post count based on all the posts that he/she has done at your forum. And if the number returned does not match the current post count then someone has messed with the post count from their profile. If it matches then his/her posts have been really deleted. Hope it helps.
Wouldn't this query include soft deleted posts? If so then the result clearly wouldn't match the the user post count and it would then be incorrect to set the user's post count to this value.
 
Well that query doesn't account for posts that were deleted, posts that are in deleted threads, posts in forums where they don't count (I know that doesn't apply to you), or (off chance) posts in threads that are "orphaned" (deleted forum).
 
Wouldn't this query include soft deleted posts? If so then the result clearly wouldn't match the the user post count and it would then be incorrect to set the user's post count to this value.

Yes, it does include the soft deleted posts but the OP said that he did not delete or touched in any other way the posts of that user. Hence why I did not exclude them from the query.
 
Top Bottom