echo ". \n"; vbflush(); } echo $vbphrase['done'] . '</p>'; define('CP_REDIRECT', 'index.php?do=home'); print_stop_message('pruned_threads_successfully_modcp'); } else { if ($vbulletin->GPC['type'] == 'move') { $threadslist = '0'; foreach ($vbulletin->GPC['thread'] as $threadid => $confirm) { $threadslist .= ',' . intval($threadid); } $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "thread SET\n\t\t\t\t\tforumid = " . $vbulletin->GPC['destforumid'] . "\n\t\t\t\tWHERE threadid IN ({$threadslist})\n\t\t\t\t\tAND forumid IN (" . implode(',', $forumids) . ")\n\t\t\t"); $vbulletin->db->query_write("TRUNCATE TABLE " . TABLE_PREFIX . "postparsed"); require_once DIR . '/includes/functions_prefix.php'; remove_invalid_prefixes($threadslist, $vbulletin->GPC['destforumid']); require_once DIR . '/includes/functions_databuild.php'; build_forum_counters($vbulletin->GPC['destforumid']); define('CP_REDIRECT', 'index.php?do=home'); print_stop_message('moved_threads_successfully_modcp'); } } } } print_cp_footer(); /*======================================================================*\ || #################################################################### || # Downloaded: 09:39, Wed Nov 5th 2008 || # CVS: $RCSfile$ - $Revision: 25059 $ || #################################################################### \*======================================================================*/
$old_redirect =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost'); $old_redirect->set_existing($threadarray["{$threadid}"]); $old_redirect->delete(false, true, NULL, false); unset($old_redirect); # Remove redirect threadids from $threadarray so no log entry is entered below or new redirect is added unset($threadarray["{$threadid}"]); } } } } if (!empty($threadarray)) { // Move threads // If mod can not manage threads in destination forum then unstick all moved threads $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "thread\n\t\t\tSET forumid = {$destforuminfo['forumid']}\n\t\t\t" . (!can_moderate($destforuminfo['forumid'], 'canmanagethreads') ? ", sticky = 0" : "") . "\n\t\t\tWHERE threadid IN(" . implode(',', array_keys($threadarray)) . ")\n\t\t"); require_once DIR . '/includes/functions_prefix.php'; remove_invalid_prefixes(array_keys($threadarray), $destforuminfo['forumid']); // update canview status of thread subscriptions update_subscriptions(array('threadids' => array_keys($threadarray))); // kill the post cache for these threads delete_post_cache_threads(array_keys($threadarray)); $movelog = array(); // Insert Redirects FUN FUN FUN if ($method == 'movered') { $redirectsql = array(); if ($vbulletin->GPC['redirect'] == 'expires') { switch ($vbulletin->GPC['frame']) { case 'h': $expires = mktime(date('H') + $vbulletin->GPC['period'], date('i'), date('s'), date('m'), date('d'), date('y')); break; case 'd': $expires = mktime(date('H'), date('i'), date('s'), date('m'), date('d') + $vbulletin->GPC['period'], date('y'));