Changeset 3145 for trunk/wp-admin/inline-uploading.php
- Timestamp:
- 11/18/2005 09:25:47 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/inline-uploading.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/inline-uploading.php
r3126 r3145 78 78 $imagedata['thumb'] = "thumb-$filename"; 79 79 80 add_post_meta($id, ' imagedata', $imagedata);80 add_post_meta($id, '_wp_attachment_metadata', $imagedata); 81 81 82 82 if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) { … … 136 136 } 137 137 138 $i = 0;139 138 $uwidth_sum = 0; 140 139 $images_html = ''; … … 155 154 $images_script .= "thumbnailon = '$__thumbnail_on';\nthumbnailoff = '$__thumbnail_off';\n"; 156 155 foreach ( $images as $key => $image ) { 157 $meta = get_post_meta($image['ID'], 'imagedata', true); 156 $attachment_ID = $image['ID']; 157 $meta = get_post_meta($attachment_ID, '_wp_attachment_metadata', true); 158 158 if (!is_array($meta)) { 159 wp_delete_attachment($image['ID']); 160 continue; 159 $meta = get_post_meta($attachment_ID, 'imagedata', true); // Try 1.6 Alpha meta key 160 if (!is_array($meta)) { 161 continue; 162 } else { 163 add_post_meta($attachment_ID, '_wp_attachment_metadata', $meta); 164 } 161 165 } 162 166 $image = array_merge($image, $meta); 163 167 if ( ($image['width'] > 128 || $image['height'] > 96) && !empty($image['thumb']) && file_exists(dirname($image['file']).'/'.$image['thumb']) ) { 164 168 $src = str_replace(basename($image['guid']), '', $image['guid']) . $image['thumb']; 165 $images_script .= "src".$ i."a = '$src';\nsrc".$i."b = '".$image['guid']."';\n";169 $images_script .= "src".$attachment_ID."a = '$src';\nsrc".$attachment_ID."b = '".$image['guid']."';\n"; 166 170 $thumb = 'true'; 167 171 $thumbtext = $__thumbnail_on; … … 176 180 $xpadding = (128 - $image['uwidth']) / 2; 177 181 $ypadding = (96 - $image['uheight']) / 2; 178 $attachment = $image['ID']; 179 $images_style .= "#target$i img { padding: {$ypadding}px {$xpadding}px; }\n"; 180 $href = get_attachment_link($attachment); 181 $images_script .= "href".$i."a = '$href';\nhref".$i."b = '{$image['guid']}';\n"; 182 $images_style .= "#target{$attachment_ID} img { padding: {$ypadding}px {$xpadding}px; }\n"; 183 $href = get_attachment_link($attachment_ID); 184 $images_script .= "href{$attachment_ID}a = '$href';\nhref{$attachment_ID}b = '{$image['guid']}';\n"; 182 185 $images_html .= " 183 <div id='target $i' class='imagewrap left'>184 <div id='popup $i' class='popup'>185 <a id=\"L $i\" onclick=\"toggleLink($i);return false;\" href=\"javascript:void();\">$__attachment_on</a>186 <a id=\"I $i\" onclick=\"if($thumb)toggleImage($i);else alert('$__nothumb');return false;\" href=\"javascript:void();\">$thumbtext</a>187 <a onclick=\"return confirm('$__confirmdelete')\" href=\"".basename(__FILE__)."?action=delete&attachment= $attachment&all=$all&start=$start&post=$post\">$__delete</a>186 <div id='target{$attachment_ID}' class='imagewrap left'> 187 <div id='popup{$attachment_ID}' class='popup'> 188 <a id=\"L{$attachment_ID}\" onclick=\"toggleLink({$attachment_ID});return false;\" href=\"javascript:void();\">$__attachment_on</a> 189 <a id=\"I{$attachment_ID}\" onclick=\"if($thumb)toggleImage({$attachment_ID});else alert('$__nothumb');return false;\" href=\"javascript:void();\">$thumbtext</a> 190 <a onclick=\"return confirm('$__confirmdelete')\" href=\"".basename(__FILE__)."?action=delete&attachment={$attachment_ID}&all=$all&start=$start&post=$post\">$__delete</a> 188 191 <a onclick=\"popup.style.display='none';return false;\" href=\"javascript:void()\">$__close</a> 189 192 </div> 190 <a id=\" link$i\" class=\"imagelink\" href=\"$href\" onclick=\"imagePopup($i);return false;\" title=\"{$image['post_title']}\">191 <img id= 'image$i' src='$src' alt='{$image['post_title']}'$height_width />193 <a id=\"{$attachment_ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"imagePopup({$attachment_ID});return false;\" title=\"{$image['post_title']}\"> 194 <img id=\"image{$attachment_ID}\" src=\"$src\" alt=\"{$attachment_ID}\" $height_width /> 192 195 </a> 193 196 </div> 194 197 "; 195 $i++;196 198 } 197 199 } … … 243 245 } 244 246 function toggleLink(n) { 245 o=document.getElementById( 'link'+n);247 o=document.getElementById(n); 246 248 oi=document.getElementById('L'+n); 247 249 if ( oi.innerHTML == attachmenton ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)