Make WordPress Core

Changeset 3437


Ignore:
Timestamp:
01/14/2006 10:09:51 PM (19 years ago)
Author:
ryan
Message:

More upload path tweaks. fixes #2271

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-misc.php

    r3422 r3437  
    1818<tr valign="top">
    1919<th scope="row"><?php _e('Store uploads in this folder'); ?>:</th>
    20 <td><input name="fileupload_realpath" type="text" id="fileupload_realpath" class="code" value="<?php echo str_replace(ABSPATH, '', get_settings('fileupload_realpath')); ?>" size="40" />
     20<td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo str_replace(ABSPATH, '', get_settings('upload_path')); ?>" size="40" />
    2121<br />
    2222<?php _e('Default is <code>wp-content/uploads</code>'); ?>
     
    4343<p class="submit">
    4444<input type="hidden" name="action" value="update" />
    45 <input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,fileupload_realpath" />
     45<input type="hidden" name="page_options" value="hack_file,use_linksupdate,uploads_use_yearmonth_folders,upload_path" />
    4646<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
    4747</p>
  • trunk/wp-admin/upgrade-schema.php

    r3413 r3437  
    221221    add_option('rich_editing', 'true');
    222222    add_option('db_version', $wp_db_version);
    223     // 2.1
    224     add_option('uploads_use_yearmonth_folders', 1);
    225     add_option('fileupload_realpath', ABSPATH . 'wp-content/uploads');
    226     add_option('fileupload_url', ''); //if this is empty it will be obtained from fileupload_realpath
    227    
     223    // 2.0.1
     224    if ( ini_get('safe_mode') ) {
     225        // Safe mode screws up mkdir(), so we must use a flat structure.
     226        add_option('uploads_use_yearmonth_folders', 0);
     227        add_option('upload_path', 'wp-content');
     228    } else {
     229        add_option('uploads_use_yearmonth_folders', 1);
     230        add_option('upload_path', 'wp-content/uploads');
     231    }
     232
    228233    // Delete unused options
    229234    $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog');
  • trunk/wp-includes/functions-post.php

    r3433 r3437  
    879879    $siteurl = get_settings('siteurl');
    880880    //prepend ABSPATH to $dir and $siteurl to $url if they're not already there
    881     $dir = ABSPATH . str_replace(ABSPATH, '', trim(get_settings('fileupload_realpath')));
    882     $url = $siteurl . str_replace($siteurl, '', trim(get_settings('fileupload_url')));
     881    $path = str_replace(ABSPATH, '', trim(get_settings('upload_path')));
     882    $dir = ABSPATH . $path;
     883    $url = trailingslashit($siteurl) . $path;
    883884
    884885    if ( $dir == ABSPATH ) { //the option was empty
    885886        $dir = ABSPATH . 'wp-content/uploads';
    886887    }
    887     if ( $url == $siteurl ) { //the option was empty
    888         $url = get_option('siteurl') . '/' . str_replace(ABSPATH, '', $dir);
    889     }
    890888
    891889    if ( defined('UPLOADS') ) {
    892890        $dir = ABSPATH . UPLOADS;
    893         $url =  get_option('siteurl') . '/' . UPLOADS;
    894     }
    895 
    896     if ( get_settings('uploads_yearmonth_folders')) {
     891        $url = trailingslashit($siteurl) . UPLOADS;
     892    }
     893
     894    if ( get_settings('uploads_use_yearmonth_folders')) {
    897895        // Generate the yearly and monthly dirs
    898896        $time = current_time( 'mysql' );
  • trunk/wp-includes/version.php

    r3414 r3437  
    44
    55$wp_version = '2.0.1-alpha';
    6 $wp_db_version = 3414;
     6$wp_db_version = 3437;
    77
    88?>
Note: See TracChangeset for help on using the changeset viewer.