PDA

View Full Version : "Close this thread" hook?


Spyike
01-28-2011, 07:03 PM
Is there a separate hook in vb4 that is linked to this phrase?

I have threads in a certain forum ID get moved to another when they get closed. I am using the hook location "threadmanage_openclose". In order to make this work properly, I have to close the thread via the "Administrative" tab. Is there anyway to have this work if I close the thread via the checkbox in the quickreply box/template?


$vbulletin->options['specified_forumids'] = @unserialize($vbulletin->options['specified_forumids']);

if ($vbulletin->options['moveclosed_enabled'] && ($vbulletin->options['specified_forumids'][0] == -1 || in_array($threadinfo['forumid'], $vbulletin->options['specified_forumids'])) && $threadinfo['open'] && $sticky)
{

$moveforumid = verify_id('forum', $vbulletin->options['specified_moveforum']);
$moveforuminfo = fetch_foruminfo($moveforumid );

if (!$moveforuminfo['cancontainthreads'] OR $moveforuminfo['link'])
{
eval(standard_error(fetch_error('moveillegalforum' )));
}


$threadman->set('forumid', $vbulletin->options['specified_moveforum']);
$threadman->save();
$action = $vbphrase['closed'];

if (empty($threadman->errors))
{
build_forum_counters($threadinfo['forumid']);
build_forum_counters($moveforumid);
}


$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$threadid";
eval(print_standard_redirect('redirect_openclose', true, true));


}

Thank you in advance for any help provided.