PDA

View Full Version : Mass Delete Old Private messages


djbaxter
02-24-2007, 02:08 PM
First, my apologies in advance if I'm posting this in the wrong place.

I'd like to adapt Amy's Mass Delete Old Private Messages (https://vborg.vbsupport.ru/showthread.php?t=27421) script for vB 2.x to work with version 3.60.

The existing version shows:

<?php

require ("global.php");
$time = time() - (60 * 24 * 60 * 60);

$a = $DB_site->query("DELETE FROM privatemessage WHERE dateline < $time");

?>

In 3.64, I see three variables for private messages:


pm
pmreceipt
pmtext


Can I just duplicate the a$ query above to prune each of those variables? That is:

<?php

require ("global.php");
$time = time() - (60 * 24 * 60 * 60);

$a = $DB_site->query("DELETE FROM pm WHERE dateline < $time");
$a = $DB_site->query("DELETE FROM pmreceipt WHERE dateline < $time");
$a = $DB_site->query("DELETE FROM pmtext WHERE dateline < $time");

?>

Zia
02-24-2007, 03:05 PM
gez yet not finished..

a wrong place too

djbaxter
02-24-2007, 03:10 PM
I'm aware of that - see above. Moderators, please move this to the apropriate forum.

a1whs.com
02-27-2007, 03:19 AM
Hi,
I am confused a bit , does vb new vesion not come with the feature of mass delete where you check on box and all messages get checked and you delete them all ? Or are you trying to build cron to delete old messages?

djbaxter
02-27-2007, 01:01 PM
Or are you trying to build cron to delete old messages?

Yes. I want to delete/prune all messages older than a certain date.

Discussion continuing at https://vborg.vbsupport.ru/showthread.php?p=1191881#post1191881