Fixes #967, Fixes #972, Fixes #1578, Fixes #1580, Fixes #1567, Fixes #1481, Fixes #1186

git-svn-id: http://svn.automattic.com/wordpress/branches/1.5@2780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-08-14 18:06:02 +00:00
parent ec02dedc48
commit 626c316ed1
8 changed files with 48 additions and 19 deletions

View File

@ -34,6 +34,7 @@ case 'addcat':
$cat = intval($_POST['cat']);
$wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
do_action('add_category', $wpdb->insert_id);
header('Location: categories.php?message=1#addcat');
break;
@ -57,6 +58,7 @@ case 'delete':
$wpdb->query("UPDATE $wpdb->categories SET category_parent = '$cat_parent' WHERE category_parent = '$cat_ID'");
// TODO: Only set categories to general if they're not in another category already
$wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'");
do_action('delete_category', $cat_ID);
header('Location: categories.php?message=2');

View File

@ -85,12 +85,17 @@ edCanvas = document.getElementById('content');
</script>
<p class="submit">
<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php $post_ID ? _e('Edit Page') :_e('Create New Page') ?> &raquo;" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
<?php if ( $post_ID ) : ?>
<input name="save" type="submit" id="save" tabindex="5" value=" <?php _e('Save and Continue Editing'); ?> "/>
<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php $post_ID ? _e('Edit Page') : _e('Create New Page') ?> &raquo;" />
<?php else : ?>
<input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php _e('Create New Page') ?> &raquo;" />
<?php endif; ?>
<input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
</p>
<fieldset id="pageoptions">
<legend><?php _e('Page Options') ?></legend>
<legend><?php _e('Page Options') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<?php if ( 0 != count( get_page_templates() ) ) { ?>
<tr valign="top">

View File

@ -195,10 +195,9 @@ case 'post':
if ('publish' == $post_status) {
do_action('publish_post', $post_ID);
if ($post_pingback)
pingback($content, $post_ID);
do_enclose( $content, $post_ID );
do_trackbacks($post_ID);
register_shutdown_function('pingback', $content, $post_ID);
register_shutdown_function('do_enclose', $content, $post_ID );
register_shutdown_function('do_trackbacks', $post_ID);
}
if ($post_status == 'static') {
@ -434,10 +433,10 @@ case 'editpost':
if ($post_status == 'publish') {
do_action('publish_post', $post_ID);
do_trackbacks($post_ID);
do_enclose( $content, $post_ID );
register_shutdown_function('do_trackbacks', $post_ID);
register_shutdown_function('do_enclose', $content, $post_ID );
if ( get_option('default_pingback_flag') )
pingback($content, $post_ID);
register_shutdown_function('pingback', $content, $post_ID);
}
if ($post_status == 'static') {

View File

@ -72,7 +72,9 @@ case 'adduser':
(user_login, user_pass, user_nickname, user_email, user_ip, user_domain, user_browser, user_registered, user_level, user_idmode, user_firstname, user_lastname, user_nicename, user_url)
VALUES
('$user_login', MD5('$pass1'), '$user_nickname', '$user_email', '$user_ip', '$user_domain', '$user_browser', '$now', '$new_users_can_blog', 'nickname', '$user_firstname', '$user_lastname', '$user_nicename', '$user_uri')");
do_action('user_register', $wpdb->insert_id);
if ($result == false)
die (__('<strong>ERROR</strong>: Couldn&#8217;t register you!'));
@ -96,7 +98,7 @@ case 'promote':
header('Location: users.php');
}
$id = $_GET['id'];
$id = (int) $_GET['id'];
$prom = $_GET['prom'];
$user_data = get_userdata($id);
@ -108,12 +110,11 @@ case 'promote':
if ('up' == $prom) {
$new_level = $usertopromote_level + 1;
$sql="UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level";
$wpdb->query("UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level");
} elseif ('down' == $prom) {
$new_level = $usertopromote_level - 1;
$sql="UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level";
$wpdb->query("UPDATE $wpdb->users SET user_level=$new_level WHERE ID = $id AND $new_level < $user_level");
}
$result = $wpdb->query($sql);
header('Location: users.php');

View File

@ -216,6 +216,10 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>";
}
$notify_message = apply_filters('comment_notification_text', $notify_message);
$subject = apply_filters('comment_notification_subject', $subject);
$message_headers = apply_filters('comment_notification_headers', $message_headers);
$message_headers = "MIME-Version: 1.0\n"
. "$from\n"
. "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
@ -240,7 +244,6 @@ function wp_notify_moderator($comment_id) {
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1");
$comment_author_domain = gethostbyaddr($comment->comment_author_IP);
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
@ -260,6 +263,9 @@ function wp_notify_moderator($comment_id) {
$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title );
$admin_email = get_settings("admin_email");
$notify_message = apply_filters('comment_moderation_text', $notify_message);
$subject = apply_filters('comment_moderation_subject', $subject);
@wp_mail($admin_email, $subject, $notify_message);
return true;

View File

@ -262,6 +262,8 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
}
}
$exclusions = apply_filters('list_cats_exclusions', $exclusions);
if (intval($categories)==0){
$sort_column = 'cat_'.$sort_column;

View File

@ -2,6 +2,6 @@
// This just holds the version number, in a separate file so we can bump it without cluttering the SVN
$wp_version = '1.5.1.3';
$wp_version = '1.5.2';
?>

View File

@ -576,7 +576,14 @@ class wp_xmlrpc_server extends IXR_Server {
logIO('O', "Posted ! ID: $post_ID");
// FIXME: do we pingback always? pingback($content, $post_ID);
trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID);
// trackback_url_list($content_struct['mt_tb_ping_urls'],$post_ID);
if ('publish' == $post_status) {
if ($post_pingback) pingback($content, $post_ID);
do_enclose( $content, $post_ID );
do_trackbacks($post_ID);
do_action('publish_post', $post_ID);
}
return strval($post_ID);
}
@ -660,7 +667,14 @@ class wp_xmlrpc_server extends IXR_Server {
logIO('O',"(MW) Edited ! ID: $post_ID");
// FIXME: do we pingback always? pingback($content, $post_ID);
trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID);
// trackback_url_list($content_struct['mt_tb_ping_urls'], $post_ID);
if ('publish' == $post_status) {
if ($post_pingback) pingback($content, $post_ID);
do_enclose( $content, $post_ID );
do_trackbacks($post_ID);
do_action('publish_post', $post_ID);
}
do_action('edit_post', $post_ID);
return true;
}