12.22.2024

06.01.2006

AJAX Comment Preview

DOWNLOAD

Get the plugin from the Ajax Comment Preview page in the WordPress.org plugins directory.

COMPATIBILITY

The newest version of this plugin (version 2.1) is compatible with WordPress 2.6 and higher only. Users of WordPress 2.0.x should use the older version 1.0.1 (which is unsupported and probably broken).

INSTALLATION

For more information, see the Ajax Comment Preview FAQ in the WordPress.org plugins directory.

To use this plugin, all files from the zip file you download must be in your wp-content/plugins/ directory. If you choose to place them in a subdirectory, all files must be in the same directory.

Activate the plugin from your WordPress site’s Plugins admin page.

Edit the plugin’s options from your Options -> AJAX Comment Preview admin page in order to specify the formatting of the preview. This will depend on your particular theme. The default format works for WordPress’ default Kubrick theme.

Note: You may need to tweak your theme’s CSS to get the preview to look exactly like a normal comment.

Testing

I get a number of comments on this post testing the system. A little odd, since it seems to me people should be testing the preview functionality (which is new) not the comment posting functionality (which is the same old WordPress standard stuff). Anyway, that’s cool. Go ahead. But please do me a favor; don’t just thow up some lame “testing” comment. Try sending over a poem or maybe something from the Farmer’s Almanac. Tell me your favorite book/artist/music. Don’t suck; try to be creative.

The History

My original post.

2.1

  • Fixes an JavaScript issue in Internet Explorer reported by Eric

2.0

  • Full gravatar/avatar support
  • Moved to jQuery
  • WordPress 2.7 support
  • Should have fixed any character endcoding issues
  • Should now work on pages served as XML

1.2.1:

  • Fully internationalized dates

1.2:

  • Fixed some JS errors (Mark Jaquith)
  • %email_hash% available for gravatars
  • Readme file with configuration instructions
  • Fix double offset in dates (Mark Jaquith)

336 Comments »

  1.  
    Shane 07.22.2007 @ 00:08

    Hi,

    Trying to use the plugin, but the Preview button is sitting below and to the left of the submit, rather than next to it as it does here on this site.

    How can I fix it?

    Thanks,
    Shane.

  2.  
    Anonymous 07.23.2007 @ 04:24

    ;-) :-) :)

  3.  
    Dan Ryan 07.25.2007 @ 20:23

    Testing this out…

  4.  
    Anonymous 07.25.2007 @ 23:19

    Hi i just installed your plugin succesfully and it is working great. But only one concern. I’m getting a validation error after installation.

    Can you please help me out how to troubleshoot this validation bug. Thank you in advance.

  5.  
    Portrait artist 08.02.2007 @ 02:40

    I’m recently using AJAX comments version 2.0. Do I need to uninstall this before installing your version?

    I really like this because it works best when moderation is off.

  6.  
    SEO Blogger 08.05.2007 @ 18:37

    Hey, I’ve just replace this plugin with the other “LIve Preview Commment” plugins.

    However, I found out that this plugin is NOT compatible with WP-Ajax Edit Comment (http://www.raproject.com/wordpress/wp-ajax-edit-comments/).
    Even though I have read the Ajax Edit Comment author’s instruction on how to make jabs and hooks, I still don’t get it to work nicely with your plugin ‘MDA’.

    So, do think you could go over there to throw some hooks into this plugin to make it work with Ajax Edit Commment?

    Let me know.

  7.  
    Ulf 08.06.2007 @ 06:52

    Thanks for the great plugin

  8.  
    swordfish 08.10.2007 @ 22:09

    Finally a comment preview that actually works on WP 2.2.2. Thanks!!
    “In every American there is an air of incorrigible innocence, which seems to conceal a diabolical cunning.”
    -A. E. Housman

  9.  
    pilgrim 08.12.2007 @ 14:48

    hi
    this may or may not be the same bug mentioned in comment #75 (I haven’t gone looking for “emptystring” in the code) but when I removed the text from the “preview text area” option, the plugin stopped displaying the comment, although I didn’t get any errors, and nothing actually broke. So I just put a ” ” in the field. Worked again.

    Heh. Now *your* preview button on this page isn’t working for me! (I’m using Firefox 2/Mac OS X)

  10.  
    youtube 08.17.2007 @ 16:21

    Everything works pritty well, Thanks!

    The only question I have is how to place the preview button? It is on top of the comment text box, it doesn’t make much since to me their. Any ideas how to move?

  11.  
    gasmonso 08.17.2007 @ 17:55

    Just the solution I was looking for :)

    Thanks for your hard work… it’s greatly appreciated!

    gasmonso

  12.  
    Raymond 08.29.2007 @ 18:36

    Pudge controls the weather.

  13.  
    Bassam 08.29.2007 @ 22:40

    Brillaint! I love this, exactly what I’ve been looking for.

  14.  
    john 09.01.2007 @ 21:16

    ummm

  15.  
    Jared 09.01.2007 @ 21:43

    I wish I could get this to work :(

  16.  
    stranger 09.04.2007 @ 11:59

    hi everybody,
    once i click on preview ,nothing happened ..i put 2 files in plugin directory , i activated ,but no result , need help :(

  17.  
    stranger 09.04.2007 @ 12:01

    does this plugin work with wordpress mu?? thx in advance

  18.  
    Roggan 09.10.2007 @ 17:34

    I have a problem using this on my local server. I’m running an Xampp-installed Apache with php 4 and mysql. It works fine on my external webhost, but I need to run it locally as well. Any ideas?

  19.  
    Gijet 09.11.2007 @ 14:26

    Hi…

    Thanks for this great plugin. I’ve activated it via Plugin in admin area. But unfortunately, the bottom of “Preview” is disfunction. When every i click the “Preview” there’s NO effect. You can see below:

    http://aufklarung.org/?p=131#more-131

    Another problem is i want to give a background for the Preview bottom same like the background of bottom of the comment submit, so please tell me how to do that?

  20.  
    Gijet 09.11.2007 @ 14:29

    sorry, i’m wrong typing, the “bottom” word on my post above is “Button” :-).. once again, sorry :-)

  21.  
    York 09.12.2007 @ 16:50

    Winter water
    Blue and chill
    Freeze the heart
    Let passion kill.

  22.  
    Gwyneth Llewelyn 09.13.2007 @ 01:36

    Hi, I got precisely the same error as @30 Michael Cohen, but it only happens on pages (not articles) that have their own templates, so it might just be that my “own” templates have a problem (which is strange, since I run quite a lot of plugins, and none have problems).

    So I have no idea what causes it under WP 2.2.2, however, there is a simple fix: in function send(), just scroll down until you get the call to get_currentuserinfo(); (in my case, it’s line 46) and add the following code before that line:


    if (!function_exists('get_currentuserinfo'))
    return;

    I believe that under some circumstances, WP might for some reason be unable to include the proper include files because they’re not necessary (I’m wildly speculating!) and/or the logged-in user data has been lost in a session. Whatever that might be, in my personal case, the page templates in question all have comments disabled, so getting rid of the call to get_currentuserinfo() works for me.

  23.  
    osez 09.13.2007 @ 01:50

    hi comment preview worked well until yesterday, i did some modifications and now it dont work anymore, cant find what ‘s wrong , here is the error code :

    uncaught exception: Permission refusée (denied) d’appeler (call) la méthode XMLHttpRequest.open

    Line 0

    thank you

  24.  
    barbee 09.14.2007 @ 02:41

    cool! :D

  25.  
    Pal 09.18.2007 @ 12:13

    Oh, sorry about that, I just said “test”. A poem, hmm…

    I can’t think of any, so I’ll just thank you for your hard work: thanks!

  26.  
    Kaihawaii 09.20.2007 @ 00:34

    Hi, I use the comments already on the main site, but the preview isn´t working.
    Could do you say me, how I can fix the problem?
    http://easyflair.de/hoppetosse/

  27.  
    james 09.24.2007 @ 22:29

    test

  28.  
    gothic 09.29.2007 @ 12:40

    perfect plugin!

  29.  
    Richard D. LeCour 10.04.2007 @ 16:28

    You might want to release a 1.2.2! I fixed some JavaScript errors I was getting (on pages without comments turned on) by checking for nulls a bit earlier.

    function commentPreviewInit() {
    doitElement = document.getElementById('acp-preview');
    if ( doitElement == null ) return;
    acpFormElement = doitElement.parentNode;
    while ( 'form' != acpFormElement.tagName.toLowerCase() )
    acpFormElement = acpFormElement.parentNode;
    inputElement = acpGetFormInput( 'comment' );
    if ( inputElement == null ) return;
    outputElement = document.getElementById('ajax-comment-preview');
    if ( outputElement == null ) return;
    authorElement = acpGetFormInput( 'author' );
    urlElement = acpGetFormInput( 'url' );
    doitElement.onclick = commentPreviewAJAX;
    // set the result field to hidden, or to default string
    if ( '' == emptyString ) outputElement.style.display = 'none';
    else outputElement.innerHTML = emptyString;
    }

  30.  
    drupish 10.20.2007 @ 04:03

    Three gods A, B, and C are called, in some order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are ‘da’ and ‘ja’, in some order. You do not know which word means which.

  31.  
    Dompbob 10.23.2007 @ 08:55

    Virker det stadig? Gør det stadig det?

  32.  
    nick 10.25.2007 @ 00:33

    hello, jesus is awesome.

    sometimes, over the rainbow.

    sometimes,

    iuno i just wanna see how it works, niice.. very nice

  33.  
    Shabith 10.26.2007 @ 06:13

    great plugin! thumbs up!

  34.  
    Tom 10.31.2007 @ 04:17

    perfect plugin, thanks

  35.  
    vihali 11.05.2007 @ 07:42

    it works like a charm

  36.  
    LeSpocky 11.10.2007 @ 07:52

    Hearing U2 at the moment, I just test the “blockquote”-tag:

    I have run through the fields
    only to be with you

    Just curious how this works and if it works fine, I’ll install…

  37.  
    Robert Irizarry 11.10.2007 @ 13:23

    Works great but I’d like the Preview button to line up similar to your layout. Instead one button ends up directly under the other. How do I go about it? Thanks!

  38.  
    Robert Irizarry 11.11.2007 @ 20:03

    I discovered the problem. I’m using the comments.php from Brian’s Threaded Comments. I was able to move a closing div tag to get the Submit and Preview buttons to turn up on the same line. A bit of CSS should handle the rest.

  39.  
    Saedel 11.12.2007 @ 17:30

    Sample of comments… looks great.

    thanks!

    *two-thumbs up*

  40.  
    Ajaxpert 11.16.2007 @ 04:44

    here is good link for AJAX tutorial.

    http://gohil.dharmesh.googlepages.com/ajax.html

  41.  
    Code4Gold 11.17.2007 @ 01:11

    I love Ajax, I have a feature like this that I coded into my SMF forum for members to preview signatures and I did another one to get the members most recent blog post every time they login and append it in their signature whenever they post. I’ve just grabbed this plugin and am looking forward to testing it on some of my wordpress installs. I’m always on the lookout for cool plugins because I host WordPress and SMF sites and my clients love any new stuff.

  42.  
    jmmb jmmb 11.21.2007 @ 16:28

    is the plugin installed as i type this?

  43.  
    theAdamChronicles 11.23.2007 @ 10:14

    OMG said the frog
    WTF replied the ensemble

    Together they wondered while wandering.

  44.  
    Bud 11.27.2007 @ 01:24

    Testing

    When man invented the bicycle he reached the peak of his attainments. Here was a machine of precision and balance for the convenience of man. And (unlike subsequent inventions for man’s convenience) the more he used it, the fitter his body became. Here, for once, was a product of man’s brain that was entirely beneficial to those who used it, and of no harm or irritation to others. Progress should have stopped when man invented the bicycle.

    Elizabeth West

  45.  
    HelpingU 11.29.2007 @ 15:51

    Thanks for the plugin. I installed it with no problems on my blog that I just upgraded to WordPress 2.3.1 (the newest release). So it works on the newest release. Hope this is helpful.

  46.  
    Diego 11.30.2007 @ 03:41

    Teste

  47.  
    olivier 11.30.2007 @ 04:14

    Toute la vérité, messieurs, je vous la livre
    Si j’ai quitté les rangs des plus de deux cents livres,
    C’est la faute à Mimi, à Lisette, à Ninon,
    Et bien d’autres, j’ai pas la mémoire des noms.

  48.  
    TenienteCastillo 11.30.2007 @ 04:49

    Recomiendo ver la peli [REC] si quieres pasar miedo

  49.  
    Gilbitron 11.30.2007 @ 07:41

    A nice wee addition.

  50.  
    Panwar 12.03.2007 @ 19:06

    Hi dude your plugin is really cool thanks, can you tell me another plugin that when user submit comments then page should not be reloaded but only show submittd comment by ajax ?

Leave a Reply

Comment Moderation is on; comments with spammy words or a few links might be delayed. Don't worry, they'll get posted soon. If you think something has gone terribly wrong, contact me.

Line and paragraph breaks are inserted automatically and e-mail addresses are never displayed. You may use the following HTML tags in your comments.

<a abbr acronym b blockquote cite code del em i q s strike strong>

© mdawaffe (Michael D Adams) - Powered by WordPress - Full Credits