[wp-cvs] wordpress/wp-admin edit-form-advanced.php, 1.40, 1.41 post.php, 1.101, 1.102 upgrade.php, 1.15, 1.16

Donncha O Caoimh donncha at users.sourceforge.net
Mon Oct 18 12:09:22 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23115/wp-admin

Modified Files:
	edit-form-advanced.php post.php upgrade.php 
Log Message:
Enclosure support moved to functions.php - it now scans the content
and encloses file of mime type "video", "audio" and "image".
Fixed a bug in upgrade.php - extra character at the start of file.


Index: post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/post.php,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** post.php	16 Oct 2004 10:18:36 -0000	1.101
--- post.php	18 Oct 2004 12:09:19 -0000	1.102
***************
*** 167,170 ****
--- 167,171 ----
  		if ($post_pingback)
  			pingback($content, $post_ID);
+                 do_enclose( $content, $post_ID );
  		do_trackbacks($post_ID);
  		do_action('publish_post', $post_ID);
***************
*** 321,326 ****
  	header ('Location: ' . $location); // Send user on their way while we keep working
  
! $now = current_time('mysql');
! $now_gmt = current_time('mysql', 1);
  
  	$result = $wpdb->query("
--- 322,327 ----
  	header ('Location: ' . $location); // Send user on their way while we keep working
  
!         $now = current_time('mysql');
!         $now_gmt = current_time('mysql', 1);
  
  	$result = $wpdb->query("
***************
*** 339,343 ****
  			post_modified = '$now',
  			post_modified_gmt = '$now_gmt',
!       post_parent = '$post_parent'
  		WHERE ID = $post_ID ");
  
--- 340,344 ----
  			post_modified = '$now',
  			post_modified_gmt = '$now_gmt',
! 			post_parent = '$post_parent'
  		WHERE ID = $post_ID ");
  
***************
*** 373,411 ****
  	}
  
-         // Enclosures
-         $enclosures = split( " ", $enclosure_url );
-         if( is_array( $enclosures ) ) {
-             while( list( $key, $url ) = each( $enclosures ) ) {
-                 if( $url != '' ) {
-                     // READ INFO FROM REMOTE HOST
-                     $file = str_replace( "http://", "", $url );
-                     $host = substr( $file, 0, strpos( $file, "/" ) );
-                     $file = substr( $file, strpos( $file, "/" ) );
-                     $headers = "HEAD $file HTTP/1.1\r\nHOST: $host\r\n\r\n";
-                     $port    = 80;
-                     $timeout = 3;
-                     $fp = fsockopen($host, $port, $errno, $errstr, $timeout);
-                     if( $fp ) {
-                         fputs($fp, $headers );
-                         $response = '';
-                         while (!feof($fp))
-                             $response .= fgets($fp, 2048);
-                     } else {
-                         $response = '';
-                     }
-                     if( $response != '' ) {
-                         $len = substr( $response, strpos( $response, "Content-Length:" ) + 16 );
-                         $len = substr( $len, 0, strpos( $len, "\n" ) );
-                         $type = substr( $response, strpos( $response, "Content-Type:" ) + 14 );
-                         $type = substr( $type, 0, strpos( $type, "\n" ) + 1 );
-                         $meta_value = "$url\n$len\n$type\n";
-                         $query = "INSERT INTO `".$wpdb->postmeta."` ( `meta_id` , `post_id` , `meta_key` , `meta_value` )
-                                   VALUES ( NULL, '$post_ID', 'enclosure' , '".$meta_value."')";
-                         $wpdb->query( $query );
-                     }
-                 }
-             } 
-         }
- 
  	if ($prev_status != 'publish' && $post_status == 'publish')
  		do_action('private_to_published', $post_ID);
--- 374,377 ----
***************
*** 414,417 ****
--- 380,384 ----
  		do_action('publish_post', $post_ID);
  		do_trackbacks($post_ID);
+                 do_enclose( $content, $post_ID );
  		if ( get_option('default_pingback_flag') )
  			pingback($content, $post_ID);

Index: upgrade.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/upgrade.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** upgrade.php	15 Oct 2004 04:50:40 -0000	1.15
--- upgrade.php	18 Oct 2004 12:09:19 -0000	1.16
***************
*** 1,3 ****
! l<?php
  $_wp_installing = 1;
  if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php.");
--- 1,3 ----
! <?php
  $_wp_installing = 1;
  if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php.");

Index: edit-form-advanced.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-form-advanced.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** edit-form-advanced.php	14 Oct 2004 21:01:13 -0000	1.40
--- edit-form-advanced.php	18 Oct 2004 12:09:18 -0000	1.41
***************
*** 133,139 ****
  	<input name="referredby" type="hidden" id="referredby" value="<?php echo htmlspecialchars($_SERVER['HTTP_REFERER']); ?>" />
  </p>
- 
- <?php echo $form_enclosure; ?>
- 
  <?php
  if ('' != $pinged) {
--- 133,136 ----




More information about the cvs mailing list