MyBB Community Forums

Full Version: Prune old PMs + optimize DB v1.0.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Hi Eldenroot
I have a suggestion.
If add a option for set When any of the folder will be deleted?
For Example, i choose Inbox PMs are deleted after 60 days , and Trash PMs are deleted after 10 days, and Sent folder PMs are deleted after 30 days , another like it.
Like this:
Folder Name --> Read ....... Unread
Inbox Folder --> 60 ....... 0 (Not Deleted)
Trash Folder --> 10 ......... 30
Sent Folder --> 20 ........... 0
And 0 is not deleted!
I think this can help anyone for better manage folders Wink
Thanks for work and help Heart
Hi all, v1.0 is out! I recommend to UPDATE to the latest version!

v1.0 changelog:
* fix prunepms task file - now cleans without any issue
* optimize DB tables after cleaning
* better event logging
* code clean up
hi.
task/prunepms.php


  $queryString  = <<<SQL
    UPDATE mybb_users u SET 
        totalpms = (SELECT COUNT(pmid) FROM mybb_privatemessages pm WHERE pm.uid = u.uid),
        unreadpms = (SELECT COUNT(pmid) FROM mybb_privatemessages pm WHERE
            pm.uid = u.uid AND status='0' AND (folder='1' OR folder='2' OR folder='3' OR folder='4'));

error, because table name not mybb_users and mybb_privatemessage.
Did you rename your tables in DB? What are their names?
Hi,
I have question about my suggestion:
http://community.mybb.com/thread-162704-...pid1203679

This is possible or not?
@SAEED.M - yes, it is quite easy. Just add another time interval
https://github.com/Cu8eR/MyBB_Prune-old-...ms.php#L24

and modify this line
https://github.com/Cu8eR/MyBB_Prune-old-...ms.php#L27

folder 1 - inbox
folder 2 - sent items
folder 3 - drafts
folder 4 - trash
(2016-02-22, 08:17 PM)Eldenroot Wrote: [ -> ]@SAEED.M - yes, it is quite easy. Just add another time interval
https://github.com/Cu8eR/MyBB_Prune-old-...ms.php#L24

and modify this line
https://github.com/Cu8eR/MyBB_Prune-old-...ms.php#L27

folder 1 - inbox
folder 2 - sent items
folder 3 - drafts
folder 4 - trash

Thanks a lot, but this is for read PM or unread PM?
modify readtime - or just delete it. You can also copy paste this code and make it only for specific folders
Hello, is it possible to have settings on this plugin about "prune old pms, but only for those usergroups" ?
(2017-01-20, 10:35 PM)Darkrad Wrote: [ -> ]Hello, is it possible to have settings on this plugin about "prune old pms, but only for those usergroups" ?

Hi, I wanted to make this plugin simple so there wont be any extra settings in ACP. There is only a global settings in .php file, it is enough for 99 % of boards. I am sorry Sad
Pages: 1 2 3 4 5