Support » Plugin: Add Clone Sites for WPMU (batch) » images aren´t cloning

Viewing 4 replies - 1 through 4 (of 4 total)
  • ^ Same here. Images are not copied.

    ^The same thing is happening on my end. I’m not sure this is important but I’m on a sub Directory Network running 3.5

    Septyaman

    (@septyaman)

    I ask sir, Is the mu does work? so iam wan to instaling to my Tips sahabat

    vincegx

    (@vincegx)

    Hi,

    The plugin is not fully compatible with wordpress 3.5 because uploads directory are complety different in wordpress < 3.5 .

    In wordpress < 3.5, wordpress use wp-content/blog.dir/files directory while wordpress > 3.5 use wp-content/blog.dir/files

    In the case of wordpress MU, wordpress separate blog folder into wp-content/uploads/sites

    So i replace some hook to have FULLY compatible with wordpress 3.5 and older version

    Just Edit magic-add-cloned-sites.php and changes :

    1/ line 196

    Change line

    $fileupload_url = $full_url . "/files";

    TO

    /// Hook - Test if wordpress version is < 3.5  -- blog.dir upload different - VinceGx 
    
    if ( get_bloginfo('version') >= 3.5 ):
    	$fileupload_url = $full_url . "/";
    elseif ( get_bloginfo('version') < 3.5 ):
    	 $fileupload_url = $full_url . "/files";
    endif;

    2/ line 254 / 255

    Change line

    $dir_to_copy = ABSPATH . 'wp-content/blogs.dir/' . $template_id . '/files';
    $dir_to_copy_into = ABSPATH .'wp-content/blogs.dir/' . $new_blog_id . '/files';

    TO

    /// Hook - Test if wordpress version is < 3.5  -- blog.dir upload different - VinceGx 
    
    if ( get_bloginfo('version') >= 3.5 ):
    			$dir_to_copy = ABSPATH . 'wp-content/uploads/sites/' . $template_id;
    			$dir_to_copy_into = ABSPATH .'wp-content/uploads/sites/' . $new_blog_id;
    elseif ( get_bloginfo('version') < 3.5 ):
    		     $dir_to_copy = ABSPATH . 'wp-content/blogs.dir/' . $template_id . '/files';
    		     $dir_to_copy_into = ABSPATH .'wp-content/blogs.dir/' . $new_blog_id . '/files';
    endif;

    1/ line 205

    Change line

    update_blog_option ($new_blog_id, 'upload_path', 'wp-content/blogs.dir/' . $new_blog_id . '/files');

    TO

    /// Hook - Test if wordpress version is < 3.5  -- blog.dir upload different - VinceGx 
    
    if ( get_bloginfo('version') < 3.5 ):
    		     update_blog_option ($new_blog_id, 'upload_path', 'wp-content/blogs.dir/' . $new_blog_id . '/files');
    endif;

    That’s it!

    And normally when you copy any blog , folder are created into wp-content/uploads/sites/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘images aren´t cloning’ is closed to new replies.