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: 25365

    Hi Jaume,
    I am glad it did 🙂

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

    You are most welcome John 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25365
    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: 25365
    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: 25365

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

  • Keymaster
    (BuddyDev Team)
    Posts: 25365
    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: 25365
    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: 25365

    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

  • Keymaster
    (BuddyDev Team)
    Posts: 25365

    Hi Hans,
    I will be taking over it in next 2 week. Actually, It can be quiet useful for our own forum and I wanted to add some features here. So I think your topic is a good start for that.

    Let us keep it open and I will keep you updated.

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

    Hi Dandy,
    Thank you.

    1. I am completely in favor of this. I am not sure how will we allow users to mark a media as featured though. using buttons? on Edit Gallery page? or on Media List page?

    2. It is easily doable. Here are the steps(but dependent on your provider)

    a). Get the final drawing from the user. Convert it to png and save it to WordPress media library. Once in the library, Mark the media as MediaPress media(I will provide code for the last step). If the drawing tools support this kind of export using js(I used fabricjs in past and It supported this), It can be accomplished.

    Regards
    Brajesh