function comment_ip_form_alter in Comment IP 7
Implements hook_form_alter().
File
- ./
comment_ip.module, line 42 - Main hooks and functions for comment_ip module.
Code
function comment_ip_form_alter(&$form, &$form_state, $form_id) {
// Add commenters IP address to comment view.
if ($form_id == 'comment_admin_overview') {
if (!variable_get('blocked_ips', '')) {
$form['options']['operation']['#options']['block'] = t('Delete the selected comments and block their IPs');
}
else {
drupal_set_message(t('It looks like you have used the blocked_ips config setting. To block an IP displayed below you will need to manually add that IP to your blocked_ip config.'));
}
$form['comments']['#header']['ip']['data'] = 'IP';
foreach ($form['comments']['#options'] as $id => $options) {
$comment = comment_load($id);
$form['comments']['#options'][$id]['ip'] = $comment->hostname;
}
}
}