Ticket #7732: press-this_9-22-08.diff
| File press-this_9-22-08.diff, 5.8 KB (added by , 18 years ago) |
|---|
-
includes/media.php
342 342 function media_sideload_image($file, $post_id, $desc = null) { 343 343 if (!empty($file) ) { 344 344 $file_array['name'] = basename($file); 345 $file_array['tmp_name'] = download_url($file); 345 $tmp = download_url($file); 346 $file_array['tmp_name'] = $tmp; 346 347 $desc = @$desc; 347 348 349 if ( is_wp_error($tmp) ) { 350 @unlink($file_array['tmp_name']); 351 $file_array['tmp_name'] = ''; 352 } 353 348 354 $id = media_handle_sideload($file_array, $post_id, $desc); 349 355 $src = $id; 350 356 351 357 if ( is_wp_error($id) ) { 352 358 @unlink($file_array['tmp_name']); 353 359 return $id; -
press-this.php
248 248 } 249 249 img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"'; 250 250 } 251 if (!skip) strtoappend += '<a href="?ajax=photo_thickbox&i=' + img.src+ '&u=<?php echo $url; ?>&height=400&width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>';251 if (!skip) strtoappend += '<a href="?ajax=photo_thickbox&i=' + encodeURI(img.src) + '&u=<?php echo $url; ?>&height=400&width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>'; 252 252 } 253 253 254 254 function pick(img, desc) { … … 257 257 if(length == 0) length = 1; 258 258 jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>'); 259 259 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); 260 append_editor("\n\n" + '<p ><img src="' + img +'" alt="' + desc + '" class="aligncenter"/></p>');260 append_editor("\n\n" + '<p style="text-align: center;"><a href="<?php echo urlencode($url); ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>'); 261 261 } 262 262 tinyMCE.activeEditor.resizeToContent(); 263 263 return false; … … 430 430 } 431 431 432 432 jQuery(document).ready(function() { 433 top.resizeTo(700-screen.width+screen.availWidth,680-screen.height+screen.availHeight); 433 434 jQuery('#photo_button').click(function() { show('photo'); return false; }); 434 435 jQuery('#video_button').click(function() { show('video'); return false; }); 435 436 … … 450 451 <div id="wphead"> 451 452 </div> 452 453 453 <?php454 if ( isset($posted) && intval($posted) ) {455 $post_ID = intval($posted);456 ?>457 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p></div>458 <?php459 }460 ?>461 454 <form action="press-this.php?action=post" method="post"> 462 455 <?php wp_nonce_field('press-this') ?> 463 456 <input type="hidden" name="post_type" id="post_type" value="text"/> 464 457 465 <div id="poststuff"> 458 <div id="poststuff"> 466 459 <div id="side-info-column"> 467 460 <div class="sleeve"> 468 461 <h1 id="viewsite"><a class="button" href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?> › <?php _e('Press This') ?></a></span></h1> … … 514 507 </div> 515 508 516 509 <div class="posting"> 510 <?php 511 if ( isset($posted) && intval($posted) ) { 512 $post_ID = intval($posted); 513 ?> 514 <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p></div> 515 <?php 516 } 517 ?> 518 517 519 <h2 id="title"><label for="post_title"><?php _e('Title') ?></label></h2> 518 520 <div class="titlewrap"> 519 521 <input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/> -
css/press-this.css
122 122 } 123 123 124 124 #category-add input { 125 width: 94%; 125 width: 94%; 126 font-family:Verdana,Arial,Helvetica,sans-serif; 127 font-size:13px; 128 margin:1px; 129 padding:3px; 130 126 131 } 127 132 128 133 #category-add select { 129 width: 100%; 134 width: 70%; 135 -x-system-font:none; 136 border-style:solid; 137 border-width:1px; 138 font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; 139 font-size:12px; 140 height:2em; 141 line-height:20px; 142 padding:2px; 143 margin: 1px; 144 vertical-align:top; 130 145 } 131 146 132 147 #category-add input#category-add-sumbit { … … 143 158 margin: 0; 144 159 } 145 160 146 #categorydiv ul.categorychecklist ul , #linkcategorydiv ul.categorychecklist ul{161 #categorydiv ul.categorychecklist ul { 147 162 margin-left: 18px; 148 163 } 149 164 150 165 151 #categorydiv div.ui-tabs-panel, #linkcategorydiv div.ui-tabs-panel { 166 #categorydiv div.ui-tabs-panel { 167 height:150px; 168 overflow:auto; 152 169 padding:0.5em 0.9em; 153 170 } 154 171 … … 191 208 192 209 #TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px;} 193 210 #TB_ajaxContent h3{margin-bottom:.25em;} 194 .updated{margin: 0;margin-left:15px;margin-right:15px;padding:0;max-width:980px;border-width:1px;border-style:solid;max-width:950px;margin-top:1em;margin-bottom:1em;width:66%;}211 .updated{margin:10px 0;padding:0;border-width:1px;border-style:solid; width:99%;} 195 212 .updated p,.error p{margin:0.6em 0;padding:0 0.6em;} 196 213 .updated a,.error a{text-decoration:underline;} 197 214 .updated a{text-decoration:none;padding-bottom:2px;}
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)