Index: /trunk/wp-admin/css/press-this.css
===================================================================
--- /trunk/wp-admin/css/press-this.css (revision 8112)
+++ /trunk/wp-admin/css/press-this.css (revision 8113)
@@ -112,5 +112,5 @@
font-size: 11px;
}
-#newtag { padding: 3px; }
+#newtag { width: 60%; padding: 3px; }
#wphead {
@@ -453,2 +453,8 @@
margin-bottom: 8px;
}
+
+#post_status {
+margin-left: 10px;
+margin-bottom: 1em;
+display: block;
+}
Index: /trunk/wp-admin/press-this.php
===================================================================
--- /trunk/wp-admin/press-this.php (revision 8112)
+++ /trunk/wp-admin/press-this.php (revision 8113)
@@ -7,5 +7,5 @@
function press_it() {
#define some basic variables
- $quick['post_status'] = 'publish';
+ $quick['post_status'] = $_REQUEST['post_status'];
$quick['post_category'] = $_REQUEST['post_category'];
$quick['tags_input'] = $_REQUEST['tags_input'];
@@ -43,5 +43,5 @@
}
# set the post_content
- $quick['post_content'] = $content;
+ $quick['post_content'] = str_replace('
', "\n", preg_replace('/<\/?p>/','',$content));
#error handling for $post
@@ -57,28 +57,4 @@
return $post_ID;
}
-
-
-function category_div() { ?>
-
-
-
-
-
-
-
-
-
-", wp_specialchars(js_escape($_GET['s']))));
+$url = clean_url($_GET['u']);
$image = $_GET['i'];
if($_REQUEST['ajax'] == 'thickbox') { ?>
@@ -131,5 +107,4 @@
image_selector();
});
-
@@ -155,31 +130,27 @@
if($_REQUEST['ajax'] == 'photo_images') {
- error_log('photo images');
function get_images_from_uri($uri) {
if(preg_match('/\.(jpg|png|gif)/', $uri))
return "'".$uri."'";
-
+
$content = wp_remote_fopen($uri);
+ if ( false === $content ) return '';
+
$host = parse_url($uri);
-
- if ( false === $content ) return '';
$pattern = '/
]*)src=(\"|\')(.+?)(\2)([^>\/]*)\/*>/is';
preg_match_all($pattern, $content, $matches);
- if ( empty($matches[1]) ) { error_log('empty'); return ''; };
+
+ if ( empty($matches[1]) ) return '';
+
$sources = array();
-
foreach ($matches[3] as $src) {
- error_log($src);
- #if ( false !== strpos($src, '&') ) continue;
- if(strpos($src, 'http') === false) {
- if(strpos($src, '../') === false && strpos($src, './') === false) {
- $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
- } else {
- $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src);
- }
- }
-
- $sources[] = $src;
+ if(strpos($src, 'http') === false)
+ if(strpos($src, '../') === false && strpos($src, './') === false)
+ $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
+ else
+ $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src);
+
+ $sources[] = $src;
}
return "'" . implode("','", $sources) . "'";
@@ -227,9 +198,6 @@
if (img.width * img.height < 2500) skip = true;
aspect = img.width / img.height;
- if (aspect > 1) { // Image is wide
- scale = 75 / img.width;
- } else { // Image is tall or square
- scale = 75 / img.height;
- }
+ scale = (aspect > 1) ? (75 / img.width) : (75 / img.height);
+
if (scale < 1) {
w = parseInt(img.width * scale);
@@ -253,7 +221,5 @@
if($_REQUEST['ajax'] == 'photo') { ?>
-
-
@@ -261,5 +227,4 @@
@@ -318,5 +283,6 @@
tab_focus : ":next",
plugins : "safari,inlinepopups",
- entities : "38,amp,60,lt,62,gt"
+ entities : "38,amp,60,lt,62,gt",
+ force_p_newlines : true
});
@@ -350,4 +316,5 @@
}
function set_editor(text) {
+
if(tinyMCE.activeEditor) tinyMCE.activeEditor.setContent('');
if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text);
@@ -370,9 +337,5 @@
set_menu('text');
set_title('');
-
- set_editor('
'.$selection.' '; ?>');
-
- set_editor('
'.$title.' '; ?>');
-
+
return false;
break;
@@ -500,5 +463,27 @@
-
+