comment_user
modules/comment/comment.module, строка 452
- Версии
- 5 – 6
comment_user($type, $edit, &$user, $category = NULL)
Реализация hook_user()
.
Provides signature customization for the user's comments.
Код
<?php
function comment_user($type, $edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account') {
// when user tries to edit his own data
$form['comment_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Comment settings'),
'#collapsible' => TRUE,
'#weight' => 4);
$form['comment_settings']['signature'] = array(
'#type' => 'textarea',
'#title' => t('Signature'),
'#default_value' => $edit['signature'],
'#description' => t('Your signature will be publicly displayed at the end of your comments.'));
return $form;
}
elseif ($type == 'delete') {
db_query('UPDATE {comments} SET uid = 0 WHERE uid = %d', $user->uid);
db_query('UPDATE {node_comment_statistics} SET last_comment_uid = 0 WHERE last_comment_uid = %d', $user->uid);
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии