PDA

View Full Version : Please Help! Unread counter jumps always back to 1


Wolver2
04-03-2014, 12:50 PM
A user spammed by making several Private messages and added a link to a virus to it!

So in panic i quickly deleted all the data inside mysql manually..

Now the issue: I have is it shows 1 unread message for those who recieved the PM but did not open..


I know there is some kind of PM read counter... so I tried to set in the specific userid table unread to 0

But after he recieves a new pm it goes back to "unread 1" even if read..

Are there more fields to edit?

--------------- Added 1396536019 at 1396536019 ---------------

Seems like there are several Tables for Private Messages...

User, pm, pmtext, pmreceipt,

Seven Skins
04-03-2014, 05:51 PM
If you are deleteing all PM's you may run the queries below.

TRUNCATE `pm`;
TRUNCATE `pmtext`;
TRUNCATE `pmreceipt`;
UPDATE `user` SET `pmtotal` = '0';
UPDATE `user` SET `pmunread` = '0';



Backup database etc... as running wrong queries may cause serious issues.



.

Wolver2
04-04-2014, 07:06 AM
Thanks for the reply Seven Skins, I dont want to delete all PMs

I just want that it wont show wrong unread messages...

As it shows for several 1 unread message even if there is no unread msg

Lynne
04-04-2014, 05:22 PM
Well, he listed all the tables you would have had to modify if you chose to delete a PM via the database instead of via the built-in method in vbulletin. The user table is what keeps track of the total number of unread PMs.

Wolver2
04-05-2014, 01:10 PM
Thanks Lynne, I diddnt know that there was a built in way to delete PMs via admin panel. I guess i reacted out of panic..

What I did:

1. I deleted the PMs in the table pmtext (rows)
2. In table user I changed the fields of "pmunread" from 1 to 0 for that specific user and "pmtotal" from 10 to (minus 1) = 9

It works at first, but once they receive a new PM and user reads it vbulletin brings back the old issue "showing 1 unread message" (cause of the PM i deleted inside mysql manually)

Is there something i need to delete as well? or is it some cache which always brings the issue back?

ozzy47
04-05-2014, 02:22 PM
OK lets try this.
1) Make a backup of your site. ( this is not tested on a global scale, only on a test site )
2) Upload the attached file to your admincp folder.
3) Then enter this URL in your browser:

http://www.YOURSITE.com/admincp/pm_counter_fix.php

Make sure you replace, http://www.YOURSITE.com with the URL to your site, and admincp with your admincp folder if you have renamed it.

And then let me know if that works.

Wolver2
04-09-2014, 08:54 AM
thanks ozzy47

May I ask a manual way of the script u made? As I am very scared that I mess things up with the test script :) wished it was globally tested hehe

cellarius
04-09-2014, 12:02 PM
The chance of you messing things up when entering complex database queries yourself as opposed to runningt that script is higher, I would say. And of course, either way, you absolutely need to have a database backup before doing anything!

Wolver2
04-14-2014, 03:59 PM
I think diddnt work completely @ozzy47

USERID X20Xwas updated!
USERID X00X was updated!

There are around 30 but only showing is 2

ozzy47
04-15-2014, 12:55 AM
So there is users still users reporting the issue?

Wolver2
04-16-2014, 01:44 PM
yes yes only 2 got fixed.. @ozzy47

there are 30 more with the issues (reported)

Wolver2
04-18-2014, 12:54 AM
Have no idea what else I can do to fix this issue :)

Lynne
04-18-2014, 01:45 AM
Go to your database backup and delete them correctly?

Or, get the list of userids that need to be fixed and query the database for the correct number of pms and insert them into the database manually?

ForceHSS
04-18-2014, 02:24 AM
Why not delete pms from admincp/users/Private Message Statistics

Wolver2
04-25-2014, 12:30 PM
@Lynne Do you mean this:

I already tried changing the correct numbers of PM's

In table user I changed the fields of "pmunread" from 1 to 0 for that specific user and "pmtotal" from 10 to (minus 1) = 9

But then Vbulletin changes it back to pmunread to 1 after user receives a new pm and reads it. It always comes back.. I dont know why lol.. is there some cache..?

@ForceHSS

I was in panic and diddnt know about deleting via that way.. I usually research first but was sadly in panic.. and diddnt want anyone to open the PMs with virused links

Lynne
04-25-2014, 03:56 PM
Are you actually checking the pm tables to verify the numbers you are changing the user fields to? That is what vbulletin looks at.

Wolver2
05-02-2014, 02:07 AM
I am trying to understand the PM Table... @Lynne

So I have to find out the PM ID of the PM's he sent.. after that I just delete the entire row of it?

Lynne
05-02-2014, 02:14 AM
As posted in a previous post, there are several tables that are effected everytime a user makes a PM. You need to go through them all if you want to change anything.