Fender963
01-27-2009, 10:13 PM
Hey Guys,
A couple search didn't turn up anything.
Anyways I am programmaticaly closing threads and adding a post stating "This thread has automatically been closed by the forum ...."
Here is the code I'm using to do that:
$postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);
$postthreadid = $thread->thread_id;
// Use $postusername if posting as a guest, use $postuserid if posting as a user
$postuserid = '3';
$threadinfo = fetch_threadinfo($postthreadid);
$foruminfo = fetch_foruminfo($thread->forum_id);
$postdm->set_info('forum', $foruminfo);
$postdm->set_info('thread', $threadinfo);
$postdm->set('threadid', $postthreadid);
//Use $postusername if posting as a guest, use $postuserid if posting as a user
$postdm->set('userid', $postuserid);
$text = "This thread has automatically been closed by the forum. ";
$postdm->set('pagetext', $text);
$postdm->set('allowsmilie', 1);
$postdm->set('visible', 1);
$postdm->set('dateline', TIMENOW);
$close_post_id = $postdm->save();
unset($postdm);
Right now this post is bumping the thread to the top of the forum, is there maybe a flag you can set so no bumping occurs?
Regards,
Kyle
A couple search didn't turn up anything.
Anyways I am programmaticaly closing threads and adding a post stating "This thread has automatically been closed by the forum ...."
Here is the code I'm using to do that:
$postdm = new vB_DataManager_Post($vbulletin, ERRTYPE_STANDARD);
$postthreadid = $thread->thread_id;
// Use $postusername if posting as a guest, use $postuserid if posting as a user
$postuserid = '3';
$threadinfo = fetch_threadinfo($postthreadid);
$foruminfo = fetch_foruminfo($thread->forum_id);
$postdm->set_info('forum', $foruminfo);
$postdm->set_info('thread', $threadinfo);
$postdm->set('threadid', $postthreadid);
//Use $postusername if posting as a guest, use $postuserid if posting as a user
$postdm->set('userid', $postuserid);
$text = "This thread has automatically been closed by the forum. ";
$postdm->set('pagetext', $text);
$postdm->set('allowsmilie', 1);
$postdm->set('visible', 1);
$postdm->set('dateline', TIMENOW);
$close_post_id = $postdm->save();
unset($postdm);
Right now this post is bumping the thread to the top of the forum, is there maybe a flag you can set so no bumping occurs?
Regards,
Kyle