Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Daniel J. Lewis

    (@djosephdesign)

    Are both events public?

    The order dmorton91 is talking about is the order in which the events were published. This is the default for the API call you are using. So if you publish an event 2 days out and then publish an even 1 day out. the 2 day out event will be in the [0] spot in the entry array returned.

    I had the same problem so here is the code to fix it so the next event by start date and time will publish.

    if (isset($feed->feed->entry)) {
                    //mod to get soonest start date
                    $entries = count($feed->feed->entry);
                    $order = 0;
                    $closestid = 0;
                    $mostrecentdate = strftime(strtotime('+1 years'));
                    $ytwhen = 'yt$when';
                    while($entries > 0){
                       $entrystart = strftime(strtotime($feed->feed->entry[$order]->$ytwhen->start));
    
                       if($entrystart < $mostrecentdate){
                           $closestid = $order;
                       }
                       $entries--;
                       $order++;
                    }
                    // We have a live video!
                    $videoFeedUrl = $feed->feed->entry[$closestid]->content->src;
    Plugin Author Daniel J. Lewis

    (@djosephdesign)

    Thanks for the fix, reachingnexus! We’ll test this and try to push it out in an update this week.

    Plugin Author Daniel J. Lewis

    (@djosephdesign)

    This tested successfully and version 2.3.2 is now available to fix this problem!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Live Events in Wrong Order’ is closed to new replies.