Skip to:
Content
Pages
Categories
Search
Top
Bottom

Groups Posts and Disable Avatars


  • sakarya
    Participant

    @sakarya

    I’ve a web site using wordpress. There are 4 categories and 306 posts. I want to install buddypress and i will create 4 groups. Groups and categories name will be same. And, when i write a post a category, it will show group activity.

    I’ve tried External Group Blogs plugin but it show posts after 30 minutes, i want just in time. Any idea?

    And, How can i show avatars only comments.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    The most straightforward way is to hook a custom function to `comment_post` and `edit_comment`. The function would look something like this (mainly copied-and-pasted from bp-blogs.php, `bp_blogs_record_comment()` ):

    `
    function boone_record_blog_comment_to_group( $comment_id, $is_approved = true ) {

    $action = ‘something’; // here’s where you’ll put together the action, something like ‘[Group member] commented on [blog post]’, with the appropriate links;

    $content = ‘something’; // Get the comment content from the $comment_id passed into the function

    $primary_link = ‘something’; // Get the comment permalink from the $comment_id

    $blog_id = ‘something’; // You’ll have to get the blog id either from $current_blog or from the comment metadata

    groups_record_activity( array(
    ‘action’ => $action,
    ‘content’ => $content,
    ‘type’ => ‘new_blog_comment’,
    ‘item_id’ => $bp->groups->new_group_id,
    ‘secondary_item_id’ => $blog_id
    ) );

    }
    add_action( ‘comment_post’, ‘boone_record_blog_comment_to_group’, 10, 2 );
    add_action( ‘edit_comment’, ‘boone_record_blog_comment_to_group’, 10 );
    `

    You’ll have to do the grunt work of figuring out how best to populate those variables at the beginning of the function, but this is a step in the right direction.


    sakarya
    Participant

    @sakarya

    Thanks @boonebgorges but i dont know php. I don’t know what do i have to do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Groups Posts and Disable Avatars’ is closed to new replies.
Skip to toolbar