WordPress.org

Plugin Directory

Changeset 625713


Ignore:
Timestamp:
11/15/12 15:06:15 (17 months ago)
Author:
joedolson
Message:

Another hotfix, because I'm about to get on a plane.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • my-calendar/trunk/my-calendar-widgets.php

    r624660 r625713  
    358358         $spans = array(); 
    359359            $i = 0;  
    360             foreach ( $events as $k=>$event ) 
     360            // create near_events array 
     361            if ( is_array( $events ) ) { 
     362            foreach ( $events as $k=>$event ) { 
    361363                if ( $i < $count ) { 
    362364                    if ( is_array( $event ) ) { 
     
    411413                        } 
    412414                    } 
    413             }  
     415                } 
     416            } 
    414417            $e = false; 
    415           $events = $near_events; 
    416           @usort( $events, "my_calendar_datetime_cmp" ); // sort split events by date 
    417           // If more items in the list than there should be (possible, due to handling of current-day's events), pop off. 
    418           $intended = $before + $after; 
    419           $actual = count($events); 
    420           if ( $actual > $intended ) { 
    421                 for ( $i=0;$i<($actual-$intended);$i++ ) { 
    422                     array_pop($events); 
    423                 } 
    424           } 
     418            } 
     419        $events = $near_events; 
     420        @usort( $events, "my_calendar_datetime_cmp" ); // sort split events by date 
     421        // If more items in the list than there should be (possible, due to handling of current-day's events), pop off. 
     422        $intended = $before + $after; 
     423        $actual = count($events); 
     424        if ( $actual > $intended ) { 
     425            for ( $i=0;$i<($actual-$intended);$i++ ) { 
     426                array_pop($events); 
     427            } 
     428        } 
    425429        if ( is_array( $events ) ) { 
    426430            foreach( array_keys($events) as $key ) { 
Note: See TracChangeset for help on using the changeset viewer.