New custom field functionality.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
07a395f685
commit
95a1e1d28f
|
@ -232,8 +232,8 @@ function list_meta($meta) {
|
|||
<tr $style>
|
||||
<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' value='{$entry['meta_key']}' /></td>
|
||||
<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='40'>{$entry['meta_value']}</textarea></td>
|
||||
<td align='center'><input name='updatemeta' type='submit' id='updatemeta' tabindex='6' value='" . __('Update') ."' /></td>
|
||||
<td align='center'><input name='deletemeta[{$entry['meta_id']}]' type='submit' id='deletemeta' tabindex='6' value='" . __('Delete') ."' /></td>
|
||||
<td align='center'><input name='updatemeta' type='submit' class='updatemeta' tabindex='6' value='" . __('Update') ."' /></td>
|
||||
<td align='center'><input name='deletemeta[{$entry['meta_id']}]' type='submit' class='deletemeta' tabindex='6' value='" . __('Delete') ."' /></td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
@ -256,9 +256,15 @@ function get_meta_keys() {
|
|||
}
|
||||
|
||||
function meta_form() {
|
||||
$keys = get_meta_keys();
|
||||
global $wpdb, $tablepostmeta;
|
||||
$keys = $wpdb->get_col("
|
||||
SELECT meta_key
|
||||
FROM $tablepostmeta
|
||||
GROUP BY meta_key
|
||||
ORDER BY meta_id DESC
|
||||
LIMIT 10");
|
||||
?>
|
||||
<h3><?php _e('Add new custom data to this post:') ?></h3>
|
||||
<h3><?php _e('Add a new custom field to this post:') ?></h3>
|
||||
<table width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<th colspan="2"><?php _e('Key') ?></th>
|
||||
|
@ -279,7 +285,7 @@ function meta_form() {
|
|||
</tr>
|
||||
|
||||
</table>
|
||||
<p class="submit"><input type="submit" id="save" name="save" value="<?php _e('Add Custom Fields »') ?>"></p>
|
||||
<p class="submit"><input type="submit" name="updatemeta" value="<?php _e('Add Custom Field »') ?>"></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
@ -308,10 +314,16 @@ function add_meta($post_ID) {
|
|||
}
|
||||
} // add_meta
|
||||
|
||||
function del_meta($mid) {
|
||||
function delete_meta($mid) {
|
||||
global $wpdb, $tablepostmeta;
|
||||
|
||||
$result = $wpdb->query("DELETE FROM $tablepostmeta WHERE meta_id = '$mid'");
|
||||
}
|
||||
|
||||
function update_meta($mid, $mkey, $mvalue) {
|
||||
global $wpdb, $tablepostmeta;
|
||||
|
||||
return $wpdb->query("UPDATE $tablepostmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'");
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,11 @@
|
|||
|
||||
<?php
|
||||
$messages[1] = __('Post updated');
|
||||
$messages[2] = __('Custom field updated');
|
||||
$messages[3] = __('Custom field deleted.');
|
||||
?>
|
||||
<?php if ($_GET['message']) : ?>
|
||||
<div class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
|
||||
<?php endif; ?>
|
||||
<div class="wrap">
|
||||
<?php
|
||||
|
||||
|
@ -47,7 +54,7 @@ $saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="'
|
|||
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" name="action" value='<?php echo $form_action ?>' />
|
||||
<?php echo $form_extra ?>
|
||||
|
||||
<?php if (2 > $_GET['message']) : ?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function focusit() {
|
||||
|
@ -57,7 +64,7 @@ function focusit() {
|
|||
window.onload = focusit;
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<?php endif; ?>
|
||||
<div id="poststuff">
|
||||
<fieldset id="titlediv">
|
||||
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
|
||||
|
|
|
@ -4,27 +4,27 @@
|
|||
require_once('../wp-includes/wp-l10n.php');
|
||||
|
||||
function add_magic_quotes($array) {
|
||||
foreach ($array as $k => $v) {
|
||||
foreach ($array as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$array[$k] = add_magic_quotes($v);
|
||||
} else {
|
||||
$array[$k] = addslashes($v);
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
if (!get_magic_quotes_gpc()) {
|
||||
$_GET = add_magic_quotes($_GET);
|
||||
$_POST = add_magic_quotes($_POST);
|
||||
$_COOKIE = add_magic_quotes($_COOKIE);
|
||||
$_GET = add_magic_quotes($_GET);
|
||||
$_POST = add_magic_quotes($_POST);
|
||||
$_COOKIE = add_magic_quotes($_COOKIE);
|
||||
}
|
||||
|
||||
$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder');
|
||||
|
||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
$wpvar = $wpvarstoreset[$i];
|
||||
if (!isset($$wpvar)) {
|
||||
$wpvar = $wpvarstoreset[$i];
|
||||
if (!isset($$wpvar)) {
|
||||
if (empty($_POST["$wpvar"])) {
|
||||
if (empty($_GET["$wpvar"])) {
|
||||
$$wpvar = '';
|
||||
|
@ -34,26 +34,13 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
|||
} else {
|
||||
$$wpvar = $_POST["$wpvar"];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch($action) {
|
||||
|
||||
case 'deletemeta':
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
|
||||
$post_ID = intval($_GET['post']);
|
||||
|
||||
$location = "post.php?action=edit&post=$post_ID";
|
||||
|
||||
del_meta($_GET['meta_id']);
|
||||
|
||||
header("Location: $location");
|
||||
|
||||
break;
|
||||
|
||||
case 'post':
|
||||
case 'post':
|
||||
|
||||
$standalone = 1;
|
||||
require_once('admin-header.php');
|
||||
|
@ -213,7 +200,7 @@ switch($action) {
|
|||
exit();
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
case 'edit':
|
||||
$title = __('Edit');
|
||||
|
||||
$standalone = 0;
|
||||
|
@ -246,14 +233,14 @@ switch($action) {
|
|||
include(ABSPATH.'wp-blog-header.php');
|
||||
start_wp();
|
||||
?>
|
||||
<div id='preview' class='wrap'>
|
||||
<div id='preview' class='wrap'>
|
||||
<h2><?php _e('Post Preview (updated when post is saved)'); ?></h2>
|
||||
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__("Permanent Link: %s"), the_title()); ?>"><?php the_title(); ?></a></h3>
|
||||
<div class="meta"><?php printf(__("Filed under: %s"), the_category()); ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
|
||||
|
||||
<div class="storycontent">
|
||||
<div class="storycontent">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
|
@ -266,8 +253,8 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
}
|
||||
break;
|
||||
|
||||
case 'editpost':
|
||||
|
||||
case 'editpost':
|
||||
//die(var_dump('<pre>', $_POST));
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
|
||||
|
@ -330,8 +317,8 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
$datemodif_gmt = '';
|
||||
}
|
||||
|
||||
$now = current_time('mysql');
|
||||
$now_gmt = current_time('mysql', 1);
|
||||
$now = current_time('mysql');
|
||||
$now_gmt = current_time('mysql', 1);
|
||||
|
||||
$result = $wpdb->query("
|
||||
UPDATE $tableposts SET
|
||||
|
@ -397,10 +384,27 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
}
|
||||
} // end if publish
|
||||
|
||||
// Meta Stuff
|
||||
if ($_POST['meta']) :
|
||||
foreach ($_POST['meta'] as $key => $value) :
|
||||
update_meta($key, $value['key'], $value['value']);
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if ($_POST['deletemeta']) :
|
||||
foreach ($_POST['deletemeta'] as $key => $value) :
|
||||
delete_meta($key);
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
add_meta($post_ID);
|
||||
|
||||
if ($_POST['save']) {
|
||||
$location = $_SERVER['HTTP_REFERER'];
|
||||
} elseif ($_POST['updatemeta']) {
|
||||
$location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom';
|
||||
} elseif ($_POST['deletemeta']) {
|
||||
$location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom';
|
||||
} else {
|
||||
$location = 'post.php';
|
||||
}
|
||||
|
@ -408,7 +412,7 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
do_action('edit_post', $post_ID);
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
case 'delete':
|
||||
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
|
@ -450,7 +454,7 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
do_action('delete_post', $post_ID);
|
||||
break;
|
||||
|
||||
case 'editcomment':
|
||||
case 'editcomment':
|
||||
$title = __('Edit Comment');
|
||||
$standalone = 0;
|
||||
$parent_file = 'edit.php';
|
||||
|
@ -471,165 +475,165 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
|
||||
break;
|
||||
|
||||
case 'confirmdeletecomment':
|
||||
case 'confirmdeletecomment':
|
||||
|
||||
$standalone = 0;
|
||||
require_once('./admin-header.php');
|
||||
$standalone = 0;
|
||||
require_once('./admin-header.php');
|
||||
|
||||
if ($user_level == 0)
|
||||
if ($user_level == 0)
|
||||
die (__('Cheatin’ uh?'));
|
||||
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
|
||||
echo "<div class=\"wrap\">\n";
|
||||
echo "<p><?php __('<strong>Caution:</strong> You are about to delete the following comment:'); ?></p>\n";
|
||||
echo "<table border=\"0\">\n";
|
||||
echo "<tr><td>" . __('Author:') . "</td><td>" . $commentdata["comment_author"] . "</td></tr>\n";
|
||||
echo "<tr><td>" . __('E-Mail:') . "</td><td>" . $commentdata["comment_author_email"] . "</td></tr>\n";
|
||||
echo "<tr><td>". __('URL:') . "</td><td>" . $commentdata["comment_author_url"] . "</td></tr>\n";
|
||||
echo "<tr><td>". __('Comment:') . "</td><td>" . stripslashes($commentdata["comment_content"]) . "</td></tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<p>" . __('Are you sure you want to do that?') . "</p>\n";
|
||||
echo "<div class=\"wrap\">\n";
|
||||
echo "<p><?php __('<strong>Caution:</strong> You are about to delete the following comment:'); ?></p>\n";
|
||||
echo "<table border=\"0\">\n";
|
||||
echo "<tr><td>" . __('Author:') . "</td><td>" . $commentdata["comment_author"] . "</td></tr>\n";
|
||||
echo "<tr><td>" . __('E-Mail:') . "</td><td>" . $commentdata["comment_author_email"] . "</td></tr>\n";
|
||||
echo "<tr><td>". __('URL:') . "</td><td>" . $commentdata["comment_author_url"] . "</td></tr>\n";
|
||||
echo "<tr><td>". __('Comment:') . "</td><td>" . stripslashes($commentdata["comment_content"]) . "</td></tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<p>" . __('Are you sure you want to do that?') . "</p>\n";
|
||||
|
||||
echo "<form action='".get_settings('siteurl')."/wp-admin/post.php' method='get'>\n";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"deletecomment\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"comment\" value=\"$comment\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"noredir\" value=\"1\" />\n";
|
||||
echo "<input type=\"submit\" value=\"" . __('Yes') . "\" />";
|
||||
echo " ";
|
||||
echo "<input type=\"button\" value=\"" . __('No') . "\" onClick=\"self.location='". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments';\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
echo "<form action='".get_settings('siteurl')."/wp-admin/post.php' method='get'>\n";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"deletecomment\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"comment\" value=\"$comment\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"noredir\" value=\"1\" />\n";
|
||||
echo "<input type=\"submit\" value=\"" . __('Yes') . "\" />";
|
||||
echo " ";
|
||||
echo "<input type=\"button\" value=\"" . __('No') . "\" onClick=\"self.location='". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments';\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'deletecomment':
|
||||
case 'deletecomment':
|
||||
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
|
||||
if ($user_level == 0)
|
||||
if ($user_level == 0)
|
||||
die (__('Cheatin’ uh?'));
|
||||
|
||||
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
if (isset($_GET['noredir'])) {
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
if (isset($_GET['noredir'])) {
|
||||
$noredir = true;
|
||||
} else {
|
||||
} else {
|
||||
$noredir = false;
|
||||
}
|
||||
}
|
||||
|
||||
$postdata = get_postdata($p) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php'));
|
||||
$postdata = get_postdata($p) or die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php'));
|
||||
|
||||
$authordata = get_userdata($postdata['Author_ID']);
|
||||
if ($user_level < $authordata->user_level)
|
||||
$authordata = get_userdata($postdata['Author_ID']);
|
||||
if ($user_level < $authordata->user_level)
|
||||
die (sprintf(__('You don’t have the right to delete <strong>%1$s</strong>’s post comments. <a href="%2$s">Go back</a>!'), $authordata->user_nickname, 'post.php'));
|
||||
|
||||
wp_set_comment_status($comment, "delete");
|
||||
do_action('delete_comment', $comment);
|
||||
wp_set_comment_status($comment, "delete");
|
||||
do_action('delete_comment', $comment);
|
||||
|
||||
if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
} else {
|
||||
} else {
|
||||
header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'unapprovecomment':
|
||||
case 'unapprovecomment':
|
||||
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
|
||||
if ($user_level == 0)
|
||||
if ($user_level == 0)
|
||||
die (__('Cheatin’ uh?'));
|
||||
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
if (isset($_GET['noredir'])) {
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
if (isset($_GET['noredir'])) {
|
||||
$noredir = true;
|
||||
} else {
|
||||
} else {
|
||||
$noredir = false;
|
||||
}
|
||||
}
|
||||
|
||||
$commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
$commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
|
||||
wp_set_comment_status($comment, "hold");
|
||||
wp_set_comment_status($comment, "hold");
|
||||
|
||||
if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
} else {
|
||||
} else {
|
||||
header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'mailapprovecomment':
|
||||
case 'mailapprovecomment':
|
||||
|
||||
$standalone = 0;
|
||||
require_once('./admin-header.php');
|
||||
$standalone = 0;
|
||||
require_once('./admin-header.php');
|
||||
|
||||
if ($user_level == 0)
|
||||
if ($user_level == 0)
|
||||
die (__('Cheatin’ uh?'));
|
||||
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
$commentdata = get_commentdata($comment, 1, true) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
|
||||
wp_set_comment_status($comment, "approve");
|
||||
if (get_settings("comments_notify") == true) {
|
||||
wp_set_comment_status($comment, "approve");
|
||||
if (get_settings("comments_notify") == true) {
|
||||
wp_notify_postauthor($comment);
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class=\"wrap\">\n";
|
||||
echo "<p>" . __('Comment has been approved.') . "</p>\n";
|
||||
echo "<div class=\"wrap\">\n";
|
||||
echo "<p>" . __('Comment has been approved.') . "</p>\n";
|
||||
|
||||
echo "<form action=\"". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n";
|
||||
echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"c\" value=\"1\" />\n";
|
||||
echo "<input type=\"submit\" value=\"" . __('Ok') . "\" />";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
echo "<form action=\"". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n";
|
||||
echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"c\" value=\"1\" />\n";
|
||||
echo "<input type=\"submit\" value=\"" . __('Ok') . "\" />";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'approvecomment':
|
||||
case 'approvecomment':
|
||||
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
|
||||
if ($user_level == 0)
|
||||
if ($user_level == 0)
|
||||
die (__('Cheatin’ uh?'));
|
||||
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
if (isset($_GET['noredir'])) {
|
||||
$comment = $_GET['comment'];
|
||||
$p = $_GET['p'];
|
||||
if (isset($_GET['noredir'])) {
|
||||
$noredir = true;
|
||||
} else {
|
||||
} else {
|
||||
$noredir = false;
|
||||
}
|
||||
$commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
}
|
||||
$commentdata = get_commentdata($comment) or die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
|
||||
|
||||
wp_set_comment_status($comment, "approve");
|
||||
if (get_settings("comments_notify") == true) {
|
||||
wp_set_comment_status($comment, "approve");
|
||||
if (get_settings("comments_notify") == true) {
|
||||
wp_notify_postauthor($comment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
if (($_SERVER['HTTP_REFERER'] != "") && (false == $noredir)) {
|
||||
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
||||
} else {
|
||||
} else {
|
||||
header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'editedcomment':
|
||||
case 'editedcomment':
|
||||
|
||||
$standalone = 1;
|
||||
require_once('./admin-header.php');
|
||||
|
@ -679,7 +683,7 @@ When you’re promoted, just reload this page and you’ll be able to bl
|
|||
do_action('edit_comment', $comment_ID);
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
$standalone = 0;
|
||||
$title = __('Create New Post');
|
||||
require_once ('./admin-header.php');
|
||||
|
@ -733,31 +737,31 @@ $bookmarklet_height= (get_settings('use_trackback')) ? 460 : 420;
|
|||
|
||||
if ($is_NS4 || $is_gecko) {
|
||||
?>
|
||||
<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'<?php _e('WordPress bookmarklet') ?>','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));"><?php printf(__('Press It - %s'), get_settings('blogname')); ?></a>
|
||||
<?php
|
||||
<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'<?php _e('WordPress bookmarklet') ?>','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));"><?php printf(__('Press It - %s'), get_settings('blogname')); ?></a>
|
||||
<?php
|
||||
} else if ($is_winIE) {
|
||||
?>
|
||||
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
<!--
|
||||
function oneclickbookmarklet(blah) {
|
||||
window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=120, left=120, screenY=120, top=120");
|
||||
window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=500, height=450, location=0, menubar=0, resizable=0, scrollbars=1, status=1, titlebar=0, toolbar=0, screenX=120, left=120, screenY=120, top=120");
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
<br />
|
||||
<br />
|
||||
One-click bookmarklet:<br />
|
||||
<a href="javascript:oneclickbookmarklet(0);">click here</a>
|
||||
<?php
|
||||
<br />
|
||||
<br />
|
||||
One-click bookmarklet:<br />
|
||||
<a href="javascript:oneclickbookmarklet(0);">click here</a>
|
||||
<?php
|
||||
} else if ($is_opera) {
|
||||
?>
|
||||
<a href="javascript:void(window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
|
||||
<?php
|
||||
<a href="javascript:void(window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
|
||||
<?php
|
||||
} else if ($is_macIE) {
|
||||
?>
|
||||
<a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
|
||||
<?php
|
||||
<a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
|
|
|
@ -353,7 +353,7 @@ textarea, input, select {
|
|||
padding: .3em;
|
||||
}
|
||||
|
||||
#postcustom #updatemeta, #postcustom #deletemeta {
|
||||
#postcustom .updatemeta, #postcustom .deletemeta {
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue