WordPress.org

Ready to get started?Download WordPress

Forums

live-comment-preview doesn't work (22 posts)

  1. AndrewKantor
    Member
    Posted 6 years ago #

    (Sorry for the multiple posts, but it doesn't seem to like the code markup!)

    I love the idea of this plugin, but, well, nothing happens when I install and activate it. I should say that nothing happens in my customized theme; it works if I switch to the WordPress Classic theme.

    Obviously I'm doing something wrong. Here's the relevant section of my comments.php file:

    <?php if (comments_open()) : ?>


    <form action="http://www.kantor.com/blog/wp-comments-post.php" method="post" id ="commentform">
    <h3>Weigh in</h3>

    <p><small>Yer name:</small>
    <input type="text" name="author" size="21" value="<?php echo $comment_author; ?>" tabindex="1" /></p>

    <p><small>Yer e-mail (so I can respond privately -- never ever shared):</small>
    <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" /></p>

    <p><small>Yer Web site (if you like):</small>
    <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /></p>

    <p><small>What you have to say (Be civil, or it might be removed; comments with linksmight be held for moderation, just so you know):</small>
    <textarea name="comment" cols="50" rows="10" tabindex="4"></textarea>

    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    <?php live_preview(); ?>
    <?php endif; ?>
    '</form&gt

    Any help you can give would be most appreciated -- thanks!

    Andrew

  2. AndrewKantor
    Member
    Posted 6 years ago #

    (Sorry for the multiple posts, but it doesn't seem to like the code markup!)

    I love the idea of this plugin, but, well, nothing happens when I install and activate it. I should say that nothing happens in my customized theme; it works if I switch to the WordPress Classic theme.

    Obviously I'm doing something wrong. Here's the relevant section of my comments.php file:

    <?php if (comments_open()) : ?>


    <form action="http://www.kantor.com/blog/wp-comments-post.php" method="post" id ="commentform">
    <h3>Weigh in</h3>

    <p><small>Yer name:</small>
    <input type="text" name="author" size="21" value="<?php echo $comment_author; ?>" tabindex="1" /></p>

    <p><small>Yer e-mail (so I can respond privately -- never ever shared):</small>
    <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" /></p>

    <p><small>Yer Web site (if you like):</small>
    <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /></p>

    <p><small>What you have to say (Be civil, or it might be removed; comments with linksmight be held for moderation, just so you know):</small>
    <textarea name="comment" cols="50" rows="10" tabindex="4"></textarea>

    <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    <?php live_preview(); ?>
    <?php endif; ?>
    '</form&gt

    Any help you can give would be most appreciated -- thanks!

    Andrew

  3. Icanseeclearlynow
    Member
    Posted 6 years ago #

    Mine does not work either.

  4. byronrode
    Member
    Posted 6 years ago #

    hey guys! see this post for a fix for the above!
    http://wordpress.org/support/topic/143524

  5. lworrilow
    Member
    Posted 6 years ago #

    The fix you have referenced is for Live Comment Preview 1.7 and not version 1.8.

    I can't get Live Comment Preview version 1.8 to work with WordPress 2.3.1.

  6. Brad Touesnard
    Member
    Posted 6 years ago #

    I've taken over maintenance of this plugin and just updated it today. I noticed that problem and fixed it in the 1.8 release.

  7. lworrilow
    Member
    Posted 6 years ago #

    I'm using the Copyblogger 1.0 theme and it doesn't work with it and I can't find the problem. Nothing happens when I activate the theme. I'll just have to stay with version 1.7.

  8. KirkM
    Member
    Posted 6 years ago #

    Version 1.8 does not work for me either where 1.7 (right out of the box, no modification) has always worked just fine. There are several others in various places in the forum who are also complaining that 1.8 does not work. I even tried installing the code snippet and it still doesn't work. Went back to 1.7.

  9. ingaoz
    Member
    Posted 6 years ago #

    I use version 1.8.2 with WP 2.3.1 and that plugin don't works for me even if I add that code line to my comments page manually. I have no idea why it not works :(

  10. OylerActionPhotos
    Member
    Posted 6 years ago #

    Has anyone ever figured out how to get this working again? I've tried several different fixes mentioned in various threads and nothing works.

    I've tried this on 15 of the sites I manage, and tried it with over 40 different themes, and none of them work.

    So wondering if there is a fix, or is this terminally obsolete now. Is there an alternative plugin option that does work?

  11. happygiraffe
    Member
    Posted 6 years ago #

    I've just found that I had to make a couple of changes to get live-comment-preview to work.

    • Around line 158, change str_replace("\r\n", "", $previewFormat) to str_replace("\n", "", $previewFormat). That should get previews for non-logged in users.
    • To get comments for logged in users working, change line 153 from if (eml != '') { to if (eml) {.

    It would be nice to get those fixes into a released version…

  12. relaxedguy
    Member
    Posted 6 years ago #

    Sends happygiraffe the beverage of their choice, cheers for the two fixes, exactly what I was looking for.

    Plugin updating is a nightmare on WP and this codex, while useful, is ungainly, took me a long to to find the fix. hope someone cleans this place up soon, it's a jungle in here

  13. Flash604
    Member
    Posted 6 years ago #

    Thanks happygiraffe, your fixes worked for me too.

  14. tslack
    Member
    Posted 6 years ago #

    Worked for me three. (WordPress 2.5) Thank you!

  15. Stephanie Leary
    Member
    Posted 6 years ago #

    I still can't get it to work in 2.5 with those modifications. I'm using a custom theme, so I've placed the live_preview() function in the comments template, and this appears when I view source:

    <script src="http://storystats.com/?live-comment-preview.js" type="text/javascript"></script><div id="commentPreview"></div>

    ... but it stays empty when I type. :(

  16. progressnerd
    Member
    Posted 6 years ago #

    Yes, I have the exact same problem as sillybean. I'm using 2.5, see the exact save tags in the html source as sillybean (except my own URL in place of storystats.com, of course), and absolutely nothing happens when I type. Any help?

  17. progressnerd
    Member
    Posted 6 years ago #

    FIXED!!!!

    When I did both of happygiraffe's edits, the plugin didn't work. As it turned out, all I needed to do was happygiraffe's second edit:
    change line 153 from if (eml != '') { to if (eml) {

    His edit for line 158 probably works on some operating systems but not others. To make the plugin OS-independent, I think the code should replace line 158 with these two lines:
    str_replace("\r", " ", $previewFormat);
    str_replace("\n", " ", $previewFormat);

    This will replace each possible return character separately. Also, note that instead of replacing the characters with the empty string, they're replaced by a space. This is in case $previewFormat has two English words separated across two lines -- it would be add for the str_replace to concatenate them.

  18. Neuroitc
    Member
    Posted 6 years ago #

    Thanks happygiraffe for fixing this plugin. There is only one thing that isn't properly fixed and it's the gravatar of members: it, on my blog, isn't shown but instead there is default avatar. I think that it's due to old code in getting avatar from gravatar.com. Is it possible to change it and putting gravatar function of WP 2.5?
    Thanks in advance.

  19. Brad Touesnard
    Member
    Posted 6 years ago #

    Version 1.9 contains the fixes in this thread. Thanks to happygiraffe for submitting your fixes and everyone else for testing and confirming them.

  20. a1r
    Member
    Posted 6 years ago #

    Hi Bradt,

    Just upgraded to 1.9 and it does *not* appear to include the crucial fix:

    if (eml)

    I am using WP 2.5.1 and nothing happens without the fix above. I reapplied to 1.9 and now everything is fine.

  21. vlag
    Member
    Posted 6 years ago #

    Like a1r, the plugin is not working for me, even with the fix...
    (WP-2.5.1,LCP-1.9)

  22. marcthiele
    Member
    Posted 6 years ago #

    Trying to use it in WordPress 2.6. Maybe this is the issue. But in fact it is not working for me neither :(

    Any idea?

    Thanks,
    marc

Topic Closed

This topic has been closed to new replies.

About this Topic