Changeset 143
- Timestamp:
- 06/01/2003 02:49:30 PM (22 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/b2edit.form.php
r44 r143 1 1 <div class="wrap"> 2 2 <?php 3 4 function selected($selected, $current) { 5 if ($selected == $current) echo ' selected="selected"'; 6 } 3 7 4 8 switch($action) { … … 49 53 // this is for everything but comment editing 50 54 ?> 51 <table> 52 <tr> 53 <td width="210"> 54 <label for="title">Title:</label><br /> 55 <input type="text" name="post_title" size="25" tabindex="1" style="width: 190px;" value="<?php echo $edited_post_title; ?>" id="title" /> 55 56 <table> 57 <tr> 58 <td width="210"> <label for="title">Title:</label> <br /> <input type="text" name="post_title" size="25" tabindex="1" style="width: 190px;" value="<?php echo $edited_post_title; ?>" id="title" /> 56 59 </td> 57 <td> 58 <label for="category">Category :</label> 59 <br /><?php dropdown_categories(); ?> 60 <td> <label for="category">Category :</label> <br /> 61 <?php dropdown_categories(); ?> 60 62 </td> 61 </tr> 62 </table> 63 <td><label for="post_status">Post Status:</label><br /> 64 65 <select name="post_status" id="post_status"> 66 <option value="publish"<?php selected($post_status, 'publish'); ?>>Publish</option> 67 <option value="draft"<?php selected($post_status, 'draft'); ?>>Draft</option> 68 <option value="private"<?php selected($post_status, 'private'); ?>>Private</option> 69 </select> </td> 70 <td><label for="comment_status">Comments:</label><br /> 71 72 <select name="comment_status" id="comment_status"> 73 <option value="open"<?php selected($comment_status, 'open'); ?>>Open</option> 74 <option value="closed"<?php selected($comment_status, 'closed'); ?>>Closed</option> 75 </select> </td> 76 <td><label for="ping_status">Pings:</label><br /> 77 78 <select name="ping_status" id="ping_status"> 79 <option value="open"<?php selected($ping_status, 'open'); ?>>Open</option> 80 <option value="closed"<?php selected($ping_status, 'open'); ?>>Closed</option> 81 </select></td> 82 <td><label for="post_password">Post Password:</label> 83 <br /> 84 <input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" /> </td> 85 </tr> 86 </table> 63 87 <?php 64 88 … … 135 159 touch_time(($action == 'edit')); 136 160 } 161 if ('edit' == $action) echo " 162 <p><a href='b2edit.php?action=delete&post=$post' onclick=\"return confirm('You are about to delete this post \'".$edited_post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete this post</a></p>"; 137 163 ?> 138 139 164 </form> 140 165 </div> -
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 -
trunk/wp-admin/b2edit.showposts.php
r139 r143 234 234 start_b2(); ?> 235 235 <p> 236 <strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="b2edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comment ', '1 comment', "% comments") ?></a>236 <strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="b2edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comments', '1 comment', "% comments") ?></a> 237 237 <?php 238 238 if (($user_level > $authordata[13]) or ($user_login == $authordata[1])) { … … 243 243 echo " - <a href='b2edit.php?action=delete&post=$id' onclick=\"return confirm('You are about to delete this post \'".$row->post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete</a> "; 244 244 } 245 if ('private' == $post->post_status) echo ' - <strong>Private</strong>'; 245 246 ?> 246 247 ]
Note: See TracChangeset
for help on using the changeset viewer.