Changeset 1786
- Timestamp:
- 10/12/04 15:52:29 (4 years ago)
- Files:
-
- trunk/wp-admin/edit-form-advanced.php (modified) (4 diffs)
- trunk/wp-admin/post.php (modified) (4 diffs)
- trunk/wp-rss2.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/edit-form-advanced.php
r1762 r1786 21 21 $form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />'; 22 22 23 $form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="' . __('Help on trackbacks') . '">' . __('<strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>') . '</label> ' . __('(Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)') . '<br /> 24 <input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>'; 25 if ('' != $pinged) { 26 $pings .= '<p>'. __('Already pinged:') . '</p><ul>'; 27 $already_pinged = explode("\n", trim($pinged)); 28 foreach ($already_pinged as $pinged_url) { 29 $pings .= "\n\t<li>$pinged_url</li>"; 30 } 31 $pings .= '</ul>'; 23 $form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="' . __('Help on trackbacks') . '">' . __('<strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>') . '</label> ' . __('(Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)') . '<br /> 24 <input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>'; 25 if ('' != $pinged) { 26 $pings .= '<p>'. __('Already pinged:') . '</p><ul>'; 27 $already_pinged = explode("\n", trim($pinged)); 28 foreach ($already_pinged as $pinged_url) { 29 $pings .= "\n\t<li>$pinged_url</li>"; 32 30 } 31 $pings .= '</ul>'; 32 } 33 33 34 34 $saveasdraft = '<input name="save" type="submit" id="save" tabindex="6" value="' . __('Save and Continue Editing') . '" />'; 35 36 $form_enclosure = '<p><label for="enclosure"><a href="http://www.thetwowayweb.com/payloadsforrss" title="' . __('Help on enclosures') . '">' . __('<strong>Enclosures</strong></a>') . '</label> ' . __('(Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)') . '<br /> 37 <input type="text" name="enclosure_url" style="width: 415px" id="enclosure" tabindex="8" value="'. str_replace("\n", ' ', $enclosure_url) .'" /></p>'; 35 38 36 39 if (empty($post_status)) $post_status = 'draft'; … … 122 125 <input onclick='ReloadTextDiv();' name="use_instant_preview" type="checkbox" id="use_instant_preview" value="1" checked /> <label for='use_instant_preview'>Use Instant Preview</label> <br /> 123 126 </fieldset> 124 <fieldset id="previewdiv">125 <legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Preview</a></legend>126 <div><p id="TextDisplay"></p></div>127 </fieldset>128 129 127 <?php 130 128 ?> … … 138 136 <?php echo $form_prevstatus ?> 139 137 <?php echo $form_trackback; ?> 140 141 138 142 139 <p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="6" /> … … 152 149 <input name="referredby" type="hidden" id="referredby" value="<?php echo htmlspecialchars($_SERVER['HTTP_REFERER']); ?>" /> 153 150 </p> 151 <fieldset id="previewdiv"> 152 <legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Preview</a></legend> 153 <div><p id="TextDisplay"></p></div> 154 </fieldset> 155 <?php echo $form_enclosure; ?> 156 154 157 <?php 155 158 if ('' != $pinged) { trunk/wp-admin/post.php
r1782 r1786 21 21 } 22 22 23 $wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' );23 $wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'poststart', 'postend', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder', 'enclosure_url' ); 24 24 25 25 for ($i=0; $i<count($wpvarstoreset); $i += 1) { … … 39 39 40 40 switch($action) { 41 42 43 41 case 'post': 44 45 42 $standalone = 1; 46 43 require_once('admin-header.php'); … … 412 409 sleep($sleep_after_edit); 413 410 } 411 412 // Enclosures 413 $enclosures = split( " ", $enclosure_url ); 414 if( is_array( $enclosures ) ) { 415 while( list( $key, $url ) = each( $enclosures ) ) { 416 if( $url != '' ) { 417 // READ INFO FROM REMOTE HOST 418 $file = str_replace( "http://", "", $url ); 419 $host = substr( $file, 0, strpos( $file, "/" ) ); 420 $file = substr( $file, strpos( $file, "/" ) ); 421 $headers = "HEAD $file HTTP/1.1\r\nHOST: $host\r\n\r\n"; 422 $port = 80; 423 $timeout = 3; 424 // Open a socket connection to the host 425 $fp = fsockopen($host, $port, &$err_num, &$err_msg, $timeout); 426 if( $fp ) { 427 // Send request for the page 428 fputs($fp, $headers ); 429 430 // Get the response 431 $response = ''; 432 while (!feof($fp)) 433 $response .= fgets($fp, 2048); 434 } else { 435 $response = ''; 436 } 437 if( $response != '' ) { 438 $len = substr( $response, strpos( $response, "Content-Length:" ) + 16 ); 439 $len = substr( $len, 0, strpos( $len, "\n" ) ); 440 $type = substr( $response, strpos( $response, "Content-Type:" ) + 14 ); 441 $type = substr( $type, 0, strpos( $type, "\n" ) + 1 ); 442 $meta_value = "$url\n$len\n$type\n"; 443 $query = "INSERT INTO `".$wpdb->postmeta."` ( `meta_id` , `post_id` , `meta_key` , `meta_value` ) 444 VALUES ( NULL, '$post_ID', 'enclosure' , '".$meta_value."')"; 445 $wpdb->query( $query ); 446 } 447 } 448 } 449 } 414 450 415 451 // are we going from draft/private to published? … … 775 811 776 812 <?php 777 $bookmarklet_height= 420;813 $bookmarklet_height= (get_settings('use_trackback')) ? 460 : 420; 778 814 779 815 if ($is_NS4 || $is_gecko) { trunk/wp-rss2.php
r1575 r1786 42 42 <?php endif; ?> 43 43 <wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS> 44 <?php 45 $custom_fields = get_post_custom(); 46 if( is_array( $custom_fields ) ) { 47 while( list( $key, $val ) = each( $custom_fields ) ) { 48 if( $key == 'enclosure' ) { 49 $enclosure = $val[ 0 ]; 50 $enclosure = split( "\n", $enclosure ); 51 print "<enclosure url='".trim( $enclosure[ 0 ] )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n"; 52 } 53 } 54 } 55 ?> 44 56 </item> 45 57 <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
