PDA

View Full Version : Move Thread Script


GGLeague
07-26-2008, 10:53 PM
Provided I have the thread id, is there a way to move a thread to a specific forumid with external data man like this uses it to post or create a new thread?

https://vborg.vbsupport.ru/showthread.php?t=186339

Thanks!

RLShare
07-27-2008, 01:27 AM
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');

$threadinfo = fetch_threadinfo($threadid);

$foruminfo = fetch_foruminfo(NEWFORUMID);





$threaddm->set_existing($threadinfo);
$threaddm->set_info('forum', $foruminfo);
$threaddm->set('forumid', NEWFORUMID);


if($threaddm->errors){
There was an error
$threaddm->errors is an array of errors
}
else{
$threaddm->save();
}

Something like this should work, its untested with threads but Ive used the technique with Users so it should still work since its a datamanager. Change the 2 locations of NEWFORUMID to the forum id of the forum you want to move it to.

GGLeague
07-27-2008, 02:16 AM
Thanks!