Удаление комментариев
Вопрос
public function deleteComment($comment_id) { cmsCore::callEvent('DELETE_COMMENT', $comment_id); $this->getCommentChilds($comment_id); $sql = "DELETE FROM cms_comments WHERE id = '$comment_id' LIMIT 1"; $this->inDB->query($sql); cmsCore::deleteRatings('comment', $comment_id); cmsActions::removeObjectLog('add_comment', $comment_id); cmsCore::deleteUploadImages($comment_id, 'comment'); if ($this->childs){ foreach($this->childs as $child){ cmsCore::callEvent('DELETE_COMMENT', $child['id']); $sql = "DELETE FROM cms_comments WHERE id = '{$child['id']}' LIMIT 1"; $this->inDB->query($sql); cmsCore::deleteRatings('comment', $child['id']); cmsActions::removeObjectLog('add_comment', $child['id']); cmsCore::deleteUploadImages($child['id'], 'comment'); } } return true; }