Changeset 636 for trunk/wp-admin/post.php
- Timestamp:
- 12/22/2003 02:46:40 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r631 r636 63 63 $post_password = addslashes($HTTP_POST_VARS['post_password']); 64 64 $post_name = sanitize_title($post_title); 65 $trackback = $HTTP_POST_VARS['trackback_url']; 66 // Format trackbacks 67 $trackback = preg_replace('|\s+|', '\n', $trackback); 65 68 66 69 if ($user_level == 0) … … 87 90 if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) { 88 91 $postquery ="INSERT INTO $tableposts 89 (ID, post_author, post_date, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name )92 (ID, post_author, post_date, post_content, post_title, post_lat, post_lon, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping) 90 93 VALUES 91 ('0', '$user_ID', '$now', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name' )94 ('0', '$user_ID', '$now', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback') 92 95 "; 93 96 } else { 94 97 $postquery ="INSERT INTO $tableposts 95 (ID, post_author, post_date, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name )98 (ID, post_author, post_date, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping) 96 99 VALUES 97 ('0', '$user_ID', '$now', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name' )100 ('0', '$user_ID', '$now', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback') 98 101 "; 99 102 } … … 141 144 142 145 if ('' != $HTTP_POST_VARS['save']) $location = "post.php?action=edit&post=$post_ID"; 143 header("Location: $location"); 146 147 header("Location: $location"); 144 148 145 149 if ($post_status == 'publish') { … … 154 158 } 155 159 156 if (!empty($HTTP_POST_VARS['trackback_url'])) { 160 // Time for trackbacks 161 $to_ping = $wpdb->get_var("SELECT to_ping FROM $tableposts WHERE ID = $post_ID"); 162 $pinged = $wpdb->get_var("SELECT pinged FROM $tableposts WHERE ID = $post_ID"); 163 $pinged = explode("\n", $pinged); 164 if ('' != $to_ping) { 157 165 if (strlen($excerpt) > 0) { 158 166 $the_excerpt = (strlen(strip_tags($excerpt)) > 255) ? substr(strip_tags($excerpt), 0, 252) . '...' : strip_tags($excerpt) ; … … 160 168 $the_excerpt = (strlen(strip_tags($content)) > 255) ? substr(strip_tags($content), 0, 252) . '...' : strip_tags($content); 161 169 } 162 $excerpt = stripslashes($the_excerpt); 163 $trackback_urls = explode(',', $HTTP_POST_VARS['trackback_url']); 164 foreach($trackback_urls as $tb_url) { 165 $tb_url = trim($tb_url); 166 trackback($tb_url, stripslashes($post_title), $excerpt, $post_ID); 167 } 168 } 170 $excerpt = stripslashes($the_excerpt); 171 $to_pings = explode("\n", $to_ping); 172 foreach ($to_pings as $tb_ping) { 173 $tb_ping = trim($tb_ping); 174 if (!in_array($tb_ping, $pinged)) { 175 trackback($tb_ping, stripslashes($post_title), $excerpt, $post_ID); 176 } 177 } 178 } 179 169 180 } // end if publish 170 181 … … 196 207 $ping_status = $postdata['ping_status']; 197 208 $post_password = $postdata['post_password']; 209 $to_ping = $postdata['to_ping']; 210 $pinged = $postdata['pinged']; 198 211 199 212 include('edit-form.php'); … … 246 259 $post_password = addslashes($HTTP_POST_VARS['post_password']); 247 260 $post_name = sanitize_title($post_title); 261 $trackback = $HTTP_POST_VARS['trackback_url']; 262 // Format trackbacks 263 $trackback = preg_replace('|\s+|', '\n', $trackback); 248 264 249 265 if (($user_level > 4) && (!empty($HTTP_POST_VARS['edit_date']))) { … … 274 290 ping_status = '$ping_status', 275 291 post_password = '$post_password', 276 post_name = '$post_name' 292 post_name = '$post_name', 293 to_ping = '$trackback' 277 294 WHERE ID = $post_ID "); 278 295 … … 302 319 pingWeblogs($blog_ID); 303 320 pingBlogs($blog_ID); 304 305 if ($post_pingback) { 306 pingback($content, $post_ID); 307 } 308 309 if (!empty($HTTP_POST_VARS['trackback_url'])) { 310 $excerpt = (strlen(strip_tags($content)) > 255) ? substr(strip_tags($content), 0, 252) . '...' : strip_tags($content); 311 $excerpt = stripslashes($excerpt); 312 $trackback_urls = explode(',', $HTTP_POST_VARS['trackback_url']); 313 foreach($trackback_urls as $tb_url) { 314 $tb_url = trim($tb_url); 315 trackback($tb_url, stripslashes($post_title), $excerpt, $post_ID); 316 } 317 } 321 } // end if moving from draft/private to published 322 if ($post_status == 'publish') { 323 // Trackback time. 324 $to_ping = trim($wpdb->get_var("SELECT to_ping FROM $tableposts WHERE ID = $post_ID")); 325 $pinged = trim($wpdb->get_var("SELECT pinged FROM $tableposts WHERE ID = $post_ID")); 326 $pinged = explode("\n", $pinged); 327 if ('' != $to_ping) { 328 if (strlen($excerpt) > 0) { 329 $the_excerpt = (strlen(strip_tags($excerpt)) > 255) ? substr(strip_tags($excerpt), 0, 252) . '...' : strip_tags($excerpt) ; 330 } else { 331 $the_excerpt = (strlen(strip_tags($content)) > 255) ? substr(strip_tags($content), 0, 252) . '...' : strip_tags($content); 332 } 333 $excerpt = stripslashes($the_excerpt); 334 $to_pings = explode("\n", $to_ping); 335 foreach ($to_pings as $tb_ping) { 336 $tb_ping = trim($tb_ping); 337 if (!in_array($tb_ping, $pinged)) { 338 trackback($tb_ping, stripslashes($post_title), $excerpt, $post_ID); 339 } 340 } 341 } 318 342 } // end if publish 343 319 344 320 345 $location = "Location: post.php"; … … 358 383 } 359 384 360 // pingWeblogs($blog_ID);361 385 $sendback = $HTTP_SERVER_VARS['HTTP_REFERER']; 362 386 if (strstr($sendback, 'post.php')) $sendback = $siteurl .'/wp-admin/post.php';
Note: See TracChangeset
for help on using the changeset viewer.