bbPress

Simple, Fast, Elegant

bbPress plugin browser »

BBPress:Live Comment (0.1)

Download

Version: 0.1

Last Updated: 2008-2-14

Requires bbPress Version: 0.8.3.1 or higher

Compatible up to: 0.8.3.1

Author Homepage »

Plugin Homepage »

Donate to this plugin »

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(2)

Your Rating

Author: Enrique Chavez aka Tmeister

Provide users with a live comment preview before submit. show it in the same page using Ajax


  1. Good plugin!

    But in javascript file live_comment_preview.js I renamed the function Ajax() to lcp_Ajax() and changed the call in sendPostToPreview, to avoid conflicts with Ajax prototype functions in another plugins.

    Posted: 4 months ago #
  2. It didn't work for me even though I copied and pasted the code into my topic.php file exactly where you suggested =(

    Posted: 4 months ago #
  3. Tmeister, (or anyone) do you have thoughts on how to make this work for the first post in a thread? Putting the add_live_comment_preview tag in post-form.php causes the post to submit.

    ~ ~ ~ ~ ~ ~ ~

    Dees, in the file live_comment_preview.php, look for

    my-plugins

    and change it to

    bb-plugins

    Posted: 2 months ago #
  4. A few small suggestions:
    Line 14 live_comment_preview.php:
    $live_comment_preview_path = defined('BBPLUGINURL') ? BBPLUGINURL . 'live-comment-preview' : bb_get_option('uri') . 'bb-plugins/live-comment-preview';

    Line 23 (language attr is deprecated by W3C):
    $head .= "<script type='text/javascript' src='".$live_comment_preview_path."/live_comment_preview.js'></script>\n";

    Lines between 33&39 (We don't need interpret anything of HTML code brrr :(
    And, if you add the code to the differents forms, "return false" it's a good practice):
    echo '
    <div id="live_comment_preview_main_content"></div>

    <div id="live_comment_preview_button_div">
    <input type="submit" name="live_comment_preview_submit" id="live_comment_preview_submit" value="'.$label.'" onclick="sendPostToPreview(\''.$live_comment_preview_path.'\'); return false;" tabindex="5" />

    </div>';

    Regards

    PD: Tabindex for a web of quality ^^

    Posted: 2 months ago #
  5. So... we don't need HTML code extra:

    function add_live_comment_preview($label) {
    	global $live_comment_preview_path;
    	if( bb_is_user_logged_in() ) :
    		echo '
    		<input type="submit" name="live_comment_preview_submit"
    id="live_comment_preview_submit" value="'.$label.'"
    onclick="sendPostToPreview(\''.$live_comment_preview_path.'\');
    return false;" tabindex="5" />
    		<div id="live_comment_preview_main_content"></div>';
    	  endif;
    }

    This change allow you to put the preview button next to the submit button and can you apply style for both buttons.
    The div for preview is aside.

    Great plugin, regards.
    Srry lang.

    Posted: 2 months ago #
  6. citizenkeith

    Member

    Works, but this is appears before the preview:

    bbPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT post_read FROM bb_utplugin_log WHERE user_id = 1 AND topic_id =
    
    bbPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' )' at line 1]
    INSERT INTO bb_utplugin_log (user_id, topic_id, post_read) VALUES ( 1, , )
    
    bbPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT post_read FROM bb_utplugin_log WHERE user_id = 1 AND topic_id =
    
    bbPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' )' at line 1]
    INSERT INTO bb_utplugin_log (user_id, topic_id, post_read) VALUES ( 1, , )
    Posted: 2 months ago #
  7. pomeid

    Member

    Not working for me (bbpress 0.9.0.2). No effect in post.php and actually submit the replies in post-form.php. I've fixed the path from my-plugins to bb-plugins like intellivision said.

    Posted: 1 month ago #
  8. emmegildo

    Member

    work perfectly for me in bbpress 0.9!! thank you very much

    Posted: 2 weeks ago #

RSS feed for this topic

Add a Comment

You must log in to post.

Code is Poetry.