Menu callback; publish specified comment.
$cid: A comment identifier.
function comment_approve($cid) {
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], "comment/{$cid}/approve")) {
return MENU_ACCESS_DENIED;
}
if ($comment = comment_load($cid)) {
$comment->status = COMMENT_PUBLISHED;
comment_save($comment);
drupal_set_message(t('Comment approved.'));
drupal_goto('node/' . $comment->nid);
}
return MENU_NOT_FOUND;
}