Plugin Directory

Changeset 206707


Ignore:
Timestamp:
02/16/2010 08:41:20 PM (16 years ago)
Author:
zeeg
Message:

Better support for determining if its an event via ls_is_event

Location:
lifestream/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lifestream/trunk/extensions/youtube/extension.inc.php

    r206702 r206707  
    6767    }
    6868   
    69     function render_item($row, $item, $options)
     69    function render_item($row, $item)
    7070    {
    71         if (count($row->data) > 1 || !$item['player_url'] || !$options['is_single'])
     71        if (count($row->data) > 1 || !$item['player_url'] || !ls_is_event())
    7272        {
    7373            $attrs = array(
  • lifestream/trunk/inc/core.php

    r206693 r206707  
    715715        {
    716716            $ls_template->get_events();
    717            
    718717            include($this->get_template('event.php'));
    719718            exit;
  • lifestream/trunk/inc/template.php

    r206702 r206707  
    1010    var $events = array();
    1111    var $posts = array();
     12    var $in_event = false;
    1213   
    1314    function __construct($lifestream)
     
    1819    }
    1920   
     21    function set_in_event($true_or_false=true)
     22    {
     23        $this->in_event = $true_or_false;
     24    }
     25   
    2026    function set_event($event)
    2127    {
     
    2733        return is_single();
    2834    }
     35   
     36    function is_event()
     37    {
     38        return $this->in_event;
     39    }
    2940
    3041    function get_events()
     
    3243        global $posts, $wp_query;
    3344       
    34         if ($this->is_single())
     45        if (is_single())
    3546        {
    3647            $this->page = 1;
     
    100111        if ($this->current_event + 1 < $this->event_count)
    101112        {
     113            $this->set_in_event(true);
    102114            return true;
    103115        }
     
    107119            $this->rewind_events();
    108120        }
    109 
     121        $this->set_in_event(false);
    110122        $this->in_the_loop = false;
    111123        return false;
     
    236248}
    237249
     250function ls_is_event()
     251{
     252    global $ls_template;
     253   
     254    return $ls_template->is_event();
     255}
     256
    238257function ls_is_single()
    239258{
Note: See TracChangeset for help on using the changeset viewer.