Make WordPress Core


Ignore:
Timestamp:
06/01/2003 02:49:30 PM (23 years ago)
Author:
saxmatt
Message:

New status fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/b2edit.php

    r136 r143  
    4141
    4242        $standalone = 1;
    43         require_once('b2header.php');
    44 
     43        require_once('b2header.php');   
     44               
    4545        $post_pingback = intval($HTTP_POST_VARS["post_pingback"]);
    4646        $content = balanceTags($HTTP_POST_VARS["content"]);
    … …  
    5050        $post_title = addslashes($HTTP_POST_VARS["post_title"]);
    5151        $post_category = intval($HTTP_POST_VARS["post_category"]);
     52                $post_status = $HTTP_POST_VARS['post_status'];
     53                $comment_status = $HTTP_POST_VARS['comment_status'];
     54                $ping_status = $HTTP_POST_VARS['ping_status'];
     55                $post_password = addslashes($HTTP_POST_VARS['post_password']);
    5256
    5357        if ($user_level == 0)
    … …  
    7074        }
    7175
    72         $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')";
     76        $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')";
    7377        $result = $wpdb->query($query);
    7478
    … …  
    119123        $standalone = 0;
    120124        require_once('b2header.php');
     125
    121126        $post = $HTTP_GET_VARS['post'];
    122127        if ($user_level > 0) {
    123             $postdata=get_postdata($post) or die('Oops, no post with this ID. <a href="b2edit.php">Go back</a>!');
     128            $postdata = get_postdata($post);
    124129            $authordata = get_userdata($postdata["Author_ID"]);
    125130            if ($user_level < $authordata[13])
    … …  
    131136            $excerpt = format_to_edit($excerpt);
    132137            $edited_post_title = format_to_edit($postdata['Title']);
     138                        $post_status = $postdata['post_status'];
     139                        $comment_status = $postdata['comment_status'];
     140                        $ping_status = $postdata['ping_status'];
     141                        $post_password = $postdata['post_password'];
    133142
    134143            include('b2edit.form.php');
    135 
    136144        } else {
    137145?>
    … …  
    165173        $excerpt = format_to_post($excerpt);
    166174        $post_title = addslashes($HTTP_POST_VARS["post_title"]);
     175                $post_status = $HTTP_POST_VARS['post_status'];
     176                $comment_status = $HTTP_POST_VARS['comment_status'];
     177                $ping_status = $HTTP_POST_VARS['ping_status'];
     178                $post_password = addslashes($HTTP_POST_VARS['post_password']);
    167179
    168180        if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) {
    … …  
    179191            $datemodif = ", post_date=\"$aa-$mm-$jj $hh:$mn:$ss\"";
    180192        } else {
    181             $datemodif = "";
    182         }
    183 
    184         $query = "UPDATE $tableposts SET post_content=\"$content\", post_excerpt=\"$excerpt\", post_title=\"$post_title\", post_category=\"$post_category\"".$datemodif." WHERE ID=$post_ID";
     193            $datemodif = '';
     194        }
     195
     196        $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";
    185197        $result = $wpdb->query($query);
    186198
    … …  
    283295        $newcomment_author_email = addslashes($newcomment_author_email);
    284296        $newcomment_author_url = addslashes($newcomment_author_url);
    285         $post_autobr = $HTTP_POST_VARS["post_autobr"];
    286297
    287298        if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) {
    … …  
    318329            if ((!$withcomments) && (!$c)) {
    319330
    320                 $action="post";
     331                $action = 'post';
     332                                get_currentuserinfo();
     333                                $drafts = $wpdb->get_results("SELECT ID, post_title FROM $tableposts WHERE post_status = 'draft' AND post_author = $user_ID");
     334                                if ($drafts) {
     335                                        ?>
     336                                        <div class="wrap">
     337                                        <p><strong>Your Drafts:</strong>
     338                                        <?php
     339                                        $i = 0;
     340                                        foreach ($drafts as $draft) {
     341                                                if (0 != $i) echo ', ';
     342                                                echo "<a href='b2edit.php?action=edit&amp;post=$draft->ID' title='Edit this draft'>$draft->post_title</a>";
     343                                                ++$i;
     344                                                }
     345                                        ?>.</p>
     346                                        </div>
     347                                        <?php
     348                                }
    321349                include("b2edit.form.php");
    322350                echo "<br /><br />";
    … …  
    326354        } else {
    327355
    328             echo $tabletop;
     356
    329357?>
     358<div class="wrap">
    330359            <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>
     360</div>
    331361<?php
    332             echo $tablebottom;
    333             echo "<br /><br />";
     362
    334363        }
    335364
Note: See TracChangeset for help on using the changeset viewer.