I wrote a very small addition to WordPress 1.2 which lets you have comment previews. The install is very simple and it helps in a couple of ways:
– Lets your commenters know what their final comment is going to look like
– Might prevent comment spammers
Example here: http://proc.homeip.net/testwp
Download here: http://weblogtoolscollection.com/b2-img/wp-comment-preview.zip
Please post bugs/suggestions.
The above trackback is from me.
I had some suggestions for this hack:
1. use
htmlspecialchars()
so that double-byte characters can be correctly showed up in the preview page.2.
apply_filters()
to$author_new
could be$author_new = apply_filters('comment_author', $author);
and to$comment_new
could be$comment_new = apply_filters('comment_text', $comment_new);
Good ideas, maybe in a newer release.
I’ve made some of the changes that mikelu suggests above, fixed the problems where slashes weren’t stripped from usernames/URLs, made it so that the comment is ‘texturized’ (smart quotes, etc.) during preview, and fixed a couple of the layout issues. My hack of the source code is available through my name link on this post.
Is this the latest version as posted here?
ZX
The example link no longer works.
wtehwreth
Why cant I preview *this* comment?
nice tool, i have just one question: i’m having probs to display the german “ae” (ä), “ue” (ü), “oe” (ö). What do i have to change?
Rob
qqqqqqqqqqqq
test comment
comment
I’m currently using Laughing Lizard’s Three Strikes plug in, and it seems to do a pretty good job, but this Comment Preview plugin might filter out some more.
Greets! I just upgraded to 1.5, and would like to know how to make wp-comment-preview work in the new setup. Any tips, or is that the end of the line for comment preview?
Thanks!
Very nifty, and easily implemented. Thanks!
I note the preview isn’t running here… 😕
Had to add a stripslashes to your preview output as follows:
?php echo stripslashes($comment_new); ?
and in the hidden values, as follows:
?php echo stripslashes (htmlentities($comment)); ?
It keptputting backslashes in things like “don’t” otherwise (and passed them to the post, too).
😳 Forgot to say:
Thank you for writing it. Adding a few stripslashes is nothing to the trouble I’d have had trying to do it myself!
Fixed 🙂
I have just one question: i’m having probs to display the german “ae†(ä), “ue†(ü), “oe†(ö). What do i have to change?
Is there a way to test this plugin somewhere?