Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author hiphopsmurf

    (@hiphopsmurf)

    This is a feature that I am working on for the next release and I hope to have it out soon.

    Hi! I was trying to figure out if I could implement this but I’m too much of a novice to understand how I could. Is there any updates to the addition of this feature? Thanks for your hard work!

    Plugin Author hiphopsmurf

    (@hiphopsmurf)

    Its still something I am working on and hope to have a solution soon.

    helpmeasap

    (@helpmeasap)

    Thanks for publishing this widget! Is there any progress on selecting which folder to upload to?

    Hi All. First of all, this is an awesome plugin. Thank you very much! I am also needing to upload to multiple folders (all subfolders of the folder I specified in the plugin’s settings).

    I’ve managed this by adding the following code in the wp_dropbox.php file around line 95 (note that the first two lines are part of the pre-existing code):

    $wpsdb_up_method = get_option('wpsdb_php_pear');
    
    $wpsdb_path = get_option( 'wpsdb_path' );
    
    	/* User defined Subdirectory and Custom Renaming Attributes */
    	extract(shortcode_atts(array('subdir' => NULL, 'rename' => NULL), $atts, 'simple-wp-dropbox'));
    	if ($subdir != NULL){
    		$wpsdb_path .= $subdir.'/';
    	}
    	/* end user-defined subdirectory, etc. */

    Additionally, because I need the resulting files to have particular names (though not the original file names), I included this code further down around line 276 (again, first two lines are the original, pre-existing code)

    $wpsnew_file_name = explode(".",$file['name']);
    
    $wpstmpFile = $wpsdb_tmp_path.'/'.str_replace("/", '_', $wpsnew_file_name[0]) . "_" . rand(1000,9999) . "_" . date("Y-m-d") . "." . str_replace("/", '_', end($wpsnew_file_name));//$wpsnew_file_name[1]);
    
      	/* Renaming file based on custom user-defined input */
     		if ($rename != NULL)
    			$wpsnew_file_name[0] = $rename;
    			 $wpstmpFile = $wpsdb_tmp_path.'/'.str_replace("/", '_', $wpsnew_file_name[0]) . "." . str_replace("/", '_', end($wpsnew_file_name));//$wpsnew_file_name[1]);
    
    	/*  end renaming */

    Now I can use the shortcode like this:
    [simple-wp-dropbox subdir=”My-Custom-Subdirectory” rename=”my-custom-name”]

    Now I can use different pages on my site to upload to different subfolders or (as is the case) define the subfolder dynamically through a PHP variable.

    Both variables remain optional but adding the second code snippet does short-circuit the default renaming so don’t insert that part without considering that.

    Thank you so much rpyles!! This is exactly what I was looking for. Worked perfect first try.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Link to Multiple Dropbox Folders’ is closed to new replies.