Changeset 1355 for trunk/wp-admin/post.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r1352 r1355 109 109 110 110 if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { 111 $postquery ="INSERT INTO $ tableposts111 $postquery ="INSERT INTO $wpdb->posts 112 112 (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt) 113 113 VALUES … … 115 115 "; 116 116 } else { 117 $postquery ="INSERT INTO $ tableposts117 $postquery ="INSERT INTO $wpdb->posts 118 118 (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt) 119 119 VALUES … … 124 124 $result = $wpdb->query($postquery); 125 125 126 $post_ID = $wpdb->get_var("SELECT ID FROM $ tableposts ORDER BY ID DESC LIMIT 1");126 $post_ID = $wpdb->get_var("SELECT ID FROM $wpdb->posts ORDER BY ID DESC LIMIT 1"); 127 127 128 128 if (!empty($_POST['mode'])) { … … 152 152 foreach ($post_categories as $post_category) { 153 153 // Double check it's not there already 154 $exists = $wpdb->get_row("SELECT * FROM $ tablepost2cat WHERE post_id = $post_ID AND category_id = $post_category");154 $exists = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post_ID AND category_id = $post_category"); 155 155 156 156 if (!$exists && $result) { 157 157 $wpdb->query(" 158 INSERT INTO $ tablepost2cat158 INSERT INTO $wpdb->post2cat 159 159 (post_id, category_id) 160 160 VALUES … … 182 182 183 183 // Time for trackbacks 184 $to_ping = $wpdb->get_var("SELECT to_ping FROM $ tableposts WHERE ID = $post_ID");185 $pinged = $wpdb->get_var("SELECT pinged FROM $ tableposts WHERE ID = $post_ID");184 $to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_ID"); 185 $pinged = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_ID"); 186 186 $pinged = explode("\n", $pinged); 187 187 if ('' != $to_ping) { … … 214 214 $post = $post_ID = $p = (int) $_GET['post']; 215 215 if ($user_level > 0) { 216 $postdata = $wpdb->get_row("SELECT * FROM $ tableposts WHERE ID = '$post_ID'");216 $postdata = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'"); 217 217 $authordata = get_userdata($postdata->post_author); 218 218 if ($user_level < $authordata->user_level) … … 236 236 include('edit-form-advanced.php'); 237 237 238 $post = $wpdb->get_row("SELECT * FROM $ tableposts WHERE ID = '$post_ID'");238 $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = '$post_ID'"); 239 239 ?> 240 240 <div id='preview' class='wrap'> … … 344 344 345 345 $result = $wpdb->query(" 346 UPDATE $ tableposts SET346 UPDATE $wpdb->posts SET 347 347 post_content = '$content', 348 348 post_excerpt = '$excerpt', … … 365 365 // Now it's category time! 366 366 // First the old categories 367 $old_categories = $wpdb->get_col("SELECT category_id FROM $ tablepost2cat WHERE post_id = $post_ID");367 $old_categories = $wpdb->get_col("SELECT category_id FROM $wpdb->post2cat WHERE post_id = $post_ID"); 368 368 369 369 // Delete any? 370 370 foreach ($old_categories as $old_cat) { 371 371 if (!in_array($old_cat, $post_categories)) // If a category was there before but isn't now 372 $wpdb->query("DELETE FROM $ tablepost2cat WHERE category_id = $old_cat AND post_id = $post_ID LIMIT 1");372 $wpdb->query("DELETE FROM $wpdb->post2cat WHERE category_id = $old_cat AND post_id = $post_ID LIMIT 1"); 373 373 } 374 374 … … 376 376 foreach ($post_categories as $new_cat) { 377 377 if (!in_array($new_cat, $old_categories)) 378 $wpdb->query("INSERT INTO $ tablepost2cat (post_id, category_id) VALUES ($post_ID, $new_cat)");378 $wpdb->query("INSERT INTO $wpdb->post2cat (post_id, category_id) VALUES ($post_ID, $new_cat)"); 379 379 } 380 380 … … 393 393 do_action('publish_post', $post_ID); 394 394 // Trackback time. 395 $to_ping = trim($wpdb->get_var("SELECT to_ping FROM $ tableposts WHERE ID = $post_ID"));396 $pinged = trim($wpdb->get_var("SELECT pinged FROM $ tableposts WHERE ID = $post_ID"));395 $to_ping = trim($wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_ID")); 396 $pinged = trim($wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_ID")); 397 397 $pinged = explode("\n", $pinged); 398 398 if ('' != $to_ping) { … … 450 450 451 451 // send geoURL ping to "erase" from their DB 452 $query = "SELECT post_lat from $ tableposts WHERE ID=$post_id";452 $query = "SELECT post_lat from $wpdb->posts WHERE ID=$post_id"; 453 453 $rows = $wpdb->query($query); 454 454 $myrow = $rows[0]; … … 458 458 } 459 459 460 $result = $wpdb->query("DELETE FROM $ tableposts WHERE ID=$post_id");460 $result = $wpdb->query("DELETE FROM $wpdb->posts WHERE ID=$post_id"); 461 461 if (!$result) 462 462 die(__('Error in deleting...')); 463 463 464 $result = $wpdb->query("DELETE FROM $ tablecomments WHERE comment_post_ID=$post_id");465 466 $categories = $wpdb->query("DELETE FROM $ tablepost2cat WHERE post_id = $post_id");464 $result = $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID=$post_id"); 465 466 $categories = $wpdb->query("DELETE FROM $wpdb->post2cat WHERE post_id = $post_id"); 467 467 468 468 if (isset($sleep_after_edit) && $sleep_after_edit > 0) { … … 695 695 696 696 $result = $wpdb->query(" 697 UPDATE $ tablecomments SET697 UPDATE $wpdb->comments SET 698 698 comment_content = '$content', 699 699 comment_author = '$newcomment_author', … … 717 717 $action = 'post'; 718 718 get_currentuserinfo(); 719 $drafts = $wpdb->get_results("SELECT ID, post_title FROM $ tableposts WHERE post_status = 'draft' AND post_author = $user_ID");719 $drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID"); 720 720 if ($drafts) { 721 721 ?>
Note: See TracChangeset
for help on using the changeset viewer.