Log in

View Full Version : Move thread(s) automatically through cron job


gdguide
04-22-2009, 12:36 PM
We're looking for a way to move all threads in Forum A with X replies to Forum B, and this chunk of code should work as a cron job for 3.6.x. However, I'd like to bring this back, as we really need to get this functional for 3.7.x. Would anyone mind helping fix the code so it will accomplish this task in 3.7.x?

<?php

error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
exit;
}

$vbulletin->db->query("UPDATE " . TABLE_PREFIX . "thread SET forumid = 2 WHERE forumid = 17 AND replycount >= 1");
require_once(DIR . '/includes/functions_databuild.php');
build_forum_counters(2);
build_forum_counters(17);

log_cron_action('Threads with replies moved from 17 to 2', $nextitem);

?>

What changes should be made so that it will work in 3.7.x?

KevinL
04-22-2009, 12:46 PM
You should look at this https://vborg.vbsupport.ru/showthread.php?t=139646&highlight=auto+delete

I know it says delete but there is a post in the thread that tells you how to make it move a thread after a reply.

And it works all the way up to 3.8.x ;)

gdguide
04-22-2009, 02:40 PM
You should look at this https://vborg.vbsupport.ru/showthread.php?t=139646&highlight=auto+delete

I know it says delete but there is a post in the thread that tells you how to make it move a thread after a reply.

And it works all the way up to 3.8.x ;)
Thanks for the help - I've been looking for this for at least a week.