BuddyDev

Search

comment button for “WordPress activity post” in stream missing

  • Participant
    Level: Initiated
    Posts: 15
    Toury on #39564

    hi there, if I write a normal wordpress post then this post appears also in the buddypress stream as an activity. but it seems that this “wordpress activity post” is not commentable within the buddypress activity stream. If I write a “normal” activity post within the stream then there is a “comment button”. How can I get the “comment button” also under the “wordpress activity post”?

  • Keymaster
    (BuddyDev Team)
    Posts: 19031
    Brajesh Singh on #39566

    HI Toury,
    Welcome to BuddyDev support forums.

    Please visit Dashboard->Settings->BuddyPress->Options and look for “Allow activity stream commenting on posts and comments”

    Tick that option and the commenting will be enabled. It may not sync to the actual blog post though.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 15
    Toury on #39611

    ok, thank you for the hint!

  • Participant
    Level: Initiated
    Posts: 15
    Toury on #39663

    I have activated “Allow activity stream commenting on posts and comments” as you recommended but I still only have the chance to comment the activities ”new users” and ”new updates” but not ”sabai reviews”, ”photos” or ”wordpress blog posts”
    you can see it here on this screenshot https://i.postimg.cc/FzGfZJSJ/buddypress-activity-stream.jpg

    Can you pls help me and tell me which file(s) I have to adapt in which manner (used theme is KLEO from seventhqueen)!

    Thank you very much,
    Toury

  • Participant
    Level: Initiated
    Posts: 15
    Toury on #39665

    Addition: I have just seen in your activity stream https://buddydev.com/activity/ that it is not a “problem” on my site but it is also not “activated” on your site: see screenshot here: https://i.postimg.cc/nVqRfhk6/Fire-Shot-Capture-487-Site-Wide-Activity-Buddy-Dev-buddydev-com.jpg
    “New User” can by marked as favorite and has the Comment function but “new post” (from your blog) can not be commented! (see posts from Anu Sharma in the stream)
    Do you have a fix for this issue? Would be really nice if you could share a solution for this here!

    • This reply was modified 1 week, 6 days ago by Toury.
  • Keymaster
    (BuddyDev Team)
    Posts: 19031
    Brajesh Singh on #39668

    Hi Toury,

    On the BuddyDev site, we have intentionally disabled the ability to comment on the blog posts in activity stream. we did not want the comments to be split at 2 places.

    Here is a screenshot showing it working.
    https://i.imgur.com/AxW154j.png

    The problem is either your theme is not supporting it or the comments are closed for the post. Since you are using a premium theme, I will request approaching them for the solution.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 15
    Toury on #39676

    hi brajesh, thank you very much for your quick reply. Comments are enabled on my site in > settings > discussion
    Thank you for approaching seventhqueen for a solution. Pls let me know if you get an answer.
    If you want (and it would help) I can´t grant you admin rights for my staging installation.

    • This reply was modified 1 week, 6 days ago by Toury.
  • Keymaster
    (BuddyDev Team)
    Posts: 19031
    Brajesh Singh on #39680

    Hi Toury,
    Thank you for the reply.

    I am sorry, I am not approaching the seventhqueen. I suggested you to approach them with the issue.

    My screenshot showed you how this feature works(I used one of my own theme for showing it). If you have the settings enabled and it is not working, It needs to be handled by the theme developers.

    Please contact seventhqueen and request them for support on this.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 15
    Toury on #39682

    Hi Brajesh,

    ah ok, then this was a misunderstanding 😉 I have just contacted the developers of KLEO theme. I hope that they will/can solve this issue. If I get a solution by them, I will post it here in the thread!

    Cheers,
    Toury

  • Participant
    Level: Initiated
    Posts: 15
    Toury on #39782

    Hi Brajesh,

    unfortunately the KLEO developers couldnt help me.
    I have just found the file bp-custom.php in my folder plugins.
    perhaps here is some “mis-setting” as here are several codes corcerning activity comments. As I am not a coder at all, could you perhaps have a short look at it and let me know if there should be something adapted?


    <?php

    /*
    * Blog Comments in Buddypress Activity
    * WARNING: Test thoroughly if it works in your environment before using in production code.
    * LICENSE: Public domain
    */

    /*
    * When a new comment gets added to the database, add this comment to the
    * activity stream
    */
    function bca_record_activity($comment_id, $approval) {
    if($approval == 1) {
    $comment = get_comment($comment_id);
    $userlink = bp_core_get_userlink($comment->user_id);
    $postlink = 'comment_post_ID) . '">'
    . get_the_title($comment->comment_post_ID) . '
    ';

    bp_activity_add(array(
    'action' => sprintf( __( '%1$s commented on the post, %2$s', 'buddypress' ),
    $userlink, $postlink),
    'content' => $comment->comment_content,
    'component' => 'bp_plugin',
    'user_id' => $comment->user_id,
    'type' => 'new_blog_comment',

    ));

    }
    }
    //comment_post is triggered "just after a comment is saved in the database".
    add_action('comment_post', 'bca_record_activity', 10, 2);

    /*
    * We want activity entries of blog comments to be shown as "mini"-entries
    */
    function bca_minify_activity($array) {
    $array[] = 'new_blog_comment';
    return $array;
    }
    add_filter('bp_activity_mini_activity_types', 'bca_minify_activity');

    /*
    * Disables comments on this type of activity entry
    */
    function bca_remove_commenting($can_comment) {
    if($can_comment == true) {
    $can_comment = ! ('new_blog_comment' == bp_get_activity_action_name());
    }
    return $can_comment;
    }
    add_filter('bp_activity_can_comment', 'bca_remove_commenting');

    add_filter('bp_core_fetch_avatar_no_grav', '__return_true');

    //Add tinymce to Activity Post Form

    function bpfr_whats_new_tiny_editor() {
    // deactivation of the visual tab, so user can't play with template styles
    add_filter ( 'user_can_richedit' , create_function ( '$a' , 'return false;' ) , 50 );

    // building the what's new textarea
    if ( isset( $_GET['r'] ) ) :
    $content = esc_textarea( $_GET['r'] );
    endif;

    // adding tinymce tools
    $editor_id = 'whats-new';
    $settings = array(
    'textarea_name' => 'whats-new',
    'teeny' => true,
    'media_buttons' => true,
    'drag_drop_upload' => true,
    'quicktags' => array(
    'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close'));

    // get the editor
    wp_editor( $content, $editor_id, $settings );
    }
    add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );

    /**
    * Use the username as display name.
    */
    function buddydev_inject_username_as_fullname() {
    $_POST['field_1'] = $_POST['signup_username'];

    }
    add_action( 'bp_signup_pre_validate', 'buddydev_inject_username_as_fullname' );

    /**
    * Disable client side required attribute in input field to avoid failing of form submission.
    * All modern browsers will not submit if a field is marked as required and does not have the value.
    *
    * @param array $atts input field attributes.
    * @param string $field_name field name.
    *
    * @return array
    */
    function buddydev_disable_fullname_required_attributes( $atts, $field_name ) {

    global $field;
    // If your fullname field has a different id(should not happen in normal cases), please use that
    // Default value '1' will work for most people.
    $fullname_field_id = 1;

    if ( $field && $fullname_field_id !== $field->id ) {
    return $atts;
    }

    foreach ( $atts as $key => $value ) {
    if ( 'required' === $value ) {
    unset( $atts[ $key ] );
    break;
    }
    }
    return $atts;
    }

    add_filter( 'bp_get_form_field_attributes', 'buddydev_disable_fullname_required_attributes', 10, 2 );

    ?>

    • This reply was modified 1 week ago by Toury.

You must be logged in to reply to this topic.

This topic is: not resolved