Welcome Guest, Not a member yet? Register   Sign In
Why am I getting these notices? I haven't before. Undefined offset / index for a custom calendar class.
#7

[eluser]Kinsbane[/eluser]
[quote author="xwero" date="1237246226"]in the array you copied here i see some indexes start with 1
Code:
[1236153600] => Array
        (
            [1] => Array
                (
                    [0] => events/event/1163
                    [1] => on schedule
                    [2] => Comptel Spring 2009
                    [3] => #2a4bd7
                )
        )
[/quote]

The reason for that is so when the HTML part is written, when it writes the events for the day inside the table cell, it keeps all the events on the same line. Say you have an event that is for the 5th and 6th, and another event for the 6th and 7th - when it gets to the 7th, the program knows that it needs to make space for the event that came before it, so in the days that come after one that had an event, it adjusts that particular index to make space. If you look at http://www.kinsbane.net/temp/calendar-sample.jpg you'll see.

The structure of the array is as follows:

$array[*date*] (each day of the month gets an array)
$array[*date*][*position*] (for each event in a day, this determines the events position, from top (0) to bottom ( > 0 ) within that day)
$array[*date*][*position*][*event-info*] (each event has an array of info to link to the event display page, the title, the event's status, and the unique color that event block link should be)


Messages In This Thread
Why am I getting these notices? I haven't before. Undefined offset / index for a custom calendar class. - by El Forum - 03-16-2009, 03:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB