I have comment moderation turned on, and I get a lot of duplicate comments, presumably from people who think posting the comment didn't work. They don't see the message at the top of the page, because they are redirected to a place at the bottom.

So I am wondering if there is a chance to add a message to the comment input form telling them that posted comments will not show up immediately before they hit "submit". Is there a chance to add that without hacking the comment module? Is there perhaps a provision for this in 5.0? I can't update right now, so a solution for 4.7 would still be appreciated.

Comments

jason342’s picture

In your theme directory, put the code below in template.php (if you don't have template.php, make one).

<?php
function phptemplate_comment_form($form) {
  $output = '<br />WRITE WHAT YOU WANT HERE.';
  $output .= form_render($form);
  return $output;
}
?>
eagereyes’s picture

Thanks for the quick help! That works beautifully.

EagerEyes.org

jdsaward’s picture

Thanks for this snippet. It does the job for me also.

I just altered it slightly so as to put the message at the end of the form, just under the submit button as it seems more prominent there. I also included a styling tag so as to be able to give a background color (or whatever) to make the message unmissable. Thanks.

function phptemplate_comment_form($form) {  
  $output = form_render($form);
  $output .= "<div class=\"message_highlight\">Your comment will be queued for moderation, and may not show up immediately.</div>";
  return $output;
}
fehin’s picture

subscribing

nleo’s picture

How in D6?

vako’s picture

Still waiting for the D6 version...;)

vako’s picture

the code supplied is a function, how/where can we call that function? can we add the code anywhere in the template.php file?

vako’s picture

Just use the warning module to display any messages after you submit a comment.
http://drupal.org/project/warning