From 75e0ccc3a64e164d036da4f71f458520ddea3b24 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 9 Oct 2006 11:39:17 +0000 Subject: WP Merge - needs testing. git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@797 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/upload-functions.php | 68 ++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'wp-admin/upload-functions.php') diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index 29b48d8..623daeb 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -16,10 +16,16 @@ function wp_upload_display( $dims = false, $href = '' ) { if ( $image_src = strstr($innerHTML, 'src="') ) { $image_src = explode('"', $image_src); $image_src = $image_src[1]; + $image_rel = wp_make_link_relative($image_src); $class = 'image'; - $innerHTML = ' ' . $innerHTML; + $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML); + $image_base = str_replace($image_rel, '', $image_src); } + $src_base = get_the_guid(); + $src = wp_make_link_relative( $src_base ); + $src_base = str_replace($src, '', $src_base); + $r = ''; if ( $href ) @@ -29,10 +35,14 @@ function wp_upload_display( $dims = false, $href = '' ) { if ( $href ) $r .= "\n"; $r .= "\n\t\t
\n\t\t\t

\n"; - $r .= "\t\t\t\t\n"; - - if ( $image_src ) - $r .= "\t\t\t\t\n"; + $r .= "\t\t\t\t\n"; + $r .= "\t\t\t\t\n"; + + if ( isset($attachment_data['thumb']) ) { + $r .= "\t\t\t\t\n"; + $r .= "\t\t\t\t\n"; + } elseif ( $image_rel ) + $r .= "\t\t\t\t\n"; if ( isset($width) ) { $r .= "\t\t\t\t\n"; $r .= "\t\t\t\t\n"; @@ -45,16 +55,16 @@ function wp_upload_display( $dims = false, $href = '' ) { } function wp_upload_view() { - global $style, $post_id; + global $style, $post_id, $style; $id = get_the_ID(); $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); ?>

-

"; the_title(); - if ( !isset($attachment_data['width']) ) + if ( !isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>

-"; echo wp_upload_display( array(171, 128) ); - if ( isset($attachment_data['width']) ) + if ( isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>
-\n"; +\n"; } function wp_upload_form() { @@ -91,10 +101,10 @@ function wp_upload_form() { $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); ?>
-

"; the_title(); - if ( !isset($attachment_data['width']) ) + if ( !isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>

-"; echo wp_upload_display( array(171, 128) ); - if ( isset($attachment_data['width']) ) + if ( isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?>
- - +
+ + + + + + - + - + - + - - - + @@ -349,7 +363,7 @@ function wp_upload_admin_head() { echo "\n"; if ( 'inline' == @$_GET['style'] ) { echo ""; -- cgit
+
+ + + @@ -143,9 +160,6 @@ function wp_upload_form() {
- - -