/var/www/wordpress/wp-admin/includes/admin.php
/var/www/wordpress/wp-admin/includes/bookmark.php
/var/www/wordpress/wp-admin/includes/class-ftp-pure.php
/var/www/wordpress/wp-admin/includes/class-ftp-sockets.php
/var/www/wordpress/wp-admin/includes/class-ftp.php
/var/www/wordpress/wp-admin/includes/class-pclzip.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-base.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
/var/www/wordpress/wp-admin/includes/class-wp-importer.php
/var/www/wordpress/wp-admin/includes/class-wp-upgrader.php
/var/www/wordpress/wp-admin/includes/comment.php
/var/www/wordpress/wp-admin/includes/continents-cities.php
/var/www/wordpress/wp-admin/includes/dashboard.php
/var/www/wordpress/wp-admin/includes/deprecated.php
/var/www/wordpress/wp-admin/includes/export.php
/var/www/wordpress/wp-admin/includes/file.php
/var/www/wordpress/wp-admin/includes/image-edit.php
/var/www/wordpress/wp-admin/includes/image.php
/var/www/wordpress/wp-admin/includes/import.php
/var/www/wordpress/wp-admin/includes/manifest.php
/var/www/wordpress/wp-admin/includes/media.php
/var/www/wordpress/wp-admin/includes/meta-boxes.php
/var/www/wordpress/wp-admin/includes/misc.php
/var/www/wordpress/wp-admin/includes/ms-deprecated.php
/var/www/wordpress/wp-admin/includes/ms.php
/var/www/wordpress/wp-admin/includes/nav-menu.php
/var/www/wordpress/wp-admin/includes/plugin-install.php
/var/www/wordpress/wp-admin/includes/plugin.php
/var/www/wordpress/wp-admin/includes/post.php
/var/www/wordpress/wp-admin/includes/schema.php
/var/www/wordpress/wp-admin/includes/taxonomy.php
/var/www/wordpress/wp-admin/includes/template.php
/var/www/wordpress/wp-admin/includes/theme-install.php
/var/www/wordpress/wp-admin/includes/theme.php
/var/www/wordpress/wp-admin/includes/update-core.php
/var/www/wordpress/wp-admin/includes/update.php
/var/www/wordpress/wp-admin/includes/upgrade.php
/var/www/wordpress/wp-admin/includes/user.php
/var/www/wordpress/wp-admin/includes/widgets.php
/var/www/wordpress/wp-admin/js/revisions-js.php
/var/www/wordpress/wp-admin/maint/repair.php
/var/www/wordpress/wp-admin/admin-ajax.php
/var/www/wordpress/wp-admin/admin-footer.php
/var/www/wordpress/wp-admin/admin-functions.php
/var/www/wordpress/wp-admin/admin-header.php
/var/www/wordpress/wp-admin/admin-post.php
/var/www/wordpress/wp-admin/admin.php
/var/www/wordpress/wp-admin/async-upload.php
/var/www/wordpress/wp-admin/comment.php
/var/www/wordpress/wp-admin/custom-background.php
/var/www/wordpress/wp-admin/custom-header.php
/var/www/wordpress/wp-admin/edit-attachment-rows.php
/var/www/wordpress/wp-admin/edit-comments.php
/var/www/wordpress/wp-admin/edit-form-advanced.php
/var/www/wordpress/wp-admin/edit-form-comment.php
/var/www/wordpress/wp-admin/edit-link-categories.php
/var/www/wordpress/wp-admin/edit-link-category-form.php
/var/www/wordpress/wp-admin/edit-link-form.php
/var/www/wordpress/wp-admin/edit-post-rows.php
/var/www/wordpress/wp-admin/edit-tag-form.php
/var/www/wordpress/wp-admin/edit-tags.php
/var/www/wordpress/wp-admin/edit.php
/var/www/wordpress/wp-admin/export.php
/var/www/wordpress/wp-admin/gears-manifest.php
/var/www/wordpress/wp-admin/import.php
/var/www/wordpress/wp-admin/index-extra.php
/var/www/wordpress/wp-admin/index.php
/var/www/wordpress/wp-admin/install-helper.php
/var/www/wordpress/wp-admin/install.php
/var/www/wordpress/wp-admin/link-add.php
/var/www/wordpress/wp-admin/link-category.php
/var/www/wordpress/wp-admin/link-manager.php
/var/www/wordpress/wp-admin/link-parse-opml.php
/var/www/wordpress/wp-admin/link.php
/var/www/wordpress/wp-admin/load-scripts.php
/var/www/wordpress/wp-admin/load-styles.php
/var/www/wordpress/wp-admin/media-new.php
/var/www/wordpress/wp-admin/media-upload.php
/var/www/wordpress/wp-admin/media.php
/var/www/wordpress/wp-admin/menu-header.php
/var/www/wordpress/wp-admin/menu.php
/var/www/wordpress/wp-admin/moderation.php
/var/www/wordpress/wp-admin/ms-admin.php
/var/www/wordpress/wp-admin/ms-delete-site.php
/var/www/wordpress/wp-admin/ms-edit.php
/var/www/wordpress/wp-admin/ms-options.php
/var/www/wordpress/wp-admin/ms-sites.php
/var/www/wordpress/wp-admin/ms-themes.php
/var/www/wordpress/wp-admin/ms-upgrade-network.php
/var/www/wordpress/wp-admin/ms-users.php
/var/www/wordpress/wp-admin/my-sites.php
/var/www/wordpress/wp-admin/nav-menus.php
/var/www/wordpress/wp-admin/network.php
/var/www/wordpress/wp-admin/options-discussion.php
/var/www/wordpress/wp-admin/options-general.php
/var/www/wordpress/wp-admin/options-head.php
/var/www/wordpress/wp-admin/options-media.php
/var/www/wordpress/wp-admin/options-permalink.php
/var/www/wordpress/wp-admin/options-privacy.php
/var/www/wordpress/wp-admin/options-reading.php
/var/www/wordpress/wp-admin/options-writing.php
/var/www/wordpress/wp-admin/options.php
/var/www/wordpress/wp-admin/plugin-editor.php
/var/www/wordpress/wp-admin/plugin-install.php
/var/www/wordpress/wp-admin/plugins.php
/var/www/wordpress/wp-admin/post-new.php
/var/www/wordpress/wp-admin/post.php
/var/www/wordpress/wp-admin/press-this.php
#CodeDescriptions
1<?php
2/**
3 * Press This Display and Handler.
4 *
5 * @package WordPress
6 * @subpackage Press_This
7 */
8
9/** WordPress Administration Bootstrap */
10require_once('./admin.php');
11header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
12
13if ( ! current_user_can('edit_posts') )
14 wp_die( __( 'Cheatin’ uh?' ) );
15
16/**
17 * Press It form handler.
18 *
19 * @package WordPress
20 * @subpackage Press_This
21 * @since 2.6.0
22 *
23 * @return int Post ID
24 */
25function press_it() {
26 // define some basic variables
27 $quick['post_status'] = 'draft'; // set as draft first
28 $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
29 $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
30 $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' ';
31 $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : '';
32
33 // insert the post with nothing in it, to get an ID
34 $post_ID = wp_insert_post($quick, true);
35 if ( is_wp_error($post_ID) )
36 wp_die($post_ID);
37
38 $content = isset($_POST['content']) ? $_POST['content'] : '';
39
40 $upload = false;
41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) {
42 foreach( (array) $_POST['photo_src'] as $key => $image) {
43 // see if files exist in content - we don't want to upload non-used selected files.
44 if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) {
45 $desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : '';
46 $upload = media_sideload_image($image, $post_ID, $desc);
47
48 // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes
49 if ( !is_wp_error($upload) )
50 $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
51 }
52 }
53 }
54 // set the post_content and status
55 $quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft';
56 $quick['post_content'] = $content;
57 // error handling for media_sideload
58 if ( is_wp_error($upload) ) {
59 wp_delete_post($post_ID);
60 wp_die($upload);
61 } else {
62 $quick['ID'] = $post_ID;
63 wp_update_post($quick);
64 }
65 return $post_ID;
66}
67
68// For submitted posts.
69if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) {
70 check_admin_referer('press-this');
71 $post_ID = press_it();
72 $posted = $post_ID;
73} else {
74 $post_ID = 0;
75}
76
77// Set Variables
78$title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( stripslashes( $_GET['t'] ) , ENT_QUOTES) ) ) : '';
79
80$selection = '';
81if ( !empty($_GET['s']) ) {
82 $selection = str_replace(''', "'", stripslashes($_GET['s']));
83 $selection = trim( htmlspecialchars( html_entity_decode($selection, ENT_QUOTES) ) );
84}
85
86if ( ! empty($selection) ) {
87 $selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection);
88 $selection = '<p>' . str_replace('<p></p>', '', $selection) . '</p>';
89}
90
91$url = isset($_GET['u']) ? esc_url($_GET['u']) : '';
92$image = isset($_GET['i']) ? $_GET['i'] : '';
93
94if ( !empty($_REQUEST['ajax']) ) {
95 switch ($_REQUEST['ajax']) {
96 case 'video': ?>
97 <script type="text/javascript" charset="utf-8">
98 /* <![CDATA[ */
99 jQuery('.select').click(function() {
100 append_editor(jQuery('#embed-code').val());
101 jQuery('#extra-fields').hide();
102 jQuery('#extra-fields').html('');
103 });
104 jQuery('.close').click(function() {
105 jQuery('#extra-fields').hide();
106 jQuery('#extra-fields').html('');
107 });
108 /* ]]> */
109 </script>
110 <div class="postbox">
111 <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
112 <div class="inside">
113 <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo wp_htmledit_pre( $selection ); ?></textarea>
114 <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
115 </div>
116 </div>
117 <?php break;
118
119 case 'photo_thickbox': ?>
120 <script type="text/javascript" charset="utf-8">
121 /* <![CDATA[ */
122 jQuery('.cancel').click(function() {
123 tb_remove();
124 });
125 jQuery('.select').click(function() {
126 image_selector();
127 });
128 /* ]]> */
129 </script>
130 <h3 class="tb"><label for="this_photo_description"><?php _e('Description') ?></label></h3>
131 <div class="titlediv">
132 <div class="titlewrap">
133 <input id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/>
134 </div>
135 </div>
136
137 <p class="centered">
138 <input type="hidden" name="this_photo" value="<?php echo esc_attr($image); ?>" id="this_photo" />
139 <a href="#" class="select">
140 <img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" />
141 </a>
142 </p>
143
144 <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p>
145 <?php break;
146
147 case 'photo_thickbox_url': ?>
148 <script type="text/javascript" charset="utf-8">
149 /* <![CDATA[ */
150 jQuery('.cancel').click(function() {
151 tb_remove();
152 });
153
154 jQuery('.select').click(function() {
155 image_selector();
156 });
157 /* ]]> */
158 </script>
159 <h3 class="tb"><label for="this_photo"><?php _e('URL') ?></label></h3>
160 <div class="titlediv">
161 <div class="titlewrap">
162 <input id="this_photo" name="this_photo" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" />
163 </div>
164 </div>
165 <h3 class="tb"><label for="photo_description"><?php _e('Description') ?></label></h3>
166 <div id="titlediv">
167 <div class="titlewrap">
168 <input id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/>
169 </div>
170 </div>
171
172 <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p>
173 <?php break;
174 case 'photo_images':
175 /**
176 * Retrieve all image URLs from given URI.
177 *
178 * @package WordPress
179 * @subpackage Press_This
180 * @since 2.6.0
181 *
182 * @param string $uri
183 * @return string
184 */
185 function get_images_from_uri($uri) {
186 $uri = preg_replace('/\/#.+?$/','', $uri);
187 if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
188 return "'" . esc_attr( html_entity_decode($uri) ) . "'";
189 $content = wp_remote_fopen($uri);
190 if ( false === $content )
191 return '';
192 $host = parse_url($uri);
193 $pattern = '/<img ([^>]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/i';
194 $content = str_replace(array("\n","\t","\r"), '', $content);
195 preg_match_all($pattern, $content, $matches);
196 if ( empty($matches[0]) )
197 return '';
198 $sources = array();
199 foreach ($matches[3] as $src) {
200 // if no http in url
201 if (strpos($src, 'http') === false)
202 // if it doesn't have a relative uri
203 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0)
204 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
205 else
206 $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
207 $sources[] = esc_attr($src);
208 }
209 return "'" . implode("','", $sources) . "'";
210 }
211 $url = wp_kses(urldecode($url), null);
212 echo 'new Array('.get_images_from_uri($url).')';
213 break;
214
215 case 'photo_js': ?>
216 // gather images and load some default JS
217 var last = null
218 var img, img_tag, aspect, w, h, skip, i, strtoappend = "";
219 if(photostorage == false) {
220 var my_src = eval(
221 jQuery.ajax({
222 type: "GET",
223 url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
224 cache : false,
225 async : false,
226 data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
227 dataType : "script"
228 }).responseText
229 );
230 if(my_src.length == 0) {
231 var my_src = eval(
232 jQuery.ajax({
233 type: "GET",
234 url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
235 cache : false,
236 async : false,
237 data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
238 dataType : "script"
239 }).responseText
240 );
241 if(my_src.length == 0) {
242 strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>';
243 }
244 }
245 }
246 for (i = 0; i < my_src.length; i++) {
247 img = new Image();
248 img.src = my_src[i];
249 img_attr = 'id="img' + i + '"';
250 skip = false;
251
252 maybeappend = '<a href="?ajax=photo_thickbox&i=' + encodeURIComponent(img.src) + '&u=<?php echo urlencode($url); ?>&height=400&width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>';
253
254 if (img.width && img.height) {
255 if (img.width >= 30 && img.height >= 30) {
256 aspect = img.width / img.height;
257 scale = (aspect > 1) ? (71 / img.width) : (71 / img.height);
258
259 w = img.width;
260 h = img.height;
261
262 if (scale < 1) {
263 w = parseInt(img.width * scale);
264 h = parseInt(img.height * scale);
265 }
266 img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"';
267 strtoappend += maybeappend;
268 }
269 } else {
270 strtoappend += maybeappend;
271 }
272 }
273
274 function pick(img, desc) {
275 if (img) {
276 if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length;
277 if(length == 0) length = 1;
278 jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>');
279 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>');
280 insert_editor( "\n\n" + encodeURI('<p style="text-align: center;"><a href="<?php echo $url; ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>'));//Cross Site Scripting
281 }
282 return false;
283 }
284
285 function image_selector() {
286 tb_remove();
287 desc = jQuery('#this_photo_description').val();
288 src = jQuery('#this_photo').val();
289 pick(src, desc);
290 jQuery('#extra-fields').hide();
291 jQuery('#extra-fields').html('');
292 return false;
293 }
294 jQuery('#extra-fields').html('<div class="postbox"><h2>Add Photos <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="thickbox button"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
295 jQuery('#img_container').html(strtoappend);
296 <?php break;
297}
298die;
299}
300
301?>
302<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
303<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
304<head>
305 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
306 <title><?php _e('Press This') ?></title>
307
308<?php
309 add_thickbox();
310 wp_enqueue_style( 'press-this' );
311 wp_enqueue_style( 'press-this-ie');
312 wp_enqueue_style( 'colors' );
313 wp_enqueue_script( 'post' );
314 wp_enqueue_script( 'editor' );
315?>
316<script type="text/javascript">
317//<![CDATA[
318addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
319var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};//Cross Site Scripting
320var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this';
321var photostorage = false;
322//]]>
323</script>
324
325<?php
326 do_action('admin_print_styles');
327 do_action('admin_print_scripts');
328 do_action('admin_head');
329
330 if ( user_can_richedit() )
331 wp_tiny_mce( true, array( 'height' => '370' ) );
332?>
333 <script type="text/javascript">
334 function insert_plain_editor(text) {
335 edCanvas = document.getElementById('content');
336 edInsertContent(edCanvas, text);
337 }
338 function set_editor(text) {
339 if ( '' == text || '<p></p>' == text ) text = '<p><br /></p>';
340 if ( tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, text);
341 }
342 function insert_editor(text) {
343 if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) {
344 tinyMCE.execCommand('mceInsertContent', false, '<p>' + decodeURI(tinymce.DOM.decode(text)) + '</p>', {format : 'raw'});
345 } else {
346 insert_plain_editor(decodeURI(text));
347 }
348 }
349 function append_editor(text) {
350 if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) {
351 tinyMCE.execCommand('mceSetContent', false, tinyMCE.activeEditor.getContent({format : 'raw'}) + '<p>' + text + '</p>');
352 tinyMCE.execCommand('mceCleanup');
353 } else {
354 insert_plain_editor(text);
355 }
356 }
357
358 function show(tab_name) {
359 jQuery('#extra-fields').html('');
360 switch(tab_name) {
361 case 'video' :
362 jQuery('#extra-fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() {
363 <?php
364 $content = '';
365 if ( preg_match("/youtube\.com\/watch/i", $url) ) {
366 list($domain, $video_id) = split("v=", $url);
367 $video_id = esc_attr($video_id);
368 $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
369
370 } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) {
371 list($domain, $video_id) = split(".com/", $url);
372 $video_id = esc_attr($video_id);
373 $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>';
374
375 if ( trim($selection) == '' )
376 $selection = '<p><a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a></p>';
377
378 } elseif ( strpos( $selection, '<object' ) !== false ) {
379 $content = $selection;
380 }
381 ?>
382 jQuery('#embed-code').prepend('<?php echo htmlentities($content); ?>');
383 });
384 jQuery('#extra-fields').show();
385 return false;
386 break;
387 case 'photo' :
388 function setup_photo_actions() {
389 jQuery('.close').click(function() {
390 jQuery('#extra-fields').hide();
391 jQuery('#extra-fields').html('');
392 });
393 jQuery('.refresh').click(function() {
394 photostorage = false;
395 show('photo');
396 });
397 jQuery('#photo-add-url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500');
398 tb_init('#extra-fields .thickbox');
399 jQuery('#waiting').hide();
400 jQuery('#extra-fields').show();
401 }
402 jQuery('#extra-fields').before('<div id="waiting"><img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></div>');
403
404 if(photostorage == false) {
405 jQuery.ajax({
406 type: "GET",
407 cache : false,
408 url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
409 data: "ajax=photo_js&u=<?php echo urlencode($url)?>",
410 dataType : "script",
411 success : function(data) {
412 eval(data);
413 photostorage = jQuery('#extra-fields').html();
414 setup_photo_actions();
415 }
416 });
417 } else {
418 jQuery('#extra-fields').html(photostorage);
419 setup_photo_actions();
420 }
421 return false;
422 break;
423 }
424 }
425 jQuery(document).ready(function($) {
426 //resize screen
427 window.resizeTo(720,540);
428 // set button actions
429 jQuery('#photo_button').click(function() { show('photo'); return false; });
430 jQuery('#video_button').click(function() { show('video'); return false; });
431 // auto select
432 <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?>
433 show('video');
434 <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { ?>
435 show('video');
436 <?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?>
437 show('photo');
438 <?php } ?>
439 jQuery('#title').unbind();
440 jQuery('#publish, #save').click(function() { jQuery('#saving').css('display', 'inline'); });
441
442 $('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){
443 $(this).siblings('.inside').toggle();
444 });
445 });
446</script>
447</head>
448<body class="press-this wp-admin">
449<div id="wphead"></div>
450<form action="press-this.php?action=post" method="post">
451<div id="poststuff" class="metabox-holder">
452 <div id="side-info-column">
453 <div class="sleeve">
454 <h1 id="viewsite"><a href="<?php echo get_option('home'); ?>/" target="_blank"><?php bloginfo('name'); ?> › <?php _e('Press This') ?></a></span></h1>
455
456 <?php wp_nonce_field('press-this') ?>
457 <input type="hidden" name="post_type" id="post_type" value="text"/>
458 <input type="hidden" name="autosave" id="autosave" />
459 <input type="hidden" id="original_post_status" name="original_post_status" value="draft" />
460 <input type="hidden" id="prev_status" name="prev_status" value="draft" />
461
462 <!-- This div holds the photo metadata -->
463 <div class="photolist"></div>
464
465 <div id="submitdiv" class="stuffbox">
466 <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
467 <br/>
468 </div>
469 <h3><?php _e('Publish') ?></h3>
470 <div class="inside">
471 <p>
472 <input class="button" type="submit" name="draft" value="<?php esc_attr_e('Save Draft') ?>" id="save" />
473 <?php if ( current_user_can('publish_posts') ) { ?>
474 <input class="button-primary" type="submit" name="publish" value="<?php esc_attr_e('Publish') ?>" id="publish" />
475 <?php } else { ?>
476 <br /><br /><input class="button-primary" type="submit" name="review" value="<?php esc_attr_e('Submit for Review') ?>" id="review" />
477 <?php } ?>
478 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" />
479 </p>
480 </div>
481 </div>
482
483 <?php $tax = get_taxonomy( 'category' ); ?>
484 <div id="categorydiv" class="postbox">
485 <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>"><br /></div>
486 <h3 class="hndle"><?php _e('Categories') ?></h3>
487 <div class="inside">
488 <div id="taxonomy-category" class="categorydiv">
489
490 <ul id="category-tabs" class="category-tabs">
491 <li class="tabs"><a href="#category-all" tabindex="3"><?php echo $tax->labels->all_items; ?></a></li>//Cross Site Scripting
492 <li class="hide-if-no-js"><a href="#category-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
493 </ul>
494
495 <div id="category-pop" class="tabs-panel" style="display: none;">
496 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
497 <?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?>
498 </ul>
499 </div>
500
501 <div id="category-all" class="tabs-panel">
502 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
503 <?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?>
504 </ul>
505 </div>
506
507 <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
508 <p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
509 <?php endif; ?>
510 <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
511 <div id="category-adder" class="wp-hidden-children">
512 <h4>
513 <a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3">
514 <?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?>
515 </a>
516 </h4>
517 <p id="category-add" class="category-add wp-hidden-child">
518 <label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label>//Cross Site Scripting
519 <input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" tabindex="3" aria-required="true"/>//Arbitrary code inclusion
520 <label class="screen-reader-text" for="newcategory_parent">
521 <?php echo $tax->labels->parent_item_colon; ?>//Cross Site Scripting
522 </label>
523 <?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?>
524 <input type="button" id="category-add-submit" class="add:categorychecklist:category-add button category-add-sumbit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" tabindex="3" />
525 <?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?>
526 <span id="category-ajax-response"></span>
527 </p>
528 </div>
529 <?php endif; ?>
530 </div>
531 </div>
532 </div>
533
534 <div id="tagsdiv-post_tag" class="stuffbox" >
535 <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
536 <br/>
537 </div>
538 <h3><span><?php _e('Post Tags'); ?></span></h3>
539 <div class="inside">
540 <div class="tagsdiv" id="post_tag">
541 <p class="jaxtag">
542 <label class="screen-reader-text" for="newtag"><?php _e('Post Tags'); ?></label>
543 <input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" />
544 <div class="ajaxtag">
545 <input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
546 <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
547 </div>
548 </p>
549 <div class="tagchecklist"></div>
550 </div>
551 <p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags in Post Tags'); ?></a></p>
552 </div>
553 </div>
554 </div>
555 </div>
556 <div class="posting">
557 <?php if ( isset($posted) && intval($posted) ) { $post_ID = intval($posted); ?>
558 <div id="message" class="updated"><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>
559 <?php } ?>
560
561 <div id="titlediv">
562 <div class="titlewrap">
563 <input name="title" id="title" class="text" value="<?php echo esc_attr($title);?>"/>
564 </div>
565 </div>
566
567 <div id="extra-fields" style="display: none"></div>
568
569 <div class="postdivrich">
570 <ul id="actions" class="actions">
571
572 <li id="photo_button">
573 Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#">
574<img alt="<?php _e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a>
575 <?php } ?>
576 </li>
577 <li id="video_button">
578 <a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a>
579 </li>
580 <?php if ( user_can_richedit() ) { ?>
581 <li id="switcher">
582 <?php wp_print_scripts( 'quicktags' ); ?>
583 <?php add_filter('the_editor_content', 'wp_richedit_pre'); ?>
584 <a id="edButtonHTML" onclick="switchEditors.go('content', 'html');"><?php _e('HTML'); ?></a>
585 <a id="edButtonPreview" class="active" onclick="switchEditors.go('content', 'tinymce');"><?php _e('Visual'); ?></a>
586 <div class="zerosize"><input accesskey="e" type="button" onclick="switchEditors.go('content')" /></div>
587 </li>
588 <?php } ?>
589 </ul>
590 <div id="quicktags"></div>
591 <div class="editor-container">
592 <textarea name="content" id="content" style="width:100%;" class="theEditor" rows="15"><?php
593 if ( $selection )
594 echo wp_richedit_pre($selection);
595 if ( $url ) {
596 echo '<p>';
597 if ( $selection )
598 _e('via ');
599 printf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
600 }
601 ?></textarea>
602 </div>
603 </div>
604 </div>
605</div>
606</form>
607<?php do_action('admin_print_footer_scripts'); ?>
608<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
609</body>
610</html>
611
/var/www/wordpress/wp-admin/profile.php
/var/www/wordpress/wp-admin/revision.php
/var/www/wordpress/wp-admin/setup-config.php
/var/www/wordpress/wp-admin/sidebar.php
/var/www/wordpress/wp-admin/theme-editor.php
/var/www/wordpress/wp-admin/theme-install.php
/var/www/wordpress/wp-admin/themes.php
/var/www/wordpress/wp-admin/tools.php
/var/www/wordpress/wp-admin/update-core.php
/var/www/wordpress/wp-admin/update.php
/var/www/wordpress/wp-admin/upgrade-functions.php
/var/www/wordpress/wp-admin/upgrade.php
/var/www/wordpress/wp-admin/upload.php
/var/www/wordpress/wp-admin/user-edit.php
/var/www/wordpress/wp-admin/user-new.php
/var/www/wordpress/wp-admin/users.php
/var/www/wordpress/wp-admin/widgets.php
/var/www/wordpress/wp-content/languages/ru_RU.php
/var/www/wordpress/wp-content/plugins/akismet/akismet.php
/var/www/wordpress/wp-content/plugins/rh/rh.php
/var/www/wordpress/wp-content/plugins/hello.php
/var/www/wordpress/wp-content/plugins/index.php
/var/www/wordpress/wp-content/themes/twentyten/404.php
/var/www/wordpress/wp-content/themes/twentyten/archive.php
/var/www/wordpress/wp-content/themes/twentyten/attachment.php
/var/www/wordpress/wp-content/themes/twentyten/author.php
/var/www/wordpress/wp-content/themes/twentyten/category.php
/var/www/wordpress/wp-content/themes/twentyten/comments.php
/var/www/wordpress/wp-content/themes/twentyten/footer.php
/var/www/wordpress/wp-content/themes/twentyten/functions.php
/var/www/wordpress/wp-content/themes/twentyten/header.php
/var/www/wordpress/wp-content/themes/twentyten/index.php
/var/www/wordpress/wp-content/themes/twentyten/loop.php
/var/www/wordpress/wp-content/themes/twentyten/onecolumn-page.php
/var/www/wordpress/wp-content/themes/twentyten/page.php
/var/www/wordpress/wp-content/themes/twentyten/search.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar-footer.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar.php
/var/www/wordpress/wp-content/themes/twentyten/single.php
/var/www/wordpress/wp-content/themes/twentyten/tag.php
/var/www/wordpress/wp-content/themes/index.php
/var/www/wordpress/wp-content/index.php
/var/www/wordpress/wp-includes/js/tinymce/langs/wp-langs.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/Logger.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/includes/general.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/config.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/rpc.php
/var/www/wordpress/wp-includes/js/tinymce/wp-mce-help.php
/var/www/wordpress/wp-includes/js/tinymce/wp-tinymce.php
/var/www/wordpress/wp-includes/pomo/entry.php
/var/www/wordpress/wp-includes/pomo/mo.php
/var/www/wordpress/wp-includes/pomo/po.php
/var/www/wordpress/wp-includes/pomo/streams.php
/var/www/wordpress/wp-includes/pomo/translations.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/native.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/shell.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/string.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/xdiff.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer/inline.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer.php
/var/www/wordpress/wp-includes/Text/Diff.php
/var/www/wordpress/wp-includes/theme-compat/comments-popup.php
/var/www/wordpress/wp-includes/theme-compat/comments.php
/var/www/wordpress/wp-includes/theme-compat/footer.php
/var/www/wordpress/wp-includes/theme-compat/header.php
/var/www/wordpress/wp-includes/theme-compat/sidebar.php
/var/www/wordpress/wp-includes/atomlib.php
/var/www/wordpress/wp-includes/author-template.php
/var/www/wordpress/wp-includes/bookmark-template.php
/var/www/wordpress/wp-includes/bookmark.php
/var/www/wordpress/wp-includes/cache.php
/var/www/wordpress/wp-includes/canonical.php
/var/www/wordpress/wp-includes/capabilities.php
/var/www/wordpress/wp-includes/category-template.php
/var/www/wordpress/wp-includes/category.php
/var/www/wordpress/wp-includes/class-feed.php
/var/www/wordpress/wp-includes/class-http.php
/var/www/wordpress/wp-includes/class-IXR.php
/var/www/wordpress/wp-includes/class-json.php
/var/www/wordpress/wp-includes/class-oembed.php
/var/www/wordpress/wp-includes/class-phpass.php
/var/www/wordpress/wp-includes/class-phpmailer.php
/var/www/wordpress/wp-includes/class-pop3.php
/var/www/wordpress/wp-includes/class-simplepie.php
/var/www/wordpress/wp-includes/class-smtp.php
/var/www/wordpress/wp-includes/class-snoopy.php
/var/www/wordpress/wp-includes/class.wp-dependencies.php
/var/www/wordpress/wp-includes/class.wp-scripts.php
/var/www/wordpress/wp-includes/class.wp-styles.php
/var/www/wordpress/wp-includes/classes.php
/var/www/wordpress/wp-includes/comment-template.php
/var/www/wordpress/wp-includes/comment.php
/var/www/wordpress/wp-includes/compat.php
/var/www/wordpress/wp-includes/cron.php
/var/www/wordpress/wp-includes/default-constants.php
/var/www/wordpress/wp-includes/default-embeds.php
/var/www/wordpress/wp-includes/default-filters.php
/var/www/wordpress/wp-includes/default-widgets.php
/var/www/wordpress/wp-includes/deprecated.php
/var/www/wordpress/wp-includes/feed-atom-comments.php
/var/www/wordpress/wp-includes/feed-atom.php
/var/www/wordpress/wp-includes/feed-rdf.php
/var/www/wordpress/wp-includes/feed-rss.php
/var/www/wordpress/wp-includes/feed-rss2-comments.php
/var/www/wordpress/wp-includes/feed-rss2.php
/var/www/wordpress/wp-includes/feed.php
/var/www/wordpress/wp-includes/formatting.php
/var/www/wordpress/wp-includes/functions.php
/var/www/wordpress/wp-includes/functions.wp-scripts.php
/var/www/wordpress/wp-includes/functions.wp-styles.php
/var/www/wordpress/wp-includes/general-template.php
/var/www/wordpress/wp-includes/http.php
/var/www/wordpress/wp-includes/kses.php
/var/www/wordpress/wp-includes/l10n.php
/var/www/wordpress/wp-includes/link-template.php
/var/www/wordpress/wp-includes/load.php
/var/www/wordpress/wp-includes/locale.php
/var/www/wordpress/wp-includes/media.php
/var/www/wordpress/wp-includes/meta.php
/var/www/wordpress/wp-includes/ms-blogs.php
/var/www/wordpress/wp-includes/ms-default-constants.php
/var/www/wordpress/wp-includes/ms-default-filters.php
/var/www/wordpress/wp-includes/ms-deprecated.php
/var/www/wordpress/wp-includes/ms-files.php
/var/www/wordpress/wp-includes/ms-functions.php
/var/www/wordpress/wp-includes/ms-load.php
/var/www/wordpress/wp-includes/ms-settings.php
/var/www/wordpress/wp-includes/nav-menu-template.php
/var/www/wordpress/wp-includes/nav-menu.php
/var/www/wordpress/wp-includes/pluggable-deprecated.php
/var/www/wordpress/wp-includes/pluggable.php
/var/www/wordpress/wp-includes/plugin.php
/var/www/wordpress/wp-includes/post-template.php
/var/www/wordpress/wp-includes/post-thumbnail-template.php
/var/www/wordpress/wp-includes/post.php
/var/www/wordpress/wp-includes/query.php
/var/www/wordpress/wp-includes/registration-functions.php
/var/www/wordpress/wp-includes/registration.php
/var/www/wordpress/wp-includes/rewrite.php
/var/www/wordpress/wp-includes/rss-functions.php
/var/www/wordpress/wp-includes/rss.php
/var/www/wordpress/wp-includes/script-loader.php
/var/www/wordpress/wp-includes/shortcodes.php
/var/www/wordpress/wp-includes/taxonomy.php
/var/www/wordpress/wp-includes/template-loader.php
/var/www/wordpress/wp-includes/theme.php
/var/www/wordpress/wp-includes/update.php
/var/www/wordpress/wp-includes/user.php
/var/www/wordpress/wp-includes/vars.php
/var/www/wordpress/wp-includes/version.php
/var/www/wordpress/wp-includes/widgets.php
/var/www/wordpress/wp-includes/wp-db.php
/var/www/wordpress/wp-includes/wp-diff.php
/var/www/wordpress/index.php
/var/www/wordpress/wp-activate.php
/var/www/wordpress/wp-app.php
/var/www/wordpress/wp-atom.php
/var/www/wordpress/wp-blog-header.php
/var/www/wordpress/wp-comments-post.php
/var/www/wordpress/wp-commentsrss2.php
/var/www/wordpress/wp-config-sample.php
/var/www/wordpress/wp-cron.php
/var/www/wordpress/wp-feed.php
/var/www/wordpress/wp-links-opml.php
/var/www/wordpress/wp-load.php
/var/www/wordpress/wp-login.php
/var/www/wordpress/wp-mail.php
/var/www/wordpress/wp-pass.php
/var/www/wordpress/wp-rdf.php
/var/www/wordpress/wp-register.php
/var/www/wordpress/wp-rss.php
/var/www/wordpress/wp-rss2.php
/var/www/wordpress/wp-settings.php
/var/www/wordpress/wp-signup.php
/var/www/wordpress/wp-trackback.php
/var/www/wordpress/xmlrpc.php