vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=301961

Is there an auto - purge for PM's?
by smirkley
07 Sep 2013 06:59

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?

DF031 07 Sep 2013 07:01

Why would you delete those PMs ?

smirkley 08 Sep 2013 06:00

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.

DF031 08 Sep 2013 07:05

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 :-)

ozzy47 08 Sep 2013 13:19

There is this mod, http://www.vbulletin.org/forum/showthread.php?t=179879 which has been reported to work on vB4 if you use the xml in this post, http://www.vbulletin.org/forum/showp...0&postcount=45 , after uploading the files from the OP's zip.

smirkley 13 Sep 2013 17:45

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Would I change the code in prunepms.php to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or would this work instead:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Obviously I have to be careful, but I am unsure of the syntax to make it work properly.
(I do know I will have to change the acp phrases)

kh99 13 Sep 2013 18:00

I think you would want:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Maybe using = works the same as IN, I don't know, but you could just remove the NOT.

smirkley 13 Sep 2013 18:05

I had considered that too, thanks.

But if you select the first option, it runs this snippet:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Which is why I used an = and then the ( 0, -1) in my first suggested example.


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.

snakes1100 13 Sep 2013 19:17

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.

smirkley 13 Sep 2013 19:25

Quote:

Originally Posted by snakes1100 (Post 2445405)
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.

Thats the first I had read of that issue, it wasnt reported on the thread that I read.

In my prelim tests it appeared to have operated properly.

Can I ask did you try this mod and have this problem?

snakes1100 13 Sep 2013 19:27

Yes, i tested for a client, thats why i posted what i did & thats why it was rewrote because of that issue.

smirkley 13 Sep 2013 19:44

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?)

snakes1100 13 Sep 2013 20:10

No, sorry its a private script rewrite that wasnt released here.

kh99 13 Sep 2013 20:17

Quote:

Originally Posted by smirkley (Post 2445393)
Which is why I used an = and then the ( 0, -1) in my first suggested example.


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).

smirkley 13 Sep 2013 20:28

Quote:

Originally Posted by snakes1100 (Post 2445418)
No, sorry its a private script rewrite that wasnt released here.

No biggie. I will keep an eye out whilst I test this. So far I have it working but if something crops up, I am sure I can figure it out.

Quote:

Originally Posted by kh99 (Post 2445421)
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).

Thanks kh99. Since I can only test this on a daily basis (on a test usergroup, without bothering going into the database to backdate test pm's), I am going to test it (since I have already implemented it in test) by combining case 1 contents with case 2 contents into case 3 removing the old case 3 contents, and changing the phrase in the template for acp. This may not be the most effecient use, but I know the cron runs atm with this change without error. I will just have to wait till tomorrow to find out if it indeed operated as desired as I dont have enough time today to force the issue. If it doesnt work, I will try your suggestion and then report back. If it does, then eureka!!

Thanks again.


All times are GMT. The time now is 23:12.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.