/** * Process the actual deletes * * @param boolean $is_hard_delete * @param vB_Legacy_User $user * @param string $reason * @param boolean $keepattachments */ protected function delete_internal($is_hard_delete, $user, $reason, $keepattachments) { global $vbulletin; $thread = $this->get_field('thread'); $forum = $thread->get_field('forum'); $postman =& datamanager_init('Post', $vbulletin, ERRTYPE_SILENT, 'threadpost'); $postman->set_existing($this->record); $postman->delete($forum->get_countposts(), $thread->get_field('threadid'), $is_hard_delete, array('userid' => $user->get_field('userid'), 'username' => $user->get_field('username'), 'reason' => $reason, 'keepattachments' => $keepattachments)); unset($postman); build_thread_counters($threadinfo['threadid']); if ($forum->get_field('lastthreadid') != $thread->get_field('threadid')) { $forum->decrement_replycount(); } else { // this thread is the one being displayed as the thread with the last post... // need to get the lastpost datestamp and lastposter name from the thread. build_forum_counters($thread->get_field('forumid')); } }
/** * Enter description here... * * @param boolean $is_hard_delete * @param vB_Legacy_User $user * @param String $reason * @param boolean $keepattachments */ protected function delete_internal($is_hard_delete, $user, $reason, $keepattachments) { global $vbulletin; $threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost'); $threadman->set_existing($this->record); $forum = $this->get_forum(); $threadman->delete($forum->get_field['replycount'], $is_hard_delete, array('userid' => $user->get_field('userid'), 'username' => $user->get_field('username'), 'reason' => $reason, 'keepattachments' => $keepattachments)); unset($threadman); if ($forum->get_field('lastthreadid') != $this->get_field('threadid')) { $forum->decrement_threadcount(); } else { // this thread is the one being displayed as the thread with the last post... // so get a new thread to display. build_forum_counters($this->get_field('forumid')); } }