• Resolved inzerat

    (@inzerat)


    It must upload a file into folders according to the days and months of the reasons when there is too much congestion happen and slowness to ftp.

    sorry for my english ,-)

Viewing 1 replies (of 1 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello inzerat,

    There is a set of defines in the main plugin file (bpfb_the_edge.php) that determine the files location: BPFB_TEMP_IMAGE_DIR, BPFB_TEMP_IMAGE_URL, BPFB_BASE_IMAGE_DIR and BPFB_BASE_IMAGE_URL. You may want to try changing the values there to suit your needs.

    For example, if you would like to have path like that /media/uploads/album/{logged in user id}

    you would use script like that

    function my_paths_init () {
    	global $bp;
    	$user_id = $bp->loggedin_user->id;
    	$wp_upload_dir = wp_upload_dir();
    	$dir = '/album';
    	define('BPFB_TEMP_IMAGE_DIR', $wp_upload_dir['basedir'] . $dir . '/' . $user_id . '/', true);
    	define('BPFB_TEMP_IMAGE_URL', $wp_upload_dir['baseurl'] . $dir . '/' . $user_id . '/', true);
    	define('BPFB_BASE_IMAGE_DIR', $wp_upload_dir['basedir'] . $dir . '/' . $user_id . '/', true);
    	define('BPFB_BASE_IMAGE_URL', $wp_upload_dir['baseurl'] . $dir . '/' . $user_id . '/', true);
    	BpfbInstaller::check();
    }
    add_action('bp_init', 'my_paths_init');

    In your case you would need to change $user_id to variable with date. You should be able to construct new path with use of getdate() function http://php.net/manual/en/function.getdate.php (look on the example code in comments)

    kind regards,
    Kasia

Viewing 1 replies (of 1 total)

The topic ‘Activity plus upload media to different folder’ is closed to new replies.