Telling users their comment will go into the moderation queue *before* they post

eagereyes - January 19, 2007 - 03:58

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.

In your theme directory, put

jason342 - January 19, 2007 - 04:07

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;
}
?>

Thanks!

eagereyes - January 19, 2007 - 05:15

Thanks for the quick help! That works beautifully.

EagerEyes.org

A re-arrangement...

JDSaward - February 23, 2007 - 08:52

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.

<?php
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;
}
?>

How in D6?

nleo - February 17, 2009 - 03:24

How in D6?

 
 

Drupal is a registered trademark of Dries Buytaert.