diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index ea3cfa46f1..68f7ed10dc 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1789,7 +1789,7 @@ function wp_upload_dir() { @ chmod( $pathym, 0774 ); } - $uploads = array('path' => $pathym, 'url' => get_bloginfo('home') . "/$dir/$y/$m", 'error' => false); + $uploads = array('path' => $pathym, 'url' => get_option('siteurl') . "/$dir/$y/$m", 'error' => false); return apply_filters('upload_dir', $uploads); } diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 545b350555..4571ea533d 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -172,12 +172,9 @@ if ('publish' != $post_status || 0 == $post_ID) { -
+ -
-

-
-
+

diff --git a/wp-admin/image-uploading.php b/wp-admin/image-uploading.php index 5e8ff0b236..47c79ad21f 100644 --- a/wp-admin/image-uploading.php +++ b/wp-admin/image-uploading.php @@ -1,4 +1,5 @@ 4 / 3 ) + return array(128, (int) ($height / $width * 128)); + else + return array((int) ($width / $height * 96), 96); +} switch($action) { case 'save': @@ -113,16 +124,7 @@ $id = wp_attach_object($object, $post); $imagesize = getimagesize($file); $imagedata['width'] = $imagesize['0']; $imagedata['height'] = $imagesize['1']; -if ( $imagedata['height'] < 96 && $imagedata['width'] < 128 ) { - $uheight = $imagedata['height']; - $uwidth = $imagedata['width']; -} elseif ( $imagedata['width'] / $imagedata['height'] > 4 / 3 ) { - $uwidth = 128; - $uheight = $imagedata['height'] / $imagedata['width'] * $uwidth; -} else { - $uheight = 96; - $uwidth = $imagedata['width'] / $imagedata['height'] * $uheight; -} +list($uwidth, $uheight) = get_udims($imagedata['width'], $imagedata['height']); $imagedata['hwstring_small'] = "height='$uheight' width='$uwidth'"; $imagedata['file'] = $file; @@ -133,73 +135,26 @@ header("Location: ".basename(__FILE__)."?post=$post&all=$all&action=view&last=tr die; case 'upload': -?> - - - - - - - -
-
-
-
- - - -
- - -
-
- - -get_var("SELECT count(ID) FROM $wpdb->posts WHERE post_status = 'object' AND left(post_type, 5) = 'image' $and_post") - 5; + $start = $wpdb->get_var("SELECT count(ID) FROM $wpdb->posts WHERE post_status = 'object' AND left(post_type, 5) = 'image' $and_post") - $num; else $start = (int) $start; @@ -209,124 +164,213 @@ if ( $start < 0 ) if ( '' == $sort ) $sort = "ID"; -$images = $wpdb->get_results("SELECT ID, post_date, post_title, guid FROM $wpdb->posts WHERE post_status = 'object' AND left(post_type, 5) = 'image' $and_post ORDER BY $sort LIMIT $start, 10", ARRAY_A); +$images = $wpdb->get_results("SELECT ID, post_date, post_title, guid FROM $wpdb->posts WHERE post_status = 'object' AND left(post_type, 5) = 'image' $and_post ORDER BY $sort LIMIT $start, $double", ARRAY_A); -//if ( count($images) == 0 ) -// header("Location: ".basename(__FILE__)."?post=$post&all=$all&action=upload"); - -if ( count($images) > 5 ) { - $next = $start + count($images) - 5; +if ( count($images) > $num ) { + $next = $start + count($images) - $num; } else { $next = false; } if ( $start > 0 ) { - $back = $start - 5; + $back = $start - $num; if ( $back < 1 ) $back = '0'; } else { $back = false; } -?> - - - - - - -
- 0 ) { - $imagerow = ''; - $i = 1; - foreach ( $images as $image ) { - if ( $i++ > 5 ) break; + $images = array_slice( $images, 0, $num ); + foreach ( $images as $key => $image ) { $image = array_merge($image, get_post_meta($image['ID'], 'imagedata', true) ); -?> - - <?php echo $image['post_title']; ?> /> - -{$image[
\n"; } } -?> -
-
-
- - - - - /> -
-
- - - - - /> -
-
- - - - -
- -
- - - - -
- -
- - - - -
- -
- - - - - /> -
-
- - - - - /> -
-
-".print_r($images,1).""; -?> - - - + + + + + + + + + + +Drag and drop photos to post +Click photos for more options +
+
+ +
+
+ +
Duplicated filenames will be numbered (photo.jpg, photo1.jpg, etc.)
+
+ + + + + + +
+ + +
+
+ + + diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index 895e12d292..e8c429e59c 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -148,7 +148,7 @@ p, li, dl, dd, dt { line-height: 130%; } -textarea, input, select, iframe#imageup { +textarea, input, select { background: #f4f4f4; border: 1px solid #b2b2b2; color: #000; @@ -157,12 +157,13 @@ textarea, input, select, iframe#imageup { padding: 3px; } -iframe#imageup { - margin: 0px; +#imageup { + border-style: none; padding: 0px; - border: 1px solid #ccc; - height: 13em; - width: 98%; + margin-bottom: 16px; + height: 180px; + width: 100%; + overflow-y: hidden; } .alignleft {