Changeset 294 for trunk/wp-admin/b2edit.php
- Timestamp:
- 08/05/2003 10:44:38 PM (23 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/b2edit.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/b2edit.php
r243 r294 12 12 } 13 13 return $array; 14 } 14 } 15 15 16 16 if (!get_magic_quotes_gpc()) { … … 41 41 42 42 $standalone = 1; 43 require_once('b2header.php'); 43 require_once('b2header.php'); 44 44 45 45 $post_pingback = intval($HTTP_POST_VARS['post_pingback']); … … 50 50 $post_title = addslashes($HTTP_POST_VARS['post_title']); 51 51 $post_category = intval($HTTP_POST_VARS['post_category']); 52 if(get_settings('use_geo_positions')) { 53 $latstr = $HTTP_POST_VARS['post_latf']; 54 $lonstr = $HTTP_POST_VARS['post_lonf']; 55 if((strlen($latstr) > 2) && (strlen($lonstr) > 2 ) ) { 56 $post_latf = floatval($HTTP_POST_VARS['post_latf']); 57 $post_lonf = floatval($HTTP_POST_VARS['post_lonf']); 58 } 59 } 52 60 $post_status = $HTTP_POST_VARS['post_status']; 53 61 $comment_status = $HTTP_POST_VARS['comment_status']; … … 74 82 } 75 83 76 $result = $wpdb->query(" 77 INSERT INTO $tableposts 78 (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt, post_status, comment_status, ping_status, post_password) 79 VALUES 80 ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password') 81 "); 84 if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { 85 $postquery ="INSERT INTO $tableposts 86 (ID, post_author, post_date, post_content, post_title, post_category, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password) 87 VALUES 88 ('0','$user_ID','$now','$content','$post_title','$post_category',$post_latf,$post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password') 89 "; 90 } else { 91 $postquery ="INSERT INTO $tableposts 92 (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt, post_status, comment_status, ping_status, post_password) 93 VALUES 94 ('0','$user_ID','$now','$content','$post_title','$post_category','$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password') 95 "; 96 } 97 $postquery = 98 $result = $wpdb->query($postquery); 82 99 83 100 $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); … … 86 103 sleep($sleep_after_edit); 87 104 } 88 105 89 106 if ($post_status == 'publish') { 107 if((get_settings('use_geo_positions')) && ($post_latf != null) && ($post_lonf != null)) { 108 pingGeoUrl($post_ID); 109 } 90 110 pingWeblogs($blog_ID); 91 111 pingCafelog($cafelogID, $post_title, $post_ID); 92 112 pingBlogs($blog_ID); 93 113 94 114 if ($post_pingback) { 95 115 pingback($content, $post_ID); … … 137 157 if ($user_level < $authordata->user_level) 138 158 die ('You don’t have the right to edit <strong>'.$authordata[1].'</strong>’s posts.'); 139 159 140 160 $content = $postdata['Content']; 141 161 $content = format_to_edit($content); 162 $edited_lat = $postdata["Lat"]; 163 $edited_lon = $postdata["Lon"]; 142 164 $excerpt = $postdata['Excerpt']; 143 165 $excerpt = format_to_edit($excerpt); … … 165 187 $standalone = 1; 166 188 require_once('./b2header.php'); 167 189 168 190 if ($user_level == 0) 169 191 die ('Cheatin’ uh?'); … … 180 202 $excerpt = format_to_post($excerpt); 181 203 $post_title = addslashes($HTTP_POST_VARS['post_title']); 204 if(get_settings('use_geo_positions')) { 205 $latf = floatval($HTTP_POST_VARS["post_latf"]); 206 $lonf = floatval($HTTP_POST_VARS["post_lonf"]); 207 $latlonaddition = ""; 208 if( ($latf != null) && ($latf <= 90 ) && ($latf >= -90) && ($lonf != null) && ($lonf <= 360) && ($lonf >= -360) ) { 209 pingGeoUrl($post_ID); 210 $latlonaddition = " post_lat=".$latf.", post_lon =".$lonf.", "; 211 } else { 212 $latlonaddition = " post_lat=null, post_lon=null, "; 213 } 214 } 182 215 $post_status = $HTTP_POST_VARS['post_status']; 183 216 $prev_status = $HTTP_POST_VARS['prev_status']; … … 203 236 204 237 $result = $wpdb->query(" 205 UPDATE $tableposts SET 206 post_content = '$content', 207 post_excerpt = '$excerpt', 208 post_title = '$post_title', 209 post_category = '$post_category'".$datemodif.", 210 post_status = '$post_status',211 comment_status = '$comment_status',212 ping_status = '$ping_status',213 p ost_password = '$post_password'214 WHERE ID = $post_ID215 ");238 UPDATE $tableposts SET 239 post_content = '$content', 240 post_excerpt = '$excerpt', 241 post_title = '$post_title', 242 post_category = '$post_category'".$datemodif.", 243 ".$latlonaddition." 244 post_status = '$post_status', 245 comment_status = '$comment_status', 246 ping_status = '$ping_status', 247 post_password = '$post_password' 248 WHERE ID = $post_ID "); 216 249 217 250 if (isset($sleep_after_edit) && $sleep_after_edit > 0) { … … 224 257 pingCafelog($cafelogID, $post_title, $post_ID); 225 258 pingBlogs($blog_ID); 226 259 227 260 if ($post_pingback) { 228 261 pingback($content, $post_ID); … … 258 291 if ($user_level < $authordata->user_level) 259 292 die ('You don’t have the right to delete <strong>'.$authordata[1].'</strong>’s posts.'); 293 294 // send geoURL ping to "erase" from their DB 295 $query = "SELECT post_lat from $tableposts WHERE ID=$post"; 296 $rows = $wpdb->query($query); 297 $myrow = $rows[0]; 298 $latf = $myrow->post_lat; 299 if($latf != null ) { 300 pingGeoUrl($post); 301 } 260 302 261 303 $result = $wpdb->query("DELETE FROM $tableposts WHERE ID=$post"); … … 349 391 350 392 $result = $wpdb->query(" 351 UPDATE $tablecomments SET 352 comment_content = '$content', 353 comment_author = '$newcomment_author', 354 comment_author_email = '$newcomment_author_email', 355 comment_author_url = '$newcomment_author_url'".$datemodif." 393 UPDATE $tablecomments SET 394 comment_content = '$content', 395 comment_author = '$newcomment_author', 396 comment_author_email = '$newcomment_author_email', 397 comment_author_url = '$newcomment_author_url'".$datemodif." 356 398 WHERE comment_ID = $comment_ID" 357 399 );
Note: See TracChangeset
for help on using the changeset viewer.