You are here

function comment_edit in Drupal 4

Same name and namespace in other branches
  1. 5 modules/comment/comment.module \comment_edit()
  2. 6 modules/comment/comment.pages.inc \comment_edit()
1 string reference to 'comment_edit'
comment_menu in modules/comment.module
Implementation of hook_menu().

File

modules/comment.module, line 454
Enables users to comment on published content.

Code

function comment_edit($cid) {
  global $user;
  $comment = db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d', $cid));
  $comment = drupal_unpack($comment);
  $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
  if (comment_access('edit', $comment)) {
    return comment_form((array) $comment);
  }
  else {
    drupal_access_denied();
  }
}