From 861bd9122e6d9ee710df2b6fc0a1222a8a8965cf Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 4 Jan 2007 13:20:38 +0000 Subject: WP Merge to 4674 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@830 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/upload-functions.php | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'wp-admin/upload-functions.php') diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index 5e6c8c8..ef54c50 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -13,16 +13,13 @@ function wp_upload_display( $dims = false, $href = '' ) { $class = 'text'; $innerHTML = get_attachment_innerHTML( $id, false, $dims ); - if ( $image_src = strstr($innerHTML, 'src=') ) { - preg_match("/src=(\"|')(.+?)\\1/", $image_src, $matches); - $image_src = $matches[2]; + if ( $image_src = get_attachment_icon_src() ) { $image_rel = wp_make_link_relative($image_src); - $class = 'image'; $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML); - $image_base = str_replace($image_rel, '', $image_src); + $class = 'image'; } - $src_base = get_the_guid(); + $src_base = wp_get_attachment_url(); $src = wp_make_link_relative( $src_base ); $src_base = str_replace($src, '', $src_base); @@ -38,11 +35,16 @@ function wp_upload_display( $dims = false, $href = '' ) { $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 ( !$thumb_base = wp_get_attachment_thumb_url() ) + $thumb_base = wp_mime_type_icon(); + if ( $thumb_base ) { + $thumb_rel = wp_make_link_relative( $thumb_base ); + $thumb_base = str_replace( $thumb_rel, '', $thumb_base ); + $r .= "\t\t\t\t\n"; + $r .= "\t\t\t\t\n"; + } + $is_image = (int) wp_attachment_is_image(); + $r .= "\t\t\t\t\n"; if ( isset($width) ) { $r .= "\t\t\t\t\n"; $r .= "\t\t\t\t\n"; @@ -62,7 +64,7 @@ function wp_upload_view() {

"; + echo ""; the_title(); if ( !isset($attachment_data['width']) && 'inline' != $style ) echo ''; @@ -79,7 +81,7 @@ function wp_upload_view() {
"; + echo ""; echo wp_upload_display( array(171, 128) ); if ( isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?> @@ -102,7 +104,7 @@ function wp_upload_form() { ?>

"; + echo ""; the_title(); if ( !isset($attachment_data['width']) && 'inline' != $style ) echo ''; @@ -119,7 +121,7 @@ function wp_upload_form() {
"; + echo ""; echo wp_upload_display( array(171, 128) ); if ( isset($attachment_data['width']) && 'inline' != $style ) echo ''; ?> @@ -129,7 +131,7 @@ function wp_upload_form() { - + @@ -343,4 +345,3 @@ function wp_upload_admin_head() { echo ""; } } - -- cgit