Changeset 8600 for trunk/wp-admin/press-this.php
- Timestamp:
- 08/09/2008 05:36:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r8551 r8600 35 35 36 36 foreach( (array) $_REQUEST['photo_src'] as $key => $image) { 37 37 38 38 // see if files exist in content - we don't want to upload non-used selected files. 39 39 if( strpos($_REQUEST['content'], $image) !== false ) { 40 40 $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); 41 41 42 42 // Replace the POSTED content <img> with correct uploaded ones. 43 43 // escape quote for matching … … 50 50 51 51 case "video": 52 if($_REQUEST['embed_code']) 52 if($_REQUEST['embed_code']) 53 53 $content .= $_REQUEST['embed_code']."\n\n"; 54 54 $content .= $_REQUEST['content']; … … 74 74 75 75 // For submitted posts. 76 if ( 'post' == $_REQUEST['action'] ) { 76 if ( 'post' == $_REQUEST['action'] ) { 77 77 check_admin_referer('press-this'); $post_ID = press_it(); ?> 78 78 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 139 139 140 140 <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p> 141 <?php die; 141 <?php die; 142 142 } 143 143 … … 164 164 165 165 <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> 166 <?php die; 166 <?php die; 167 167 } 168 168 … … 177 177 if($_REQUEST['ajax'] == 'photo_images') { 178 178 function get_images_from_uri($uri) { 179 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com') ) 179 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com') ) 180 180 return "'".$uri."'"; 181 181 … … 187 187 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is'; 188 188 preg_match_all($pattern, $content, $matches); 189 189 190 190 if ( empty($matches[1]) ) return ''; 191 191 … … 199 199 else 200 200 $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); 201 201 202 202 $sources[] = clean_url($src); 203 203 } 204 204 return "'" . implode("','", $sources) . "'"; 205 } 205 } 206 206 207 207 $url = urldecode($url); 208 208 $url = str_replace(' ', '%20', $url); 209 echo 'new Array('.get_images_from_uri($url).')'; 209 echo 'new Array('.get_images_from_uri($url).')'; 210 210 die; 211 211 } … … 227 227 228 228 for (i = 0; i < my_src.length; i++) { 229 img = new Image(); 230 img.src = my_src[i]; 231 img_attr = 'id="img' + i + '"'; 229 img = new Image(); 230 img.src = my_src[i]; 231 img_attr = 'id="img' + i + '"'; 232 232 skip = false; 233 233 if (img.width && img.height) { 234 if (img.width * img.height < 2500) 234 if (img.width * img.height < 2500) 235 235 skip = true; 236 236 aspect = img.width / img.height; … … 304 304 ?> 305 305 <script type="text/javascript"> 306 <?php if ( user_can_richedit() ) { 306 <?php if ( user_can_richedit() ) { 307 307 $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); 308 308 // Add TinyMCE languages … … 360 360 }); 361 361 jQuery('#newtag').blur(function() { 362 if ( this.value == '' ) 362 if ( this.value == '' ) 363 363 jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' ); 364 364 }); … … 412 412 jQuery('body').addClass('video_split'); 413 413 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo attribute_escape($selection); ?>'}, function() { 414 <?php 414 <?php 415 415 $content = ''; 416 416 if ( preg_match("/youtube\.com\/watch/i", $url) ) { … … 461 461 462 462 jQuery(document).ready(function() { 463 jQuery('#menu li').click(function (){ 463 jQuery('#menu li').click(function (){ 464 464 tab_name = this.id.split('_'); 465 465 tab_name = tab_name[0]; … … 519 519 </ul> 520 520 </div> 521 521 522 522 <h2><?php _e('Tags') ?></h2> 523 523 <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p> … … 525 525 </div> 526 526 527 <p class="submit"> 527 <p class="submit"> 528 528 <input type="submit" name="draft" value="<?php _e('Save') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> 529 529 <input type="submit" name="publish" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
Note: See TracChangeset
for help on using the changeset viewer.