diff --git a/wp-admin/b2edit.form.php b/wp-admin/b2edit.form.php index bda3eb1ed5..50e6999d9d 100644 --- a/wp-admin/b2edit.form.php +++ b/wp-admin/b2edit.form.php @@ -1,6 +1,10 @@
- - - + + + + +
-
- + + + + - - -

- -
+

+
+

+ +

+ +

+ +
+
+
4) { touch_time(($action == 'edit')); } +if ('edit' == $action) echo " +

Delete this post

"; ?> -
\ No newline at end of file diff --git a/wp-admin/b2edit.php b/wp-admin/b2edit.php index 94b42125d0..c78fdaa8f3 100644 --- a/wp-admin/b2edit.php +++ b/wp-admin/b2edit.php @@ -40,8 +40,8 @@ switch($action) { case 'post': $standalone = 1; - require_once('b2header.php'); - + require_once('b2header.php'); + $post_pingback = intval($HTTP_POST_VARS["post_pingback"]); $content = balanceTags($HTTP_POST_VARS["content"]); $content = format_to_post($content); @@ -49,6 +49,10 @@ switch($action) { $excerpt = format_to_post($excerpt); $post_title = addslashes($HTTP_POST_VARS["post_title"]); $post_category = intval($HTTP_POST_VARS["post_category"]); + $post_status = $HTTP_POST_VARS['post_status']; + $comment_status = $HTTP_POST_VARS['comment_status']; + $ping_status = $HTTP_POST_VARS['ping_status']; + $post_password = addslashes($HTTP_POST_VARS['post_password']); if ($user_level == 0) die ("Cheatin' uh ?"); @@ -69,7 +73,7 @@ switch($action) { $now = date("Y-m-d H:i:s", (time() + ($time_difference * 3600))); } - $query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt) VALUES ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt')"; + $query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt, post_status, comment_status, ping_status, post_password) VALUES ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password')"; $result = $wpdb->query($query); $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); @@ -118,9 +122,10 @@ switch($action) { $standalone = 0; require_once('b2header.php'); + $post = $HTTP_GET_VARS['post']; if ($user_level > 0) { - $postdata=get_postdata($post) or die('Oops, no post with this ID. Go back!'); + $postdata = get_postdata($post); $authordata = get_userdata($postdata["Author_ID"]); if ($user_level < $authordata[13]) die ('You don’t have the right to edit '.$authordata[1].'’s posts.'); @@ -130,9 +135,12 @@ switch($action) { $excerpt = $postdata['Excerpt']; $excerpt = format_to_edit($excerpt); $edited_post_title = format_to_edit($postdata['Title']); + $post_status = $postdata['post_status']; + $comment_status = $postdata['comment_status']; + $ping_status = $postdata['ping_status']; + $post_password = $postdata['post_password']; include('b2edit.form.php'); - } else { ?>

Since you're a newcomer, you'll have to wait for an admin to raise your level to 1, @@ -164,6 +172,10 @@ switch($action) { $excerpt = balanceTags($HTTP_POST_VARS["excerpt"]); $excerpt = format_to_post($excerpt); $post_title = addslashes($HTTP_POST_VARS["post_title"]); + $post_status = $HTTP_POST_VARS['post_status']; + $comment_status = $HTTP_POST_VARS['comment_status']; + $ping_status = $HTTP_POST_VARS['ping_status']; + $post_password = addslashes($HTTP_POST_VARS['post_password']); if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { $aa = $HTTP_POST_VARS["aa"]; @@ -178,10 +190,10 @@ switch($action) { $ss = ($ss > 59) ? $ss - 60 : $ss; $datemodif = ", post_date=\"$aa-$mm-$jj $hh:$mn:$ss\""; } else { - $datemodif = ""; + $datemodif = ''; } - $query = "UPDATE $tableposts SET post_content=\"$content\", post_excerpt=\"$excerpt\", post_title=\"$post_title\", post_category=\"$post_category\"".$datemodif." WHERE ID=$post_ID"; + $query = "UPDATE $tableposts SET post_content='$content', post_excerpt='$excerpt', post_title='$post_title', post_category='$post_category'".$datemodif.", post_status='$post_status', comment_status='$comment_status', ping_status='$ping_status', post_password='$post_password' WHERE ID = $post_ID"; $result = $wpdb->query($query); if (isset($sleep_after_edit) && $sleep_after_edit > 0) { @@ -282,7 +294,6 @@ switch($action) { $newcomment_author = addslashes($newcomment_author); $newcomment_author_email = addslashes($newcomment_author_email); $newcomment_author_url = addslashes($newcomment_author_url); - $post_autobr = $HTTP_POST_VARS["post_autobr"]; if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { $aa = $HTTP_POST_VARS["aa"]; @@ -317,7 +328,24 @@ switch($action) { if ($user_level > 0) { if ((!$withcomments) && (!$c)) { - $action="post"; + $action = 'post'; + get_currentuserinfo(); + $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID"); + if ($drafts) { + ?> +

+

Your Drafts: + ID' title='Edit this draft'>$draft->post_title"; + ++$i; + } + ?>.

+
+
"; @@ -325,12 +353,13 @@ switch($action) { } else { - echo $tabletop; + ?> +

Since you're a newcomer, you'll have to wait for an admin to raise your level to 1, in order to be authorized to post.
You can also e-mail the admin to ask for a promotion.
When you're promoted, just reload this page and you'll be able to blog. :)

+

"; + } include("b2edit.showposts.php"); diff --git a/wp-admin/b2edit.showposts.php b/wp-admin/b2edit.showposts.php index 3dc398af71..862e5c6e2c 100644 --- a/wp-admin/b2edit.showposts.php +++ b/wp-admin/b2edit.showposts.php @@ -233,7 +233,7 @@ if ($i == "ASC") $posts_per_page = 10; start_b2(); ?>

- [ + [ $authordata[13]) or ($user_login == $authordata[1])) { echo " - Edit"; echo " - post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete "; } + if ('private' == $post->post_status) echo ' - Private'; ?> ]