• Hello!

    I only want to use this plugin so that comments created within lessons are posted/shared within buddypress groups that are tied with the relevant course.

    After installing the plugin and setting it up, I was impressed as it seemed to do the trick after posting a test comment in the first lesson of a course. However, I shortly discovered that for some reason this only works with ONE single lesson? For example..

    I post a comment in Lesson1, it shows in the group activity feed. I post a comment in Lesson2 (or any other), the comment does not display in the group activity feed.

    How is it possible that the plugin would only work with one lesson and not all lessons?

    I have tried deactivating all plugins and changing themes to see if there are any conflicts, but I have found none.

    Previously, I was using this code:

    /* Post Comments in Buddypress Activity */
    function bca_record_activity($comment_id, $approval) {
        if($approval == 1) {
            $comment = get_comment($comment_id);
            $userlink = bp_core_get_userlink($comment->user_id);
            $postlink = '<a href="' . get_permalink($comment->comment_post_ID) . '">' 
                            . get_the_title($comment->comment_post_ID) . '</a>';
     
            bp_activity_add(array(
                'action'            => sprintf( __( '%1$s commented on the lesson: %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');

    Is there any way I might be able to simply adapt that code so that rather than comments appearing in activity feeds, they rather appear in the corresponding course group associated with the lesson?

    Thanks!!

    • This topic was modified 4 years, 2 months ago by King Ding.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter King Ding

    (@dazzerr)

    I would like to add that when other course activity settings are checked such as “User completes a lesson”, this information is sent to the group activity feed… It’s just the comments that don’t seem to show up for some reason?

    Also when posting a comment within a topic, the group feed shows a “USER posted an update in the group XXXXX”.

    Lastly I noticed that when writing a genuine update in the main group activity, after clicking submit- nothing happens. I don’t understand how this could be happening since all plugins are disabled (except necessary), and I’ve tried with a mixture of themes.

    It’s as if the features of this plugin are all mixed up?

    Thread Starter King Ding

    (@dazzerr)

    After some testing, I notice that in my database under the ‘bp_activity’ table, the lesson_comment is recorded when I comment in Lesson1. However when I comment in any other lesson besides this one, these comments are not recorded into the database under the ‘bp_activity’ table (only the ‘comments’ table).

    By adding add_action('comment_post', 'bp_learndash_record_activity', 10, 2); to: bp-learndash-functions.php I can now see blank entries recorded in the database and in the group feed. No information is recorded, but at least the act of commenting is being recorded.

    I’ve experimented by changing some information between lines 370-409 in bp-learndash-functions.php of the plugin, but had no success. Perhaps I’m looking in the wrong place? Any suggestions on why information might not be getting logged in the database would be very much appreciated!

    Thanks!

    • This reply was modified 4 years, 2 months ago by King Ding.

    I have the same weird problem. Did you manage to solve it?

    Thread Starter King Ding

    (@dazzerr)

    I actually created my own plugin that sends lesson comments to the group, and replies to those group comments back to the lesson comment, giving a two way sync between ?? I may release it, but you’re the first person I’ve heard of besides myself who has requested this. It would be great if BuddyBoss included this in their own plugins.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I actually created my own plugin that sends lesson comments to the group, and replies to those group comments back to the lesson comment, giving a two way sync between ?? I may release it, but you’re the first person I’ve heard of besides myself who has requested this. It would be great if BuddyBoss included this in their own plugins.

    If you want to submit a patch to the developer or publish your own plugin in the WordPress repo then please do. That’s encouraged.

    But do not use the support forums for this plugin to share that, to offer it to people and no one should ever post their emails asking for code again.

    That’s not cool and not at all what this plugin support forum is for. I archived all of the many posting of people asking for that and posting their email address. I’m also closing this topic to further replies.

    If anyone needs support for this plugin then per the forum guidelines please start your own topic.

    https://www.ads-software.com/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too

    You can do so here.

    https://www.ads-software.com/support/plugin/buddypress-learndash/

    But do not post to get a copy of someone else’s plugin. That’s not for this site. If the original poster of this topic wishes to do that then they can submit a plugin in the WordPress repo.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Lesson comments do not show within associated course group?’ is closed to new replies.