mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-06 18:20:08 +00:00
New status fields.
git-svn-id: https://develop.svn.wordpress.org/trunk@143 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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. <a href="b2edit.php">Go back</a>!');
|
||||
$postdata = get_postdata($post);
|
||||
$authordata = get_userdata($postdata["Author_ID"]);
|
||||
if ($user_level < $authordata[13])
|
||||
die ('You don’t have the right to edit <strong>'.$authordata[1].'</strong>’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 {
|
||||
?>
|
||||
<p>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) {
|
||||
?>
|
||||
<div class="wrap">
|
||||
<p><strong>Your Drafts:</strong>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($drafts as $draft) {
|
||||
if (0 != $i) echo ', ';
|
||||
echo "<a href='b2edit.php?action=edit&post=$draft->ID' title='Edit this draft'>$draft->post_title</a>";
|
||||
++$i;
|
||||
}
|
||||
?>.</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
include("b2edit.form.php");
|
||||
echo "<br /><br />";
|
||||
|
||||
@@ -325,12 +353,13 @@ switch($action) {
|
||||
|
||||
} else {
|
||||
|
||||
echo $tabletop;
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<p>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.<br />You can also <a href="mailto:<?php echo $admin_email ?>?subject=b2-promotion">e-mail the admin</a> to ask for a promotion.<br />When you're promoted, just reload this page and you'll be able to blog. :)</p>
|
||||
</div>
|
||||
<?php
|
||||
echo $tablebottom;
|
||||
echo "<br /><br />";
|
||||
|
||||
}
|
||||
|
||||
include("b2edit.showposts.php");
|
||||
|
||||
Reference in New Issue
Block a user