comment_delete($cid = NULL)
drupal/modules/comment/comment.admin.inc, line 247
Menu callback; delete a comment.
$cid The comment to be deleted.
function comment_delete($cid = NULL) {
$comment = db_fetch_object(db_query('SELECT c.*, u.name AS registered_name, u.uid FROM {comment} 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;
}