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 Code:
<?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...