function qa_comment_delete($oldcomment, $question, $parent, $userid, $handle, $cookieid) { if (!isset($parent)) { $parent = $question; } // for backwards compatibility with old answer parameter if ($oldcomment['type'] != 'C_HIDDEN') { qa_fatal_error('Tried to delete a non-hidden comment'); } qa_post_unindex($oldcomment['postid']); qa_db_post_delete($oldcomment['postid']); qa_db_points_update_ifuser($oldcomment['userid'], array('cposts')); qa_db_ccount_update(); qa_report_event('c_delete', $userid, $handle, $cookieid, array('postid' => $oldcomment['postid'], 'parentid' => $oldcomment['parentid'], 'oldcomment' => $oldcomment, 'parenttype' => $parent['basetype'], 'questionid' => $question['postid'])); }
function qa_comment_delete($oldcomment, $question, $answer, $userid, $handle, $cookieid) { if (!$oldcomment['hidden']) { qa_fatal_error('Tried to delete a non-hidden comment'); } qa_post_unindex($oldcomment['postid']); qa_db_post_delete($oldcomment['postid']); qa_db_points_update_ifuser($oldcomment['userid'], array('cposts')); qa_db_ccount_update(); qa_report_event('c_delete', $userid, $handle, $cookieid, array('postid' => $oldcomment['postid'], 'parentid' => $oldcomment['parentid'], 'parenttype' => isset($answer) ? $answer['basetype'] : $question['basetype'], 'questionid' => $question['postid'])); }