Changeset 2106

Show
Ignore:
Timestamp:
06/26/08 05:07:35 (7 months ago)
Author:
michaeltwofish
Message:

Fix comments feed for individual posts.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/111307-atom/system/classes/atomhandler.php

    r2070 r2106  
    435435    function get_comments( $params= array() ) 
    436436    { 
    437         $alternate= URL::get( 'atom_feed_comments' ); 
    438  
     437        $comments = ''; 
     438 
     439        // Assign alternate link. 
     440        $alternate = URL::get( 'atom_feed_comments' ); 
     441 
     442        // Assign self link. 
    439443        $self= ''; 
    440444        if ( isset( $params['slug'] ) || isset( $params['id'] ) ) { 
    441445            if ( isset( $params['slug'] ) ) { 
    442446                $post= Post::get( array( 'slug' => $params['slug'] ) ); 
     447                $comments = $post->comments->approved; 
    443448            } 
    444449            elseif ( isset( $params['id'] ) ) { 
    445450                $post= Post::get( array( 'id' => $params['id'] ) ); 
     451                $comments = $post->comments->approved; 
    446452            } 
    447453            $content_type= Post::type_name( $post->content_type ); 
     
    450456        else { 
    451457            $self= URL::get( 'atom_feed_comments' ); 
     458            $params['status'] = Comment::STATUS_APPROVED; 
     459            $comments= Comments::get( $params ); 
    452460        } 
    453461 
     
    456464        $xml= $this->create_atom_wrapper( $alternate, $self, $id ); 
    457465 
    458         $params['status'] = Comment::STATUS_APPROVED; 
    459  
    460         $comments= Comments::get( $params ); 
    461466        $xml= $this->add_comments($xml, $comments ); 
    462467 
     
    609614        $alternate= URL::get( $alternate_rules[$rr_name], $handler_vars, false ); 
    610615 
     616        // Assign self link based on the matched rule. 
    611617        $self= URL::get( $rr_name, $rr_args, false ); 
    612618