How can I make this code show all members for logged out users
/** * Set default activity directory tab for BuddyPress */ function buddydev_set_default_activity_directory_tab() { // If user is not logged in or // If the scope is already set, do not do anything ok. if ( ! is_user_logged_in() || isset( $_COOKIE['bp-activity-scope'] ) ) { return ; } // additional check for activity dir if ( ! bp_is_activity_directory() ) { return ; } $tab = 'following'; // 'all', 'friends', 'groups', 'mentions' // Set scope to our needed tab, // In this case, I am setting to the 'friends' tab setcookie( 'bp-activity-scope', $tab,null, '/' ); $_COOKIE['bp-activity-scope'] = $tab; } add_action( 'bp_template_redirect', 'buddydev_set_default_activity_directory_tab' );
I will now be able to apply the two codes in my bp-custom.php file, one code for logged in users(this will show activities of people i’m following) while the other code is for logged out users (this will show activities of all members).
Thank you
Hello Brajesh,
I think I have a better solution, how can i enable the (Facebook Like User Activity Stream for BuddyPress plugin) to work on the site wide activities page for logged in users since this will also pick activities of users i’m following.
I have version 1.1.7 installed
Thank you for your patience
Hi Tosin,
At the moment, The FB Like User Activity Stream does not work on sitewide activity. Please allow me a week to release an update for the FB Like Activity Stream to support sitewide stream.Regards
BrajeshThank you Brajesh I will be looking forward to the update. But please note that the default activity should be set to (my wall or stream tab) for the logged in users and not (all members tab) while the default activity for logged out users should be set to (all members tab)
Thank you very much, have a great day.
Hi Velli,
You can change the code to this
// additional check for activity dir if ( ! bp_is_activity_directory() ) { return ; }
to
// additional check for activity dir if ( ! bp_is_activity_directory() || friends_get_friend_count_for_user( get_current_user_id() ) < 1 ) { return ; }
I am assuming you were using it for friends and not followers.
PS:- For anyone else looking at this topic, The Facebook Like Activity Stream support sitewide activity now.
Regards
Brajesh
You must be logged in to reply to this topic.