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: 25273
    Brajesh Singh on in reply to: Migrating from BuddyPress Album to MediaPress #5242

    Hi Lavish,
    My apologies in advance.
    We have no plans to create any migrator for BP Album or BuddyPress media(RT media). They are not worth the effort.

    These plugins have very convoluted schema/code making it difficult to understand their data schema.

    If someone is interested, we will help on the MediaPress side of the things(How to add media to MediaPress) but that’s all. you will need to find a developer to do the rest.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25273
    Brajesh Singh on in reply to: [Resolved] Extended Code for Private Site #5237

    You are most welcome Hans 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25273

    Hi Jaume,
    I am glad it did 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25273
    Brajesh Singh on in reply to: [Resolved] Merging subnav tabs #5231

    You are most welcome John 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25273
    Brajesh Singh on in reply to: [Resolved] Merging subnav tabs #5228

    Hi John,
    Thank you for the details.

    I have slightly modified your code

    
    function change_default_settings_tab() {
    
    	$bp = buddypress();
    
    	bp_core_new_nav_default( array(
    		'parent_slug'       => $bp->settings->slug,
    		'subnav_slug'       => 'accountdetails',
    		'screen_function'   => 'your_function_that_loads_templates' //change it
    	)
    	);
    
    }
    add_action( 'bp_settings_setup_nav', 'change_default_settings_tab', 5 );
    
    

    Note the ‘screen_function’ key. Please make sure to pass your screen function that loads the template( which you used while registering the nav item). Also, subnav slug only needs the slug not the complete parent/child.

    Please let me know if it worked for you or not?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25273
    Brajesh Singh on in reply to: [Resolved] Merging subnav tabs #5226

    Hi John,
    Can you please post the complete code? Use bp_get_template_part instead. bp_core_load_template calls exit so it only loads the first template.

    Here is a way to do it

    1. Use bp_core_load_template to load our custom file
    2. In the custom file use bp_get_template_part to load both the files.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25273

    Hi Simon,
    No problem.
    I will post it as a small plugin on github today/tomorrow.

  • Keymaster
    (BuddyDev Team)
    Posts: 25273
    Brajesh Singh on in reply to: [Resolved] Extended Code for Private Site #5224

    Hi Hans,
    Thank you for posting.

    To be honest, I will not recommend in going to that direction and I will explain why.

    1. If you want to prevent images from being visible to anyone, we can either move images to outside the webroot or use htaccess to disable the webserver rendering it.

    2. Once we do the above step, we will need php to read the image file depending on who is accessing them(using some sort of route) and that is highly resource intensive and inefficient.

    Even Facebook does not do it. Yes, you can access private media directly if you have access to the correct url.

    I will rather recommend file name obfuscation(there are many plugins) and using seo plugins to avoid indexing of media files.

  • Keymaster
    (BuddyDev Team)
    Posts: 25273
    Brajesh Singh on in reply to: Two suggestions of MediaPress #5223

    Hi Dandy,
    Thank you. We will have the Featured widget in a week available. I will find some time this weekend and look at the integration of the above tool. As far as I see, It should be doable.

  • Keymaster
    (BuddyDev Team)
    Posts: 25273

    Hi Jaume,

    Welcome back.

    It’s a good question. Since there does not exist any functions, I wrote one for you

    
    
    /**
     * @param int $field_id Field ID
     *
     * @return array of options
     */
    function buddydev_xprofile_get_field_options( $field_id ) {
    
    	$field = xprofile_get_field( $field_id );
    
    	$options = $field->get_children();
    
    	return wp_list_pluck( $options, 'name' );
    
    }
    
    

    You can put this function in your bp-custom.php or functions.php and then call it like this

    
    
    print_r( buddydev_xprofile_get_field_options ( 17 ) );
    
    

    17 is field id. Change it with your own field. In case of non multi field, It will give you an empty array.

    Hope that helps.
    Regards
    Brajesh