comments

A nice addition to comments

Here's a little snippet for hook_form_alter that will put another "Save" button right below a comment preview. This way users don't have to scroll all the way down past the edit form to save a comment after preview, it's right there.

This is for Drupal 6.

<?php
 
if ($form_id == 'comment_form' &&($form_state['post']['op'] == t('Preview'))) {
   
$form['top_submit'] = $form['submit'];
   
$form['top_submit']['#weight'] = -19;
   
$form['top_submit']['#suffix'] = t('Save your comment, or make changes below.');
  }
?>

Syndicate content