WordPress.org

WordPress MU

Changeset 1071


Ignore:
Timestamp:
10/15/07 11:31:33 (7 years ago)
Author:
donncha
Message:

Move custom upload functions into mu.php
Added get_space_allowed()

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/mu.php

    r1069 r1071  
    200200    return $allowed_themes; 
    201201} 
     202 
     203function get_space_allowed() { 
     204    $spaceAllowed = get_option("blog_upload_space"); 
     205    if( $spaceAllowed == false )  
     206        $spaceAllowed = get_site_option("blog_upload_space"); 
     207    if(empty($spaceAllowed) || !is_numeric($spaceAllowed)) $spaceAllowed = 50; 
     208 
     209    return $spaceAllowed; 
     210} 
     211 
     212function display_space_usage() { 
     213        $space = get_space_allowed(); 
     214        $percentused = ( intval( get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024 ) / $space ) * 100; 
     215 
     216        if( $space > 1000 ) { 
     217            $space = number_format( $space / 1024 ); 
     218            $space .= "GB"; 
     219        } else { 
     220            $space .= "MB"; 
     221        } 
     222    ?> 
     223    <strong>Used: <?php echo number_format( $percentused ) ?>% of <?php echo $space ?></strong> 
     224    <?php 
     225} 
     226 
    202227?> 
  • trunk/wp-admin/includes/upload.php

    r1069 r1071  
    184184} 
    185185 
    186 function display_space_usage() { 
    187         $space = get_space_allowed(); 
    188         $percentused = ( intval( get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024 ) / $space ) * 100; 
    189         $buymore = ''; 
    190         if( $space < 10000 ) 
    191             $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 
    192  
    193         /* 
    194         if( $space < 10000 )  { 
    195             $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 
    196             if( get_option( 'use_upgraded_upload_filetypes' ) != '1' ) { $buymore .= __( " and you can upload " ) . str_replace( " ", ", ", get_site_option( "upgraded_upload_filetypes" ) ) . __(" files");} 
    197         } 
    198         */ 
    199         if( $space > 1000 ) { 
    200             $space = number_format( $space / 1024 ); 
    201             $space .= "GB"; 
    202         } else { 
    203             $space .= "MB"; 
    204         } 
    205     ?> 
    206     <strong>Used: <?php echo number_format( $percentused ) ?>% of <?php echo $space . ". $buymore" ?></strong> 
    207     <?php 
    208 } 
    209  
    210186function wp_upload_tab_upload() { 
    211187    wp_upload_form(); 
Note: See TracChangeset for help on using the changeset viewer.