David Baxter PhD
Late Founder
I've just released this as version 1.0 and instaleld it here at Psychlinks.
This add-on prunes old private messages based on age, and cleans up message receipts.
The add-on was adapted for vBulletin 3.6x from amykhar's Mass Delete Old Private Messages for vBulletin 2.2x (see http://www.vbulletin.org/forum/showthread.php?t=27421).
Thanks to Jacqueline at the http://www.vbulletin.org forum, and Sarah and Jorrit787 at the http://www.theadminzone.com forum for assistance with the MySQL queries.
This is designed to run as a cron job.
Unzip prunepms.php from the attached file and upload to your ./includes/cron/ folder. Then set up a new scheduled task as Prune PMs with your preferences as to frequency.
The attached prunepms.php file deletes PMs after 60 days:
It also deletes ALL PM receipts separately (this is because trying to delete receipts linked to the age-based PMs resulted in PMs without receipts being ignored for deletion):
Feel free to personalize these settings for your own requirements.
I'll support this add-on to the extent that I can but be aware I am not expert at either PHP or MySQL.
Additionally, I haven't figured out how to make this a vBulletin product for upload. Anyone who can assist with that will receive full credit here and at vbulletin.org.
This add-on prunes old private messages based on age, and cleans up message receipts.
The add-on was adapted for vBulletin 3.6x from amykhar's Mass Delete Old Private Messages for vBulletin 2.2x (see http://www.vbulletin.org/forum/showthread.php?t=27421).
Thanks to Jacqueline at the http://www.vbulletin.org forum, and Sarah and Jorrit787 at the http://www.theadminzone.com forum for assistance with the MySQL queries.
This is designed to run as a cron job.
Unzip prunepms.php from the attached file and upload to your ./includes/cron/ folder. Then set up a new scheduled task as Prune PMs with your preferences as to frequency.
The attached prunepms.php file deletes PMs after 60 days:
PHP:
$time = time() - (60 * 24 * 60 * 60);
print ("Pruning old private messages... <br/>");
$query = "DELETE " . TABLE_PREFIX . "pmtext . * , " . TABLE_PREFIX . "pm . * FROM " . TABLE_PREFIX . "pmtext, " . TABLE_PREFIX . "pm WHERE " . TABLE_PREFIX . "pm.pmtextid = " . TABLE_PREFIX . "pmtext.pmtextid AND " . TABLE_PREFIX . "pmtext.dateline < $time";
mysql_query($query);
print("Records deleted: ");
print (mysql_affected_rows());
print ("<br/>");
It also deletes ALL PM receipts separately (this is because trying to delete receipts linked to the age-based PMs resulted in PMs without receipts being ignored for deletion):
PHP:
print ("Pruning private message receipts... <br/>");
$query = "DELETE " . TABLE_PREFIX . "pmreceipt . * FROM " . TABLE_PREFIX . "pmreceipt WHERE " . TABLE_PREFIX . "pmreceipt.pmid > 0";
mysql_query($query);
print("Records deleted: ");
print (mysql_affected_rows());
print ("<br/>");
Feel free to personalize these settings for your own requirements.
I'll support this add-on to the extent that I can but be aware I am not expert at either PHP or MySQL.
Additionally, I haven't figured out how to make this a vBulletin product for upload. Anyone who can assist with that will receive full credit here and at vbulletin.org.