Show
Ignore:
Timestamp:
07/04/08 22:02:21 (5 months ago)
Author:
arthus
Message:

Allow AJAX requests for lifestream

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/lifestream/trunk/lifestream.plugin.php

    r668 r669  
    167167    } 
    168168     
    169     public function json_entries($type = 'any', $offset = 0, $number = 20) { 
    170         return json_encode($this->get_entries($type, $offset, $number, 'array')); 
     169    public function action_ajax_lifestream_entries($type = 'any', $offset = 0, $number = 20) { 
     170        echo json_encode($this->get_entries($type, $offset, $number, 'array')); 
    171171    } 
    172172     
     
    187187    public function act_display_lifestream() { 
    188188        $vars = Controller::get_handler_vars(); 
     189         
     190        $this->fetch_feeds(); 
    189191                 
    190192        if(!isset($vars['type'])) { 
     
    218220                    if ( $enclosure = $entry->get_enclosure( 0 ) ) { 
    219221                        $data['data'] = $enclosure->get_link(); 
     222                        $this->stream_contents[$date]= $data; 
    220223                    } 
    221                      
    222                     $this->stream_contents[$date]= $data; 
    223224                     
    224225                } 
    225226            } 
    226227        } 
    227          
    228         ksort( $this->stream_contents ); 
    229          
     228 
    230229        LifeStream::insert($this->stream_contents); 
    231230