Changeset 6645

Show
Ignore:
Timestamp:
01/23/08 20:25:08 (8 months ago)
Author:
westi
Message:

Fix the updated times when publishing/editing with APP. See #5680 props rubys.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-app.php

    r6635 r6645  
    333333        $post_content = $parsed->content[1]; 
    334334        $post_excerpt = $parsed->summary[1]; 
    335         $pubtimes = $this->get_publish_time($parsed->published); 
     335        $pubtimes = $this->get_publish_time($entry->published); 
    336336        $post_date = $pubtimes[0]; 
    337337        $post_date_gmt = $pubtimes[1]; 
     338        $pubtimes = $this->get_publish_time($parsed->updated); 
     339        $post_modified = $pubtimes[0]; 
     340        $post_modified_gmt = $pubtimes[1]; 
    338341 
    339342        // let's not go backwards and make something draft again. 
     
    344347        } 
    345348 
    346         $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_date', 'post_date_gmt'); 
     349        $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt'); 
    347350        $this->escape($postdata); 
    348351 
     
    473476        $post_title = $parsed->title[1]; 
    474477        $post_content = $parsed->content[1]; 
    475  
    476         $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt'); 
     478        $pubtimes = $this->get_publish_time($parsed->updated); 
     479        $post_modified = $pubtimes[0]; 
     480        $post_modified_gmt = $pubtimes[1]; 
     481 
     482        $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_modified', 'post_modified_gmt'); 
    477483        $this->escape($postdata); 
    478484 
     
    582588        $post_date = $pubtimes[0]; 
    583589        $post_date_gmt = $pubtimes[1]; 
    584  
    585         $post_data = compact('ID', 'post_date', 'post_date_gmt'); 
     590        $pubtimes = $this->get_publish_time($parsed->updated); 
     591        $post_modified = $pubtimes[0]; 
     592        $post_modified_gmt = $pubtimes[1]; 
     593 
     594        $post_data = compact('ID', 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt'); 
    586595        $result = wp_update_post($post_data); 
    587596 
     
    709718        $count = get_option('posts_per_rss'); 
    710719 
    711         wp('what_to_show=posts&posts_per_page=' . $count . '&offset=' . ($count * ($page-1) )); 
     720        wp('what_to_show=posts&posts_per_page=' . $count . '&offset=' . ($count * ($page-1) . '&orderby=modified')); 
    712721 
    713722        $post = $GLOBALS['post']; 
  • trunk/wp-includes/post.php

    r6643 r6645  
    18841884        $post_date_gmt = current_time('mysql', 1); 
    18851885 
     1886    if ( empty($post_modified) ) 
     1887                $post_modified = $post_date; 
     1888    if ( empty($post_modified_gmt) ) 
     1889                $post_modified_gmt = $post_date_gmt; 
     1890 
    18861891    if ( empty($comment_status) ) { 
    18871892        if ( $update )