function comment_delete

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

Menu callback; delete a comment.

Parameters

$cid: The comment do be deleted.

2 string references to 'comment_delete'
comment_links in drupal-6.x/modules/comment/comment.module
Build command links for a comment (e.g.\ edit, reply, delete) with respect to the current user's access permissions.
comment_menu in drupal-6.x/modules/comment/comment.module
Implementation of hook_menu().

File

drupal-6.x/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;
}