2003-05-23 10:29:51 +02:00
|
|
|
<?php
|
2003-06-01 13:43:03 +02:00
|
|
|
$mode = 'bookmarklet';
|
2004-10-19 18:01:13 +02:00
|
|
|
require_once('admin.php');
|
2003-05-23 10:29:51 +02:00
|
|
|
|
2005-07-17 21:29:55 +02:00
|
|
|
if ( ! current_user_can('edit_posts') )
|
2006-07-10 07:29:10 +02:00
|
|
|
wp_die(__('Cheatin’ uh?'));
|
2003-05-23 10:29:51 +02:00
|
|
|
|
2005-10-28 10:43:23 +02:00
|
|
|
if ('b' == $a):
|
2004-08-01 10:04:16 +02:00
|
|
|
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
2003-05-23 10:29:51 +02:00
|
|
|
<head>
|
2004-08-01 10:04:16 +02:00
|
|
|
<script type="text/javascript">
|
2003-05-23 10:29:51 +02:00
|
|
|
<!--
|
|
|
|
window.close()
|
|
|
|
-->
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body></body>
|
2004-10-05 08:59:13 +02:00
|
|
|
</html>
|
|
|
|
<?php
|
2005-10-28 10:43:23 +02:00
|
|
|
exit;
|
|
|
|
endif;
|
|
|
|
|
|
|
|
$post = get_default_post_to_edit();
|
|
|
|
|
|
|
|
$popuptitle = wp_specialchars(stripslashes($popuptitle));
|
|
|
|
$text = wp_specialchars(stripslashes(urldecode($text)));
|
2006-02-12 08:53:23 +01:00
|
|
|
|
2005-10-28 10:43:23 +02:00
|
|
|
$popuptitle = funky_javascript_fix($popuptitle);
|
|
|
|
$text = funky_javascript_fix($text);
|
2006-02-12 08:53:23 +01:00
|
|
|
|
2005-10-28 10:43:23 +02:00
|
|
|
$post_title = wp_specialchars($_REQUEST['post_title']);
|
|
|
|
if (!empty($post_title))
|
|
|
|
$post->post_title = stripslashes($post_title);
|
|
|
|
else
|
|
|
|
$post->post_title = $popuptitle;
|
2006-02-12 08:53:23 +01:00
|
|
|
|
2006-11-19 08:56:05 +01:00
|
|
|
|
2005-10-28 10:43:23 +02:00
|
|
|
$content = wp_specialchars($_REQUEST['content']);
|
|
|
|
$popupurl = wp_specialchars($_REQUEST['popupurl']);
|
2006-11-19 08:56:05 +01:00
|
|
|
if ( !empty($content) ) {
|
|
|
|
$post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
|
|
|
|
} else {
|
|
|
|
$post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
|
|
|
|
}
|
2005-10-28 10:43:23 +02:00
|
|
|
|
2006-11-19 08:56:05 +01:00
|
|
|
/* /big funky fixes */
|
2004-01-03 01:13:11 +01:00
|
|
|
|
2003-05-23 10:29:51 +02:00
|
|
|
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
2004-08-01 10:04:16 +02:00
|
|
|
<title><?php bloginfo('name') ?> › Bookmarklet — WordPress</title>
|
2006-08-30 23:46:31 +02:00
|
|
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
2004-01-03 06:12:32 +01:00
|
|
|
<link rel="stylesheet" href="wp-admin.css" type="text/css" />
|
2003-05-23 10:29:51 +02:00
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
<!--
|
2003-06-01 13:43:03 +02:00
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
#wpbookmarklet textarea,input,select {
|
2003-05-23 10:29:51 +02:00
|
|
|
border-width: 1px;
|
|
|
|
border-color: #cccccc;
|
|
|
|
border-style: solid;
|
|
|
|
padding: 2px;
|
|
|
|
margin: 1px;
|
|
|
|
}
|
2003-06-01 13:43:03 +02:00
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
#wpbookmarklet .checkbox {
|
2003-05-23 10:29:51 +02:00
|
|
|
background-color: #ffffff;
|
|
|
|
border-width: 0px;
|
|
|
|
padding: 0px;
|
|
|
|
margin: 0px;
|
|
|
|
}
|
2003-06-01 13:43:03 +02:00
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
#wpbookmarklet textarea {
|
2003-05-23 10:29:51 +02:00
|
|
|
font-family: Verdana, Geneva, Arial, Helvetica;
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
#wpbookmarklet .wrap {
|
2006-11-19 08:56:05 +01:00
|
|
|
border: 0px;
|
2003-05-23 10:29:51 +02:00
|
|
|
}
|
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
#wpbookmarklet #postdiv {
|
2006-11-19 08:56:05 +01:00
|
|
|
margin-bottom: 0.5em;
|
2003-05-23 10:29:51 +02:00
|
|
|
}
|
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
#wpbookmarklet #titlediv {
|
2006-11-19 08:56:05 +01:00
|
|
|
margin-bottom: 1em;
|
2003-09-08 07:03:38 +02:00
|
|
|
}
|
2003-05-23 10:29:51 +02:00
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
-->
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body id="wpbookmarklet">
|
2004-08-01 10:04:16 +02:00
|
|
|
<div id="wphead">
|
|
|
|
<h1><?php bloginfo('name') ?></h1>
|
|
|
|
</div>
|
2003-05-23 10:29:51 +02:00
|
|
|
|
2004-01-03 01:13:11 +01:00
|
|
|
<?php require('edit-form.php'); ?>
|
2003-05-23 10:29:51 +02:00
|
|
|
|
2005-02-12 08:41:29 +01:00
|
|
|
<?php do_action('admin_footer', ''); ?>
|
|
|
|
|
2003-05-23 10:29:51 +02:00
|
|
|
</body>
|
2005-10-28 10:43:23 +02:00
|
|
|
</html>
|