Log in

View Full Version : Move thread x days after FIRST post made


cd1986
11-13-2005, 02:48 PM
I have a downline builder section in my forum, and would like to automate the process of threads being moved from there to the "trash can" forum after 7 days. Is this possible? I know that you can move a thread x days after the last post was made, but i don't want to do that - id like it to be moved 7 days after the first post was made, irrespective of how many replies there have been since.

<?php
error_reporting(E_ALL & ~E_NOTICE);
if ($DB_site == NULL)
{
exit;
}
global $DB_site;

$movedate = strtotime("now -7 days");
$fromforuma="46";
$toforuma="47";

$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET forumid = $toforuma
WHERE lastpost <= $movedate
AND forumid = $fromforuma
");

log_cron_action('Auto Move Threads', $nextitem);
?>

That's the code used in a move 7 days after last post was made cron (taken from a mod from trafix), but can i modify this easily to use the firstpost as a starting point? I assume you must have to change "lastpost" to do this, but the closest i can find is "firstpostid" which i don't think is correct...

Marco van Herwaarden
11-13-2005, 07:02 PM
WHERE dateline <= $movedate
You will have to update your script for vB3.5 also.

cd1986
11-13-2005, 07:23 PM
WHERE dateline <= $movedate
You will have to update your script for vB3.5 also.

Thanks, i will do that now. :)

Sculli
03-11-2006, 04:18 PM
Is there anyone who could kindly provide the updated version for 3.5 as well as point out a way to exclude stickies from being moved? Thank you so much in advance.

Sculli
03-18-2006, 03:14 AM
Somebody saaaave me ...
:)

Sculli
04-05-2006, 06:38 AM
Anyone? Please.

Sculli
04-30-2006, 06:57 PM
bump :(