Changeset 1259
- Timestamp:
- 05/10/2004 08:33:03 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r1256 r1259 94 94 } 95 95 96 // What to do based on which button they pressed 97 if ('' != $_POST['saveasdraft']) $post_status = 'draft'; 98 if ('' != $_POST['saveasprivate']) $post_status = 'private'; 99 if ('' != $_POST['publish']) $post_status = 'publish'; 100 if ('' != $_POST['advanced']) $post_status = 'draft'; 101 102 103 if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { 104 $postquery ="INSERT INTO $tableposts 105 (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) 106 VALUES 107 ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt') 108 "; 109 } else { 110 $postquery ="INSERT INTO $tableposts 111 (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) 112 VALUES 113 ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt') 114 "; 115 } 116 $postquery = 117 $result = $wpdb->query($postquery); 118 119 $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); 120 96 121 if (!empty($_POST['mode'])) { 97 122 switch($_POST['mode']) { … … 109 134 $location = 'post.php'; 110 135 } 111 112 // What to do based on which button they pressed113 if ('' != $_POST['saveasdraft']) $post_status = 'draft';114 if ('' != $_POST['saveasprivate']) $post_status = 'private';115 if ('' != $_POST['publish']) $post_status = 'publish';116 if ('' != $_POST['advanced']) $post_status = 'draft';117 118 119 if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {120 $postquery ="INSERT INTO $tableposts121 (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)122 VALUES123 ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')124 ";125 } else {126 $postquery ="INSERT INTO $tableposts127 (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)128 VALUES129 ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')130 ";131 }132 $postquery =133 $result = $wpdb->query($postquery);134 135 $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");136 137 136 if ('' != $_POST['advanced']) 138 137 $location = "post.php?action=edit&post=$post_ID"; 138 139 header("Location: $location"); // Send user on their way while we keep working 139 140 140 141 … … 161 162 sleep($sleep_after_edit); 162 163 } 163 164 165 header("Location: $location");166 164 167 165 if ($post_status == 'publish') { … … 323 321 $datemodif_gmt = ''; 324 322 } 323 324 if ($_POST['save']) { 325 $location = $_SERVER['HTTP_REFERER']; 326 } elseif ($_POST['updatemeta']) { 327 $location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom'; 328 } elseif ($_POST['deletemeta']) { 329 $location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom'; 330 } else { 331 $location = 'post.php'; 332 } 333 header ('Location: ' . $location); // Send user on their way while we keep working 325 334 326 335 $now = current_time('mysql'); … … 407 416 add_meta($post_ID); 408 417 409 if ($_POST['save']) {410 $location = $_SERVER['HTTP_REFERER'];411 } elseif ($_POST['updatemeta']) {412 $location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom';413 } elseif ($_POST['deletemeta']) {414 $location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom';415 } else {416 $location = 'post.php';417 }418 header ('Location: ' . $location);419 418 do_action('edit_post', $post_ID); 420 419 exit();
Note: See TracChangeset
for help on using the changeset viewer.