Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 551 through 575 (of 2,427 total)
  • In reply to: Activity default tab

    @venutius

    Moderator

    That’s great! It took me a while to figure it out and it would have definitely been a downer if it didn’t work.

    I also worked out how to combine all of the activity types onto one page here https://buddypress.org/support/topic/how-to-combine-activity-tabs-to-one/ it may also be of interest.

    In reply to: Activity default tab

    @venutius

    Moderator

    Ah there was a typo in the cde, I’ve corrected it, could you retry?

    @venutius

    Moderator

    I think what you are asking for is that group activity should not be posted to the activity page.

    group activities for public groups are automatically shown site-wide by default and I can’t see anyway to change this. The only option I could come up with, which is far from ideal is to delete the activity that is set sitewide and add it again with the setting change to hide sitewide:

    add_action( 'bp_activity_add', 'bpex_hide_group_activity' );
    
    function bpex_hide_group_activity( $r, $activity_id ) {
    	
    	if ( $r['component'] == buddypress()->groups->id ) {
    		$group = groups_get_group( $r['item_id'] );
           		if ( isset( $group->status ) && 'public' == $group->status ) {
                         bp_activity_delete( 'id' => $activity_id );
    		     $r['hide_sitewide' => true;
    		     $new_id = bp_activity_add( $r );
                    }
    	}
    }

    It’s not really ideal as any notifications that get sent based on the first activity will result in a not found error when clicked so you will probably want to improve the logic used to filter our specific activities and not all group activities as I’ve done here.

    @venutius

    Moderator

    I’ve recently wrote a pluugin that allows you to devolve authority for each of the BuddyPress components to other roles. So a non admin could manage the extended profile information for all users. It’s called BP Devolved Authority. However if I understand you correctly then this may not be what you are looking for. I’m not aware of any other plugins that allow finer granularity of managing BP Users.

    @venutius

    Moderator

    I’m struggling to replicate your issue. In the BP Legacy template the default is friends only but adding the AUTOCOMPLETE_ALL setting opens this up to all members, this works with or without friends enabled.

    My understanding is that the Nouveau template works differently and displays all anyway, but I can confirm that with friendships turned off you can see the other site members on autocomplete.

    @venutius

    Moderator

    What do you mean?

    @venutius

    Moderator

    Doesn’t look like it but from what I can see this is the only plugin that does this. Maybe you can raise a feature request?

    @venutius

    Moderator

    Think this is what you are looking for: https://wordpress.org/plugins/bp-messages-tool/

    @venutius

    Moderator

    Hi there,

    My suggestion is that you add a new menu item “All” and create a new set of queries for the page then make that page the default landing page for the profile activity page. Here’s my code to do this:

    function bpex_set_member_default_nav() {
     
    		if ( ! bp_is_user_profile() && ! bp_is_user_activity() && ! bp_is_user() ) {
    		    return;
    	         }
    
                    bp_core_new_nav_default(
    		array(
    			'parent_slug'       => buddypress()->activity->id,
    		// other "activity" sub_nav slugs : personal favorites friends groups mentons
    			'subnav_slug'       => 'all-activity',
    			'screen_function'   => 'bp_activity_screen_all_activity'
    		)
    	);
    }
    add_action( 'bp_setup_nav', 'bpex_set_member_default_nav', 20 );
    
    add_action( 'bp_setup_nav', 'bpex_just_me_tab', 50 );
    add_action( 'bp_setup_admin_bar', 'bpex_admin_bar_add', 50 );
    
    function bpex_just_me_tab() {
    	
    	if ( ! bp_is_user_profile() && ! bp_is_user_activity() && ! bp_is_user() ) {
    		return;
    	}
    	
    	global $bp;
    	$user_id = bp_displayed_user_id();
    	
    		bp_core_new_subnav_item( array(
    			'name'            => _x( 'All', 'Profile activity screen sub nav', 'buddypress' ),
    			'slug'            => 'all-activity',
    			'parent_url'      => bp_core_get_user_domain( $user_id ) . 'activity/',
    			'parent_slug'     => 'activity',
    			'screen_function' => 'bp_activity_screen_all_activity',
    			'position'        => 10
    		) );
    
    }
    
    function bpex_admin_bar_add() {
    	
    	global $wp_admin_bar, $bp;
    
    	if ( ! bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) {
    		return false;
    	}
    
    	$user_id = get_current_user_id();
    	
    	if ( ! $user_id || $user_id == 0 || ! is_numeric( $user_id ) ) {
    		return;
    	}
    	
    	// Personal.
    	//$wp_admin_bar->remove_menu( 'my-account-activity-personal', 'my-account-activity' );
    
    	$wp_admin_bar->add_menu( array(
    		'parent'   => 'my-account-activity',
    		'id'       => 'my-account-activity-all-activity',
    		'title'    => 'All',
    		'href'     => bp_core_get_user_domain( $user_id ) . 'activity/all-activity/',
    		'position' => 10
    	) );
    }
    function bp_activity_screen_all_activity() {
    
    	do_action( 'bp_activity_screen_all_activity' );
    
    	bp_core_load_template( apply_filters( 'bp_activity_template_all_activity', 'members/single/home' ) );
    }
    
    function bp_activity_filter_all_activity_scope( $retval = array(), $filter = array() ) {
    
    	// Determine the user_id.
    	if ( ! empty( $filter['user_id'] ) ) {
    		$user_id = $filter['user_id'];
    	} else {
    		$user_id = bp_displayed_user_id()
    			? bp_displayed_user_id()
    			: bp_loggedin_user_id();
    	}
    
    	// Should we show all items regardless of sitewide visibility?
    	$show_hidden = array();
    	if ( ! empty( $user_id ) && $user_id !== bp_loggedin_user_id() ) {
    		$show_hidden = array(
    			'column' => 'hide_sitewide',
    			'value'  => 0
    		);
    	}
    
    	// Determine groups of user.
    	$groups = groups_get_user_groups( $user_id );
    	if ( empty( $groups['groups'] ) ) {
    		$groups = array( 'groups' => 0 );
    	}
    
    	// Determine the favorites.
    	$favs = bp_activity_get_user_favorites( $user_id );
    	if ( empty( $favs ) ) {
    		$favs = array( 0 );
    	}
    
    	// Determine friends of user.
    	$friends = friends_get_friend_user_ids( $user_id );
    	if ( empty( $friends ) ) {
    		$friends = array( 0 );
    	}
    
    	$retval = array(
    		'relation' => 'OR',
    		array(
    			'relation' => 'AND',
    			array(
    				'column'  => 'user_id',
    				'compare' => 'IN',
    				'value'   => (array) $friends
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column' => 'component',
    				'value'  => buddypress()->groups->id
    			),
    			array(
    				'column'  => 'item_id',
    				'compare' => 'IN',
    				'value'   => (array) $groups['groups']
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column' => 'user_id',
    				'value'  => $user_id
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column'  => 'id',
    				'compare' => 'IN',
    				'value'   => (array) $favs
    			)
    		),
    		array(
    			'relation' => 'AND',
    			array(
    				'column'  => 'content',
    				'compare' => 'LIKE',
    
    				// Start search at @ symbol and stop search at closing tag delimiter.
    				'value'   => '@' . bp_activity_get_user_mentionname( $user_id ) . '<'
    			)
    		),
    		// We should only be able to view sitewide activity content for friends.
    		array(
    			'column' => 'hide_sitewide',
    			'value'  => 0
    		),
    
    		// Overrides.
    		'override' => array(
    			'filter'      => array( 'user_id' => 0 ),
    			'show_hidden' => true
    		),
    	);
    	
    
    	return $retval;
    }
    add_filter( 'bp_activity_set_all-activity_scope_args', 'bp_activity_filter_all_activity_scope', 10, 2 );

    Once you have done that you would also want to overload the buddypress/bp-templates/your-template/members/single/activity.php to make sure this new page contains the post update form:

    Change:

    if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'just-me' ) ) )
    	bp_get_template_part( 'activity/post-form' );

    To:

    if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'all-activity' ) ) )
    	bp_get_template_part( 'activity/post-form' );
    

    Note: with this method there is a danger of duplicating activity since a friend posting to a group would show up in the groups search as well as the friends search etc. so you may want to adjust the $retval criteria.

    Also you might want to add a post form for visiting users so they can leave a comment for the user, you could ad this:

    function bpex_load_mention_me() {
    	
    	if ( get_current_user_id() != bp_displayed_user_id() ) {
    		$_GET['r'] = bp_activity_get_user_mentionname( bp_displayed_user_id() );
    		bp_get_template_part( 'activity/post-form' );
    	}
    
    }
    
    add_action( 'bp_before_member_body', 'bpex_load_mention_me' );

    @venutius

    Moderator

    Is this not regarding WordPress post comments on a WordPress custom post type? If so it’s nothing to do with BuddyPress.

    @venutius

    Moderator

    I don’t think this is easy to do, the function that gets the message threads does not have a sortby option to change the order that they are displayed. Maybe you could try the BP Better Messages plugin to see if that improves things?

    @venutius

    Moderator

    Is it Listify that’s adding these links? If so you would need to ask listify about it.

    @venutius

    Moderator

    BP just uses the WordPress Login screen.

    In reply to: Activity default tab

    @venutius

    Moderator

    Hey, it looks like I gave up just a tad early. I think I’ve got it working now:

    function bpex_set_member_default_nav() {
     
        	if ( ! bp_is_user_profile() && ! bp_is_user_activity() && ! bp_is_user() ) {
    		return;
    	}
            
            if ( bp_displayed_user_id() == get_current_user_id() ) {
            
            bp_core_new_nav_default(
                array(
                    'parent_slug'       => buddypress()->activity->id,
    	        // other "activity" sub_nav slugs : personal favorites friends groups mentons
                    'subnav_slug'       => 'friends',
                    'screen_function'   => 'bp_activity_screen_friends'
                )
            );
        }
    }
    add_action( 'bp_setup_nav', 'bpex_set_member_default_nav', 20 );
    
    add_action( 'bp_setup_nav', 'bpex_just_me_tab', 50 );
    add_action( 'bp_setup_admin_bar', 'bpex_admin_bar_add', 50 );
    
    function bpex_just_me_tab() {
    	
    	if ( ! bp_is_user_profile() && ! bp_is_user_activity() && ! bp_is_user() ) {
    		return;
    	}
    	
    	global $bp;
    	$is_own_view = false;
    	$user_id = bp_displayed_user_id();
    	
    	if ( get_current_user_id() == $user_id ) $is_own_view = true;
    	
    
    	if ( $is_own_view ) {
    
    		bp_core_remove_subnav_item( 'activity', 'just_me');
    
    		bp_core_new_subnav_item( array(
    			'name'            => _x( 'Personal', 'Profile activity screen sub nav', 'buddypress' ),
    			'slug'            => 'just-me',
    			'parent_url'      => bp_core_get_user_domain( $user_id ) . 'activity/',
    			'parent_slug'     => 'activity',
    			'screen_function' => 'bp_activity_screen_my_activity',
    			'position'        => 10
    		) );
    	}
    
    }
    
    function bpex_admin_bar_add() {
    	
    	global $wp_admin_bar, $bp;
    
    	if ( ! bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) {
    		return false;
    	}
    
    	$user_id = get_current_user_id();
    	
    	if ( ! $user_id || $user_id == 0 || ! is_numeric( $user_id ) ) {
    		return;
    	}
    	
    	// Personal.
    	$wp_admin_bar->remove_menu( 'my-account-activity-personal', 'my-account-activity' );
    
    	$wp_admin_bar->add_menu( array(
    		'parent'   => 'my-account-activity',
    		'id'       => 'my-account-activity-personal',
    		'title'    => 'Personal',
    		'href'     => bp_core_get_user_domain( $user_id ) . 'activity/180/',
    		'position' => 10
    	) );
    }
    

    Give it a try

    In reply to: Activity default tab

    @venutius

    Moderator

    Can you look in Settings>>BuddyPress>>Options and let me know which BP Theme you are using?

    In reply to: Activity default tab

    @venutius

    Moderator

    Yes I see the problem, it’s pretty significant.

    The personal activity page has the URL site.com/activity

    The mentions page has the url site.com/activity/mentions

    The code redirects url requests for site.com/activity to site.com/activity/mentions, so there’s no possibility of visiting the original site.com/activity page.

    The odd thing is, reading through the code, the personal activity page also has a url of activity/just-me but none of the links point to this and when I manually enter mysite.com/activity/just me I get a weird result, I get a page load error and the url seems to be repeating the just-me part when the above code is loaded. This messes up what /i was hoping could be the solution: to reset the personal activity links to point to activity/just-me.

    I’ve spent quite a bit of time on this and I don’t think it’s possible to do this, I’ve tried several ways and I think it would probably be easier to overload the activity page template and make it display the information you want to see maybe?

    In reply to: Creating groups

    @venutius

    Moderator

    Theme’s don’t interfere with settings pages I’m afraid, You could try switching to the 2017 theme to test. Could you share a screenshot of the BuddyPress Settings page?, you should have four tabs, Components, Options, Pages and Credits. Do you have those?

    In reply to: Creating groups

    @venutius

    Moderator

    Seems to me then that you need to ask WordPress.com support what they have done with it. Reinstalling BuddyPress is unlikely to fix this, it sounds more like that this is not actually true BuddyPress you have running, either that or you’ve not enabled groups but you shared the components page the other day and you had it selected.

    Do you have the pages settings screen at all? There should be pages for Members, Activity and Groups at least.

    In reply to: Creating groups

    @venutius

    Moderator

    Do you mean there’s no page assigned? or you can’t see the setting?

    In reply to: Creating groups

    @venutius

    Moderator

    You can find out which page it is by going to Settings>>BuddyPress>>Pages and see the name of the page assigned as the groups directory

    In reply to: Creating groups

    @venutius

    Moderator

    The groups directory is a page allocated to display all of your groups in the BuddyPress Pages settings, it normally has the url https://yoursite.com/groups.

    It’s really difficult to support wordpress.com users, we have no access so have no idea how BP works on there.

    @venutius

    Moderator

    I’m not really sure what you are asking for. To associate posts to groups there is BP Post Status or Blog Categories for Groups. both of these support categories, Blog Categories for Groups uses the categories to demark which group the post should be associated with.

    @venutius

    Moderator

    Looks like you’ve not configured ssl correctly, Firefox won’t let me visit your site.

    @venutius

    Moderator

    All I can say is that BP is using the following WordPress function to get the url for the group:

    get_home_url( bp_get_root_blog_id() )

    So your WordPress thinks the home url is http

    In reply to: Menu mobile

    @venutius

    Moderator

    messages_get_unread_count() needs a user_id, so something like message_get_unread_count( get_current_user_id() ) should return the unread count for the user.

Viewing 25 replies - 551 through 575 (of 2,427 total)
Skip to toolbar