We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31337
    • 258 Posts
    Quote from: wendy at Jan 11, 2006, 10:50 PM


    Ehmm.. I mean recurring events, not span.


    Oh well duh, no wonder I misunderstood the problem grin In my defense I haven’t slept in like 2 weeks due to a new baby, so my reading comprehension skills are not at their finest.

    Anyway, as for recurring events, I think this is not too hard to solve via brute force. If the event repeats every 3 weeks (or whatever), then when the event is created, insert a separate entry in the calendar for each of those events. Then each event (recurring or not) has a column for a parent id -- which for single events would be just itself, and for recurring events, would be the event that originated the recurrence. Thus you basically treat each occurrence of a repeated event as its own even, that just happens to have the same parent ID as another event so that they can be linked together.

    Does that make sense? In my state now it makes perfect sense to me, but sleep deprivation does funny things to you grin Please ask if I can clarify this a little better.
      • 32241
      • 1,495 Posts
      That’s might be one of the solution, but think of it this way, we can divide the recuring events into several type.
      1. Recuring with certain repeater times (we can solve this with your way)
      2. Recuring with no end (we can solve this with phil suggestion)

      So here is the thing, the current database, I have column for calendarid, description, details, date_begin, date_ended, time_begin, and time_ended.

      To achieve the first one, then I need to add 1 more column call parentid (default null/zero), then I need to change the way the editing function works, and the way it fetch database.

      To achieve the second one, this is a little bit tricky, but still do able. We add another column called recurrence that will have enum value of none, weekly, monthly, and yearly. Basically for weekly, the date difference between date_begin and date_ended cannot be more than 7, which is we call that the spans. Same thing with monthly and yearly. The hardest part is, for each weekly, monthly, or yearly, we need to deal with it differently. For weekly, it will be based on day (monday, tuesday, and etc), while for monthly or yearly, we might need to deal with it from the date (date 4th on each month, every january 1st, or every december 24th). If we want to make a lot advanced, we can let the user defined the way how the recurrence will happn, but it’s way too advanced, and I’m not gonna touch that at all, at least for now.

      SO.. I will just release the first beta without any of those functionality at all, because it needs a total remodification for the admin part, as well as from the front part, to read the events.

      One more thing to note, I made this system to have the database column expandable, which mean that we can more column to it, and all we need to do just include a different chunk for the admin, but I might want to make it has a fix column with some extra columns, in case somebody need it, to prepare it for including those two advance recuring events.

      Regards,
        Wendy Novianto
        [font=Verdana]PT DJAMOER Technology Media
        [font=Verdana]Xituz Media
        • 32241
        • 1,495 Posts
        Ok, I just put it on the forum guys.

        http://modxcms.com/forums/index.php/topic,2318.msg15576.html#msg15576

        Please check the code. Helps will be really2 appreciated.

        Btw, time to get back the drawing board. I just heard from Jason that he is thinking of making this into a bigger project, so that it supports ical format and bla bla bla... grin

        So, if you guys interested, I think we can setup a new forum topic, and discuss about the current architecture, and lets design it based on my architecture for now. I’ll explain the full detailed in link above.

        Sincerely,
          Wendy Novianto
          [font=Verdana]PT DJAMOER Technology Media
          [font=Verdana]Xituz Media