Changeset 1812 for trunk/wp-admin/post.php
- Timestamp:
- 10/18/2004 12:09:20 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r1806 r1812 167 167 if ($post_pingback) 168 168 pingback($content, $post_ID); 169 do_enclose( $content, $post_ID ); 169 170 do_trackbacks($post_ID); 170 171 do_action('publish_post', $post_ID); … … 321 322 header ('Location: ' . $location); // Send user on their way while we keep working 322 323 323 $now = current_time('mysql');324 $now_gmt = current_time('mysql', 1);324 $now = current_time('mysql'); 325 $now_gmt = current_time('mysql', 1); 325 326 326 327 $result = $wpdb->query(" … … 339 340 post_modified = '$now', 340 341 post_modified_gmt = '$now_gmt', 341 342 post_parent = '$post_parent' 342 343 WHERE ID = $post_ID "); 343 344 … … 373 374 } 374 375 375 // Enclosures376 $enclosures = split( " ", $enclosure_url );377 if( is_array( $enclosures ) ) {378 while( list( $key, $url ) = each( $enclosures ) ) {379 if( $url != '' ) {380 // READ INFO FROM REMOTE HOST381 $file = str_replace( "http://", "", $url );382 $host = substr( $file, 0, strpos( $file, "/" ) );383 $file = substr( $file, strpos( $file, "/" ) );384 $headers = "HEAD $file HTTP/1.1\r\nHOST: $host\r\n\r\n";385 $port = 80;386 $timeout = 3;387 $fp = fsockopen($host, $port, $errno, $errstr, $timeout);388 if( $fp ) {389 fputs($fp, $headers );390 $response = '';391 while (!feof($fp))392 $response .= fgets($fp, 2048);393 } else {394 $response = '';395 }396 if( $response != '' ) {397 $len = substr( $response, strpos( $response, "Content-Length:" ) + 16 );398 $len = substr( $len, 0, strpos( $len, "\n" ) );399 $type = substr( $response, strpos( $response, "Content-Type:" ) + 14 );400 $type = substr( $type, 0, strpos( $type, "\n" ) + 1 );401 $meta_value = "$url\n$len\n$type\n";402 $query = "INSERT INTO `".$wpdb->postmeta."` ( `meta_id` , `post_id` , `meta_key` , `meta_value` )403 VALUES ( NULL, '$post_ID', 'enclosure' , '".$meta_value."')";404 $wpdb->query( $query );405 }406 }407 }408 }409 410 376 if ($prev_status != 'publish' && $post_status == 'publish') 411 377 do_action('private_to_published', $post_ID); … … 414 380 do_action('publish_post', $post_ID); 415 381 do_trackbacks($post_ID); 382 do_enclose( $content, $post_ID ); 416 383 if ( get_option('default_pingback_flag') ) 417 384 pingback($content, $post_ID);
Note: See TracChangeset
for help on using the changeset viewer.