﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
19030,Sharding BLOGUPLOADDIR,unsalkorkmaz,,"I am trying to sharding BLOGUPLOADDIR but couldnt success atm. This is default one:


{{{
define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . ""/blogs.dir/{$wpdb->blogid}/files/"" );
}}}


I am trying to set it:


{{{
if($wpdb->blogid<10){ 
    $bloggroup = 'global';
}else{
    $bloggroup = 'bloggroup'.floor($wpdb->blogid/2000+1); // 1999->1, 2000->2
}
define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . ""/blogs.dir/{$bloggroup}/{$wpdb->blogid}/files/"" );
}}}


So every 2000 blog, bloggroup will change.. I tried upload_dir filter but i need to define before it. I tried sunrise.php but $wpdb->blogid is not defined in there it seems. Whats proper way of this?

btw i think this need change:

{{{
$dir = apply_filters( 'wpmu_delete_blog_upload_dir', WP_CONTENT_DIR . ""/blogs.dir/{$blog_id}/files/"", $blog_id );
}}}

it wont delete uploads if i define BLOGUPLOADDIR right?",enhancement,closed,normal,,Multisite,3.0,normal,invalid,,
