• Resolved dannybrown

    (@dannybrown)


    Continuing to love this plugin and the awesome support for you guys!

    Wondering, for a future update, would it be possible to add option for commenters to edit their comment after posting it? This may not be feasible due to way the plugin works, but if there was a 5 minute window to edit a comment once posted, that would be awesome.

    Thanks for all your great work! 🙂

    https://wordpress.org/plugins/wpdiscuz/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author gVectors Team

    (@gvectors-team)

    Hi dannybrown,
    I’m sorry, but this is a very hard task and we have not planned add this in near future. It’s only available for Admins now through a link which opens edit area in Dashboard.

    Thread Starter dannybrown

    (@dannybrown)

    No worries, guys, just thought I’d ask – thought it might be more difficult, given it’s just name/email you require. Thanks for the response! 🙂

    Add to function.php:

    if(!is_admin()) add_filter(‘comment_text’,’add_edit_link_ct’,10,2);
    function add_edit_link_ct($text,$comment){
    global $user_ID;
    if(!$user_ID||$user_ID!=$comment->user_id) return $text;
    $time_edit = 120;//time edit
    $time_action = current_time(‘mysql’);
    $unix_time_action = strtotime($comment->comment_date);
    $unix_time = strtotime($time_action);
    if($unix_time > $unix_time_action+$time_edit) return $text;
    $text .= ‘ (Edit)
    <form method=”post” action=”” class=”edit-form-ct comment-form”>
    <textarea required class=”wp-editor-area” rows=”5″ cols=”40″ name=”comment”>’.esc_textarea($text).'</textarea>
    <input type=”submit” value=”Edit”>
    <input type=”hidden” name=”comment-edit-ct” value=”‘.$comment->comment_ID.'”> ‘.wp_nonce_field(‘comment-edit-ct’,’_wpnonce’,true,false).’
    </form>’;
    return $text;
    }

    add to before body:
    jQuery(function(){
    jQuery(‘.edit-comment-ct’).click(function() {
    jQuery(this).parent().next(‘.edit-form-ct’).slideToggle();
    return false;
    });
    });

    it should be added to the plugin code tpl-comment.php:
    function comment_edit_ct ( ) {
    if ( isset( $_POST[‘comment-edit-ct’] ) ) {
    if( !wp_verify_nonce( $_POST[‘_wpnonce’], ‘comment-edit-ct’ ) ) return false;
    $commentarr = array();
    $commentarr[‘comment_ID’] = $_POST[‘comment-edit-ct’];
    $commentarr[‘comment_content’] = force_balance_tags($_POST[‘comment’]);
    wp_update_comment( $commentarr );
    wp_redirect(get_comment_link($_POST[‘comment-edit-ct’]));
    exit;
    }
    }
    add_action(‘init’, ‘comment_edit_ct’);

    After adding a comment, the user can edit their comments during the specified time.

    Hi,

    There is a plugin called “Ajax Edit Comments” that allows people to edit their comments.
    I don’t know if it will work with wp-Discuz but it’s worth trying.

    Hope that helps,
    Nickelle

    Plugin Author gVectors Team

    (@gvectors-team)

    Hi,
    We just added comment editing function in wpDiscuz 2.1.0, please update.

    2.1.0 Changelog

    * Users can edit their comments (time-frame can be limited by admin)
    * Email notification options with radio selector instead of checkboxes
    * Subscription activation via additional “Confirm Subscription” email
    * Thumb-up and thumb-down voting icons
    * Integration with UserPro – Comment author profile picture
    * Integration with UserPro – Comment author name is linked to profile page
    * Integration with UserPro – User badges under comment author avatar
    * Integration with Postmatic for subscriptions and commenting by email
    * Persian (fa_IR) language, thanks to Vahid (VSG24)
    * Russian (ru_RU) language, thanks to OlafKS
    * Close pop-up messages by clicking outside of message-box
    * Scroll-down to comment are on clicking comments/replies link
    * Filter hooks on email fields
    * Filter hooks on comment form fields
    * Image source URL to image conversion in comment content

    ghacks

    (@ghacks)

    Is this limited to WordPress members currently? Can you enable this for all users please and not just members?

    Plugin Author gVectors Team

    (@gvectors-team)

    Hi ghacks,
    I’m sorry I didn’t follow you. wpDiscuz works with all users. What do you mean saying “members”? Members are users, and users are members. The “member” word has been used for author label only it’s not a different user type.

    ghacks

    (@ghacks)

    Where are the edit buttons or options then, I cannot seem to find them anywhere on the site

    http://www.ghacks.net/2015/04/02/help-us-test-the-new-comment-system/

    Plugin Author gVectors Team

    (@gvectors-team)

    The Edit button is always displayed if you’re the admin. If you’re not, it only available on your comments and only within 15 minutes after you insert this comment. After 15 minutes it’ll be hide. You can change this time limit on Dashboard > wpDiscuz admin page, “Allow comment editing for” option.

    If you’re a guest you can’t edit your comment. It’s only available for registered users.

    ghacks

    (@ghacks)

    Thanks for the explanation. Any plans to add guest editing as well?

    Plugin Author gVectors Team

    (@gvectors-team)

    I think this will never been added.
    This kind of features can decrease plugin security. Only authorized users must have permission to edit comments. The only way to recognize guests is the cookies and this is not a secure option to handle a serious function such as comment editing.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Ability for commenters to edit their comment’ is closed to new replies.