-
Author
-
March 17, 2016 at 18:03 #111304
directnet42u
ParticipantHi 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.
March 18, 2016 at 18:04 #111585Laura
ModeratorHello, 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 solutionMarch 18, 2016 at 19:57 #111646directnet42u
ParticipantUnfortunately 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.
March 19, 2016 at 20:04 #111800Laura
ModeratorHello, 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 solutionMarch 21, 2016 at 17:48 #112011directnet42u
ParticipantI tried doing as you suggested, but it looks like the activity stream is still showing the new members and friendships: https://www.vegantravel.com/activity/
Is there a step that we might’ve missed?
March 23, 2016 at 20:41 #112440Laura
ModeratorHello, 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 solutionMarch 24, 2016 at 17:33 #112570directnet42u
ParticipantThat would be great! We actually want the activity stream to show ONLYÂ updates that people post to the page itself, which would include any text or media that they upload. This means that we don’t want the page to display new members, friendships, album uploads, groups, profile photo updates or any of those other types of updates.
Please let me know if you need any other details or clarification. Here is the FTP info:
http://ftp.vegantravel.com
7thqueen@vegantravel.com
zd,~)o*!eDEGMarch 27, 2016 at 23:09 #112991Laura
ModeratorHello, 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 solutionMarch 28, 2016 at 18:21 #113134directnet42u
ParticipantIt looks great, thank you for resolving that issue for us!
March 29, 2016 at 18:09 #113319directnet42u
ParticipantOops, 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?
March 31, 2016 at 19:26 #113907Laura
ModeratorHello, 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 solutionMarch 31, 2016 at 19:51 #113910directnet42u
ParticipantThe 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?
April 4, 2016 at 20:22 #114503Laura
ModeratorHello, 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 solutionApril 6, 2016 at 22:51 #114950directnet42u
ParticipantThank you, we’re hoping someone can assist us with this issue!
April 12, 2016 at 15:46 #115961Andrei
ModeratorHi,
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 -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.