diff options
-rw-r--r-- | wp-admin/includes/mu.php | 25 | ||||
-rw-r--r-- | wp-admin/includes/upload.php | 24 |
2 files changed, 25 insertions, 24 deletions
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php index 8599860..3f23e5f 100644 --- a/wp-admin/includes/mu.php +++ b/wp-admin/includes/mu.php @@ -199,4 +199,29 @@ function get_site_allowed_themes() { return $allowed_themes; } + +function get_space_allowed() { + $spaceAllowed = get_option("blog_upload_space"); + if( $spaceAllowed == false ) + $spaceAllowed = get_site_option("blog_upload_space"); + if(empty($spaceAllowed) || !is_numeric($spaceAllowed)) $spaceAllowed = 50; + + return $spaceAllowed; +} + +function display_space_usage() { + $space = get_space_allowed(); + $percentused = ( intval( get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024 ) / $space ) * 100; + + if( $space > 1000 ) { + $space = number_format( $space / 1024 ); + $space .= "GB"; + } else { + $space .= "MB"; + } + ?> + <strong>Used: <?php echo number_format( $percentused ) ?>% of <?php echo $space ?></strong> + <?php +} + ?> diff --git a/wp-admin/includes/upload.php b/wp-admin/includes/upload.php index 61b042b..9d3fda1 100644 --- a/wp-admin/includes/upload.php +++ b/wp-admin/includes/upload.php @@ -183,30 +183,6 @@ function wp_upload_form() { <?php } -function display_space_usage() { - $space = get_space_allowed(); - $percentused = ( intval( get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024 ) / $space ) * 100; - $buymore = ''; - if( $space < 10000 ) - $buymore = '<a target="_blank" title="opens in new window" href="/wp-admin/paid-upgrades.php">Buy more</a>'; // open in new window in case they have a post open - - /* - if( $space < 10000 ) { - $buymore = '<a target="_blank" title="opens in new window" href="/wp-admin/paid-upgrades.php">Buy more space</a>'; // open in new window in case they have a post open - if( get_option( 'use_upgraded_upload_filetypes' ) != '1' ) { $buymore .= __( " and you can upload " ) . str_replace( " ", ", ", get_site_option( "upgraded_upload_filetypes" ) ) . __(" files");} - } - */ - if( $space > 1000 ) { - $space = number_format( $space / 1024 ); - $space .= "GB"; - } else { - $space .= "MB"; - } - ?> - <strong>Used: <?php echo number_format( $percentused ) ?>% of <?php echo $space . ". $buymore" ?></strong> - <?php -} - function wp_upload_tab_upload() { wp_upload_form(); } |