The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Utility to update pmtotal and pmunread in user table Details »» | |||||||||||||||||||||||||||
Utility to update pmtotal and pmunread in user table
Developer Last Online: Aug 2020
About this Script:
This script will update the PM Count and Undead PM counts in the user table. Why Did I write this: Well, I wrote it as I could not find a built in function in vBulletin to rebuild these values! I had my PM table become corrupted during an install process and while it was easy to restore the PM tables (there are three of them) I had issues as the USER table did not accurately represent the values in the PM table. I tried searching for a solution and I learned that others have had this issue with board imports, pruning old PMs, or as in my case when it was necessary to recover data from a backup. What does the script do: This script updates the USER table to show the correct count of TOTAL PMs and UNREAD PMs for all users. Why is this so "unrefined"? This is intended as a utility. I included a permissions check to verify the person running the script is an Admin. I would suggest that this is not a script that you would want sitting on your server all the time but instead is being shared as a tool for cases where someone needs it! Credits and Revisions 9-Feb-2007 Version 2 thincom2000 did a major rewrite of the script to go from three SQL queries down to one. The script is much faster now and he is listed as Co-author! THANKS! 9-Feb-2007 Version 3 Fixed this bug: https://vborg.vbsupport.ru/showpost....4&postcount=11 Supporters / CoAuthors Show Your Support
|
Comments |
#12
|
||||
|
||||
Got it... $lastuser is being overwritten with a boolean when it should have the lastuser's id.
Line 31 should have this $lastuser = $pms['userid']; |
#13
|
|||
|
|||
Quote:
You are correct... Zip is updated and I checked it on a live board this time with real PM users My Dev board has me, myself , and I and while there are three accounts we don't tend to PM each other much |
#14
|
|||
|
|||
Haha, sorry I threw that code together in a bit of a rush (just copy and pasted most of your old code which is how it still had query_first and not query_read), and forgot to add the other line setting $lastuser to $pms['userid']. Glad you all figured it out.
|
#15
|
||||
|
||||
What's the whole problem we are talking about? What PM counter do u mean exactly, and how could it have a negative effect on your forums?
|
#16
|
|||
|
|||
It is the PM count that shows in the header or in your profile... It could say you have 10 PMs when you have 3000 (or the opposite) and your PM limit will be based on that count! You can also have issues with the system sayingyou ALWAYS have 2-unread PMs... but they will NEVER CLEAR as you need to reed those unread PMs before the count will reset. The problem is, you don't have any unread PMs...
If you ever have the problem, you will know it as your members will complain! |
#17
|
||||
|
||||
I have never experienced problems with that to be honest..
|
#18
|
||||
|
||||
I could have used this awhile back, some users had something like "62781287 unread messages." Only way to fix this (wrong) number was to empty their PM mailbox.
Thanks for sharing, Quarterbore! |
#19
|
||||
|
||||
Perhaps to quell concerns, this utility would be better served as a menu item available in the AdminCP, available under "Maintenance."
|
#20
|
|||
|
|||
True... I actually have been trying to get this considered for an addition in vBulletin itself (they can recode as they would like) and I have posted this over at vBulletin.com as a suggestion for inclusion. We will see...
|
#21
|
||||
|
||||
Did u make a bugreport of it?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|