Changeset 1413
- Timestamp:
- 08/05/08 15:51:06 (4 months ago)
- Files:
-
- trunk/wp-admin/includes/mu.php (modified) (4 diffs)
- trunk/wp-config-sample.php (modified) (1 diff)
- trunk/wp-content/blogs.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (1 diff)
- trunk/wp-includes/wpmu-functions.php (modified) (2 diffs)
- trunk/wp-settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/includes/mu.php
r1388 r1413 5 5 6 6 $space_allowed = 1048576 * get_space_allowed(); 7 $space_used = get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ));7 $space_used = get_dirsize( BLOGUPLOADDIR ); 8 8 $space_left = $space_allowed - $space_used; 9 9 $file_size = filesize( $file['tmp_name'] ); … … 249 249 function display_space_usage() { 250 250 $space = get_space_allowed(); 251 $used = get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ))/1024/1024;251 $used = get_dirsize( BLOGUPLOADDIR )/1024/1024; 252 252 253 253 if ($used > $space) $percentused = '100'; … … 268 268 function dashboard_quota() { 269 269 $quota = get_space_allowed(); 270 $used = get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ))/1024/1024;270 $used = get_dirsize( BLOGUPLOADDIR )/1024/1024; 271 271 272 272 if ($used > $quota) $percentused = '100'; … … 336 336 $spaceAllowed = get_space_allowed(); 337 337 338 $dirName = trailingslashit( constant( "ABSPATH" ) . constant( "UPLOADS" ));338 $dirName = trailingslashit( BLOGUPLOADDIR ); 339 339 if (!(is_dir($dirName) && is_readable($dirName))) 340 340 return; trunk/wp-config-sample.php
r1411 r1413 37 37 //define( 'SUNRISE', 'on' ); 38 38 39 // uncomment to move wp-content/blogs.dir elsewhere, else WP_CONTENT_DIR/blogs.dir is used. 40 // define( "UPLOADBLOGSDIR", "/nfs/fileserver1" ); 39 // uncomment to move wp-content/blogs.dir to another relative path 40 // remember to change WP_CONTENT too. 41 // define( "UPLOADBLOGSDIR", "fileserver" ); 41 42 42 43 // Uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled) trunk/wp-content/blogs.php
r1408 r1413 66 66 67 67 68 $file = constant( 'ABSPATH' ) . constant( 'UPLOADS' ). str_replace( '..', '', $_GET[ 'file' ] );68 $file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] ); 69 69 if ( !is_file( $file ) ) { 70 70 status_header( 404 ); trunk/wp-includes/functions.php
r1356 r1413 1488 1488 $url = trailingslashit( $siteurl ) . UPLOADS; 1489 1489 } 1490 1491 if( defined( 'BLOGUPLOADDIR' ) ) 1492 $dir = BLOGUPLOADDIR; 1490 1493 1491 1494 $bdir = $dir; trunk/wp-includes/wpmu-functions.php
r1412 r1413 1565 1565 if(empty($spaceAllowed) || !is_numeric($spaceAllowed)) $spaceAllowed = 10; 1566 1566 1567 $dirName = constant( "ABSPATH" ) . constant( "UPLOADS" );1567 $dirName = BLOGUPLOADDIR; 1568 1568 $size = get_dirsize($dirName) / 1024 / 1024; 1569 1569 … … 1612 1612 return 0; 1613 1613 $spaceAllowed = 1024 * 1024 * get_space_allowed(); 1614 $dirName = constant( "ABSPATH" ) . constant( "UPLOADS" );1614 $dirName = BLOGUPLOADDIR; 1615 1615 $dirsize = get_dirsize($dirName) ; 1616 1616 if( $size > $spaceAllowed - $dirsize ) { trunk/wp-settings.php
r1412 r1413 237 237 wp_cache_init(); // need to init cache again after blog_id is set 238 238 239 if( !defined( "UPLOADS" ) ) { 240 if( defined( "UPLOADBLOGSDIR" ) ) { 241 define( "UPLOADS", UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); 242 } else { 243 define( "UPLOADS", WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); 244 } 245 } 239 if( !defined( "UPLOADBLOGSDIR" ) ) 240 define( "UPLOADBLOGSDIR", 'wp-content/blogs.dir' ); 241 242 if( !defined( "UPLOADS" ) ) 243 define( "UPLOADS", UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); 244 245 if( !defined( "BLOGUPLOADDIR" ) ) 246 define( "BLOGUPLOADDIR", WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/" ); 246 247 247 248 require (ABSPATH . WPINC . '/plugin.php');
