comment_form_submit

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/comment/comment.module, строка 1539

Версии
5
comment_form_submit($form_id, $form_values)
6
comment_form_submit($form, &$form_state)

Process comment form submissions; prepare the comment, store it, and set a redirection target.

Код

<?php
function comment_form_submit($form, &$form_state) {
  _comment_form_submit($form_state['values']);
  if ($cid = comment_save($form_state['values'])) {
    $node = node_load($form_state['values']['nid']);
    // Add 1 to existing $node->comment count to include new comment being added.
    $comment_count = $node->comment_count + 1;
    $page = comment_new_page_count($comment_count, 1, $node);
    $form_state['redirect'] = array('node/'. $node->nid, $page, "comment-$cid");
    return;
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему