comment_delete

5 comment.module comment_delete($cid = NULL)
6 comment.admin.inc comment_delete($cid = NULL)
7 comment.module comment_delete($cid)
8 comment.module comment_delete($cid)

Menu callback; delete a comment.

Parameters

$cid: The comment do be deleted.

2 string references to 'comment_delete'

File

modules/comment/comment.admin.inc, line 216
Admin page callbacks for the comment module.

Code

function comment_delete($cid = NULL) {
  $comment = db_fetch_object(db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.cid = %d', $cid));
  $comment->name = $comment->uid ? $comment->registered_name : $comment->name;

  $output = '';

  if (is_object($comment) && is_numeric($comment->cid)) {
    $output = drupal_get_form('comment_confirm_delete', $comment);
  }
  else {
    drupal_set_message(t('The comment no longer exists.'));
  }

  return $output;
}
Login or register to post comments