![]() |
Is there an auto - purge for PM's?
Basically it is like this. I have a bunch of members, many who have gone away and no longer visit.
In order to clean up the database, it occured to me that there are many old pm's in the inbox that could be dumped. The definitions would be like this.... In Inbox only, and any pm 30 days or older, ....Auto-delete. I figure if anyone has a pm they want to keep, they should move it into a different folder in ther pm manager. Otherwise it should be dumped after a pre-set amount of time. I have searched but cannot find, is there a mod that does this? |
Why would you delete those PMs ?
|
Because I have almost 10 years of members, many whom have no longer returned,... and many whom have pms unread and otherwise,... that just fill up database space.
I would not mind setting policy that if given, would inform members that the last 30,45,60 days or whatever, if they have pms they want to keep, they should store in another folder in their acp. I have identified several thousand pm's that are either unread or read, that just sit in thier pm inbox. And I want to make more effecient the database in that regard. Look at it this way,... if they havent logged in in 90 days or much more,... it is time to purge the data to make the database take less space. |
I see. Still seems more more to prune than just leave it there. The last 15 years we changed / upgraded the forum software a few times and did not transfer the private messages. That was a good way to clean up things :-)
|
There is this mod, https://vborg.vbsupport.ru/showthread.php?t=179879 which has been reported to work on vB4 if you use the xml in this post, https://vborg.vbsupport.ru/showpost....0&postcount=45 , after uploading the files from the OP's zip.
|
Thank you ozzy. I did do a search but only for v4, which is why I didnt find it. So serious thanks to you.
Question, I have installed and tested, works like a champ. But in the settings it says you can set for Inbox, Sent Items, or all others except Inbox/Sent Items. I wish to change option 3 for BOTH Inbox/Sent Items and no other folders that a user may have custom. The original code in prunepms.php: Code:
case '3': Would I change the code in prunepms.php to: Code:
case '3': Code:
case '3': (I do know I will have to change the acp phrases) |
I think you would want:
Code:
case '3': Maybe using = works the same as IN, I don't know, but you could just remove the NOT. |
I had considered that too, thanks.
But if you select the first option, it runs this snippet: Code:
case '1': This is definetly something I dont really want to screw up and end up deleting all pm's and having to perform a restore of my db lol. |
That hack doesnt work 100% regardless of changing the xml file, your going to end up with bad results on deleted PM records still showing up for users, which they cant get rid of.
Just a warning, always test old hacks that are reported to work on a test site. |
Quote:
In my prelim tests it appeared to have operated properly. Can I ask did you try this mod and have this problem? |
Yes, i tested for a client, thats why i posted what i did & thats why it was rewrote because of that issue.
|
Is the rewrite in the latest download?
Or did you rewrite it for your client? (and if so could you point me to the area to be rewritten?) |
No, sorry its a private script rewrite that wasnt released here.
|
Quote:
I see. It's IN (1, 2, 3) to check for one of a number of values, but = just checks one. I'm quite sure that you just want to remove the word NOT from the existing case 3. (But I don't know anything about the other issue you guys were discussing). |
Quote:
Quote:
Thanks again. |
If you're talking about trying the last code you posted above, that won't work because the only way the condition would be true is if pm.folderid was equal to -1 and to 0. If you wanted to do it that way you'd need an OR (and add parens), like:
Code:
$pms_query_where_clouse .= " AND (pm.folderid = '0' OR pm.folderid = '-1')"; But that's actually equivalent to "AND pm.folderid IN (0, -1)", which is what you get by removing the NOT. |
Check the PM folders after it runs on its own for PM's that got deleted, but left the msg in the box, you will no longer be able to click or delete via the forum.
|
Quote:
I will try your suggestion next and report back the results. Is there a preferred methed? Use the OR or use the AND without the NOT? |
Quote:
|
Quote:
Thank you once again kh99 (I will likely post these changes on the original 3.7 thread) (if it says reusable code, does that mean I can submit this in my name with original credits as a new 4.x mod?) |
Thank you all.
I checked tonight to verify a natural automatic cron prune of stale pm's on a test account in a test usergroup. Previously I verified it works as desired with a manual run of the cron, but I wanted additional verification on auto-cron plus to check for any other anomoloies. I logged in and noticed it hadnt worked. I logged in my acp and looked at my cron que and noticed a few of them had stacked up due to lack of traffic. So I clicked my forum a few times and rechecked the cron. Caught up and done according to logs. Then I logged in my test account, and low and behold, it worked and worked perfectly in both inbox and sent folders, leaving custom folders untouched. Now, as far as this problem suggested,.. Quote:
In fact, it works perfectly. THANK YOU all that helped !! |
Quote:
|
All times are GMT. The time now is 12:37 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|