Welcome Guest, Not a member yet? Register   Sign In
How to...
#6

[eluser]Nick Husher[/eluser]
Code:
function addEventsToCalendar($events) {
    for($events as $eventKey=>$eventValue) {
        $eventDate = split('-',$eventKey);
        $eventYear = $eventDate[0];
        $eventMonth = $eventDate[1];
        $eventDay = (int)$eventDate[2];
        
        $calendarEntry = array($eventDay => $eventValue);
        
        $this->calendar->generate($eventYear, $eventMonth, $calendarEntry);
    }
}

addEventsToCalendar(array(
    '2008-11-1'=>'http://example.com/news/article/...',
    '2008-12-15'=>'http://example.com/news/article/...',
    '2008-12-20'=>'http://example.com/news/article/...'
));

The above code is untested, but I hope you can see where I'm going with it...


Messages In This Thread
How to... - by El Forum - 11-13-2008, 01:39 PM
How to... - by El Forum - 11-16-2008, 04:08 AM
How to... - by El Forum - 11-16-2008, 04:15 AM
How to... - by El Forum - 11-16-2008, 04:28 AM
How to... - by El Forum - 11-16-2008, 05:06 AM
How to... - by El Forum - 11-16-2008, 08:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB