This topic has 14 replies, 3 voices, and was last updated 8 years by Andrei.

  • Author
  • #111304
     directnet42u
    Participant

    Hi There,

    I had noticed an older post on here with this same question, but I can’t seem to find it. I was wondering how we can update our Activity Stream page to only show updates by default (without the option to filter through new members, comments, friendships, etc). Apparently there is a PHP code that can be added to do this, but at the moment I’m unable to track it down again. I hope someone can help!

    Thank you for your time.

    #111585
     Laura
    Moderator

    Hello, try adding this to functions.php of child theme

    COPY CODE
    
    // Remove (hide) various activities from streams.
    function my_hidden_activities($a, $activities) {
    //if admin we want to know
    //if (is_site_admin())
    //	return $activities;
    
    $nothanks = array(“created_group”, “joined_group”, “new_member”, “friendship_created”, “activity_liked”);
    
    foreach ($activities->activities as $key => $activity) {
    if (in_array($activity->type, $nothanks, true)) {
    unset($activities->activities[$key]);
    $activities->activity_count = $activities->activity_count-1;
    $activities->total_activity_count = $activities->total_activity_count-1;
    $activities->pag_num = $activities->pag_num -1;
    }
    }
    
    // Renumber the array keys to account for missing items.
    $activities_new = array_values( $activities->activities );
    $activities->activities = $activities_new;
    
    return $activities;
    }
    add_action(‘bp_has_activities’, ‘my_hidden_activities’, 10, 2 );
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #111646
     directnet42u
    Participant

    Unfortunately that code did not work for us. We’re wanting the activity page to only display updates that people post directly to that page. We do not want it to show new memberships, friendships, cover photos, etc. Hopefully that makes sense, please pass along any questions if you need me to clarify.

    #111800
     Laura
    Moderator

    Hello, try the following
    copy this file: “/wp-content/themes/kleo/buddypress/activity/activity-loop.php” to your child theme: “/wp-content/themes/kleo-child/buddypress/activity/activity-loop.php” and you will have to replace the 16’th line with the following:

    COPY CODE
    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&action=activity_update' ) ) : ?>
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #112011
     directnet42u
    Participant
    This reply has been set as private.
    #112440
     Laura
    Moderator

    Hello, you could try to filter that by editing the activity loop, i can do that for you if you share ftp credentials 🙂
    You want to show all but friendships and new members right? 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #112570
     directnet42u
    Participant
    This reply has been set as private.
    #112991
     Laura
    Moderator

    Hello, fixed, you have the directory name “Buddypress” instead of “buddypress”, simple but important 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #113134
     directnet42u
    Participant

    It looks great, thank you for resolving that issue for us!

    #113319
     directnet42u
    Participant

    Oops, we just looked at the page again and it looks like it’s still showing new memberships in the latest updates. Do you know why that might be?

    https://www.vegantravel.com/activity/

    #113907
     Laura
    Moderator

    Hello, check if the code is still there, maybe it shows older entries
    Let me know 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #113910
     directnet42u
    Participant

    The code is still there. What seems to happen is that the page will load without those other categories, but then if you stay on the page for a few seconds it shows the “Load Newest” section (see attached image) at the top. Then when you click on that it displays the new members and friendships. Do you know what might be causing this?

    Attachments:
    You must be logged in to view attached files.
    #114503
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #114950
     directnet42u
    Participant

    Thank you, we’re hoping someone can assist us with this issue!

    #115961
     Andrei
    Moderator

    Hi,

    We’ve provided this code as a starting point some time ago, if the code isn’t working anymore then I’ll have to recommend you to hire a developer in order to implement such custom functionality.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 15 posts - 1 through 15 (of 15 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?