BuddyDev

Search

Buddypress activity comment feature request

  • Participant
    Level: Enlightened
    Posts: 39
    Aravind Nambiar on #5264

    Hi brajesh im back with another feature request 🙂

    Right now a single activity will show 10 or more comments depending on the amount of comments which is not a good user experience.
    Is it possible to show only two comments at first and then show a link to “view all comments” just like how facebook does.
    Right now latest activity updates are lost due to the long comments list.
    I hope you understood what im trying to say. Hope you consider this request

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #5275

    Hi Arvind,
    It is theme dependent. Please look for this

    
    bp_legacy_theme_hide_comments
    

    in your buddypress.js and you will see the default is set to 5. You can update it there.

    Hope that helps.

  • Participant
    Level: Enlightened
    Posts: 39
    Aravind Nambiar on #5281

    Thank you so much Brajesh! 🙂

    And i am sharing a code for hiding and showing comments which i found in the buddypress support page:
    so that after viewing the 100’s of comments you can hide it! 🙂

    add_action( ‘wp_footer’, ‘add_comment_hide_show’ );
    function add_comment_hide_show() {
    ?>
    <style>
    .single-group .activity-comments ul{display: none;}
    </style>
    <script type=”text/javascript”>
    jQuery(function($) {
    setInterval(function() {
    $(‘.activity-meta’).each(function() {
    if( !$(this).find(‘.show-comments’).length ){
    var html = ‘Show/Hide Comments‘;
    $(this).find(‘.button.acomment-reply’).after(html);
    }
    });

    }, 500);

    $(‘body’).on(‘click’, ‘.show-comments’, function(e) {
    e.preventDefault();
    var obj = $(this).closest(‘.activity-content’).next(‘.activity-comments’).find(‘ul’);
    obj.slideToggle();
    return false;
    });

    });
    </script>
    <?php
    }

  • Participant
    Level: Enlightened
    Posts: 39
    Aravind Nambiar on #5282

    If you remember my previous post of how to tweak activity meta , can you please share that code so that i can put all the secondary buttons inside a drop down box ?

  • Participant
    Level: Enlightened
    Posts: 39
    Aravind Nambiar on #5284
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #5290

    Hi Arvind,
    Please take a look at your theme’s activity/entry.php . All the button comes from the div ‘activity-meta’

    So, except the 2 buttons, put everything in your dropdown and then it should work.

  • Participant
    Level: Enlightened
    Posts: 39
    Aravind Nambiar on #5298

    Thanks Brajesh but i dont see a delete button inside the entry.php , the only thing i ca see is this
    <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>

    and the edit button comes from a different plugin so that is also not visible in entry.php

    I will find another solution 🙂 but i need your help

    I want to create buttons like messages , notification , profile and when user clicks on message or notification button it redirects them to their corresponding pages. Like if the user click message button it takes him to his message page .

You must be logged in to reply to this topic.

This topic is: not resolved