okay. I decided to dive into this to be prepared if something this would actually happen to me.

As I said, getting rid of the PM's isn't so much the problem, it's basicly 3 tables to clean up, where only one is really important. Cleanup up the rest basicly "Cleans up" to not leave any unused data.

Code
delete FROM ubbt_PRIVATE_MESSAGE_USERS WHERE TOPIC_ID=37457;
delete FROM ubbt_PRIVATE_MESSAGE_TOPICS WHERE TOPIC_ID =37457;
delete FROM `ubbt_PRIVATE_MESSAGE_POSTS` WHERE TOPIC_ID=37457

query 1=has to be done. This table tells UBB which user is in which topic.
query 2+3 do the cleanup. They remove te actual message, and the actual topic.

These are sample queries to get rid of specific private topic. You can find out the number by simply opening the private topic. The number is in the URL.

Now, the cleanup of the unread PM's. Well, for that I looked around in the ubb code and found something I could use. I cooked it together as a hack, and posted it on ubbdev.

It's an addition to the clear cache button in control panel, so it will also update the cached unread PM count for each user.

This will allow you to do whatever database cleanup you want, and in the end fix all the new PM counters.


[Linked Image from siemons.org]