Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Showing user sites on main site #4804

    Hi Quincy,
    You are welcome.

    The user meta approach will need me to add a few actions first. Also, I thought about it and since you only need it on the members listing page, The benefits may not outweigh the effor needed for synchronizing. So, Here is a better thing to do. Let us put it in our bp-custom.php

    
    
    function bd_cache_networks( $bp_user_query ) {
    
    	$user_ids = $bp_user_query->user_ids;//should be array of ids
    	$networks = array();//multi dimensional array of [user_id] =>[blog_id1, blog_id2]
    	if ( ! empty( $user_ids ) ) {
    		global $wpdb;
    		$table = mnetwork_get_table_name();;
    		$list = '(' . join( ',', $user_ids ) .')';
    
    		$user_networks = $wpdb->get_results( "SELECT user_id, network_id FRM {$table} WHERE user_id IN {$list}" );
    
    		foreach ( $user_networks as $unetwork ) {
    
    			if ( !isset( $networks[ $unetwork->user_id ] ) ) {
    				$networks[ $unetwork->user_id ] = array();//
    			}
    			//push the blog to user blogs list
    			$networks[$unetwork->user_id][] = $unetwork->network_id;
    		}
    
    	}
    
    	//store the current results
    	//not the best way, but will work fine
    	buddypress()->bdbp_networks_list = $networks;
    }
    add_action( 'bp_user_query_populate_extras', 'bd_cache_networks' )
    /**
     * Get an array of blog ids to which this user belongs to
     *
     * @return boolean|mixed
     */
    //now in members loop
    function bd_get_user_blog_ids() {
    	if ( isset( buddypress()->bdbp_networks_list ) ) {
    		return buddypress()->bdbp_networks_list[bp_get_member_user_id()];
    	}
    	return false;
    }
    
    

    now, calling bd_get_user_blog_ids() in the member loop will give you all the blog ids of which the user is a member.

    Hope that helps.

    • This reply was modified 9 years, 9 months ago by Brajesh Singh. Reason: updated code with the missing table name
  • Keymaster
    (BuddyDev Team)
    Posts: 25394

    Hi leigh,
    Not Yet, but I will do today/tomorrow.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394

    Hi Vineeta,
    In that case please think about this:-
    1. How do you want to collect user location data?
    2. Do you want to store the location as lat/lang pair or as spatial data type. MySQL dos have support for basic gis functionality/spatial data types, so you should create a new table and store user/point combination there. The Point is spatial data type and you will be storing WKT here.

    3. If you have used the data type point, you may use spatial functions ST_DWithin/ST_Distance to accomplish your task.
    https://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html

    If you are not comfortable with GIS data, you may store the user location as latitude/longitude pair. This tutorial (It is old when mysql had no support for spatial data types), by Google should help

    https://developers.google.com/maps/articles/phpsqlsearch_v3

    All the best
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: bp-simple-front-end-post conflict membermouse #4800

    Hi Roberto,
    I am sorry for the convenience. Thank you for the screenshot that helped me to understand.

    The problem lies on part oe MemberMouse plugin and not us. We are not doing anything special Just calling

    
    wp_editor( $content, 'bp_simple_post_text', array( 'media_buttons'=> $this->allow_upload, 'quicktags'=> false)) ;
    

    Please see this

    https://github.com/sbrajesh/bp-simple-front-end-post/blob/master/form.php#L27

    The plugin should check if it should be enabled on the front end editor for the given user capability.

    Please ask their support and let them know it, They should be able to fix it.

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Notification Problem #4799

    Hi Marco,
    I am sorry for the trouble.

    BP Youtube, Flickr are deprecated plugins. Sorry about that. It should be mentioned on those plugin pages.

    We will be looking the Community Activity on profile, Lock Unlock activity and Clear notification and will update you.

    Now coming to your next questions:-

    1. Forum mentions, Yes, It is doabale but will need you to filter on the notification message generation. Please see the function bp_activity_format_notifications for more details and available filters.

    2. There are multiple ways to do it. I will suggest filtering
    ‘bp_after_has_Activities_parse_args’

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: [Resolved] Widget Format #4798

    Hi Mike,Please wait. Let me see if we can do it without any modification using pure css and some filters. I will update tonight if we can do that or not.

    PS: Thank you Ravi for the support here.

    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Showing user sites on main site #4797

    Hi Quincy,
    Thank you for posting.

    You can get all the blogs of which the user is member by using this

    
    
    $blog_ids = BPNetworkUsers::get_networks( $user_id)
    
    

    It is not the most efficient method and It will be better to store the data in the user meta or do a bulk query instead of the above for individual users.

    Hope that helps.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394

    Hi,
    Thank you for asking.

    Currently, if you post from the Group’s activity page, The Media will be available in the Groups wall galleries.

    If you try to post from sitewide activity page(by selecting group from the dropdown). The media appears in the activity but goes to user’s wall.

    Is that happening on your installation?

    PS: Please do not use Test in username, It does not look good. I will appreciate if you can atleast update your display name.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Activity Form doesn't attach MediaPress media #4778

    I did see that. Can you please use the user “demo” and password “demo” on the demo site and see if it works. recently we have moved from the digital ocean to linode and some configs have changed causing trouble. I will be updating the demo in next few days.

    Please try with the user demo and let me know if it works or not?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25394
    Brajesh Singh on in reply to: Activity Form doesn't attach MediaPress media #4776

    The function mpp_mejs_activate is fine. It is a function declared in globa scope. I just checked the code to make sure that it is fine.