Changeset 143 for trunk/wp-admin/b2edit.php
- Timestamp:
- 06/01/2003 02:49:30 PM (23 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/b2edit.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/b2edit.php
r136 r143 41 41 42 42 $standalone = 1; 43 require_once('b2header.php'); 44 43 require_once('b2header.php'); 44 45 45 $post_pingback = intval($HTTP_POST_VARS["post_pingback"]); 46 46 $content = balanceTags($HTTP_POST_VARS["content"]); … … 50 50 $post_title = addslashes($HTTP_POST_VARS["post_title"]); 51 51 $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']); 52 56 53 57 if ($user_level == 0) … … 70 74 } 71 75 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')"; 73 77 $result = $wpdb->query($query); 74 78 … … 119 123 $standalone = 0; 120 124 require_once('b2header.php'); 125 121 126 $post = $HTTP_GET_VARS['post']; 122 127 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); 124 129 $authordata = get_userdata($postdata["Author_ID"]); 125 130 if ($user_level < $authordata[13]) … … 131 136 $excerpt = format_to_edit($excerpt); 132 137 $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']; 133 142 134 143 include('b2edit.form.php'); 135 136 144 } else { 137 145 ?> … … 165 173 $excerpt = format_to_post($excerpt); 166 174 $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']); 167 179 168 180 if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { … … 179 191 $datemodif = ", post_date=\"$aa-$mm-$jj $hh:$mn:$ss\""; 180 192 } 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"; 185 197 $result = $wpdb->query($query); 186 198 … … 283 295 $newcomment_author_email = addslashes($newcomment_author_email); 284 296 $newcomment_author_url = addslashes($newcomment_author_url); 285 $post_autobr = $HTTP_POST_VARS["post_autobr"];286 297 287 298 if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { … … 318 329 if ((!$withcomments) && (!$c)) { 319 330 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&post=$draft->ID' title='Edit this draft'>$draft->post_title</a>"; 343 ++$i; 344 } 345 ?>.</p> 346 </div> 347 <?php 348 } 321 349 include("b2edit.form.php"); 322 350 echo "<br /><br />"; … … 326 354 } else { 327 355 328 echo $tabletop; 356 329 357 ?> 358 <div class="wrap"> 330 359 <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> 331 361 <?php 332 echo $tablebottom; 333 echo "<br /><br />"; 362 334 363 } 335 364
Note:
See TracChangeset
for help on using the changeset viewer.