[EventCalendar] Repeating events in EventCalendar
David Moody
moody.d at hotmail.com
Tue May 5 16:39:15 UTC 2009
Hi Sam,
No, I didn't use the hooks, and I didn't read Alex's coding practices. Bad boy. =) At some point, I'd like to implement it "properly" so it can become an add-on, so if you can point me in the right direction I'll make the appropriate changes.
The hacks are in two functions: event_editor_box() (in admin.php) and Ec3EditForm.add_row (in edit.form.js).
I was originally going to use the "rpt" column in the database, but then I realized (like you) that I might want to remove or edit individual items. So instead, this implementation simply inserts individual entries for you, using the last entry as a starting point. That way you can add, for example, an event on the first Monday of the month, then choose "Repeat by Month Week/Day" 11 times, and you will have the event scheduled for the entire year, always on the first Monday of the month. Each individual date is visible, so if you want to remove one specific date, you can. The other advantage of this method is that it doesn't affect the database structure or overall architecture of the plug-in at all, so if you remove the hack, the entries you created are still there.
Another thought I had was giving the option to repeat until a certain date. I'll probably take a look at that over the next couple of weeks when I get a chance.
Thanks for the feedback!
David
From: Samuel Clemance
Sent: Tuesday, May 05, 2009 12:06 PM
To: Support for EventCalendar plugin
Subject: Re: [EventCalendar] Repeating events in EventCalendar
Hi David.
Sounds like you've made some good headway on this area. It might be something to make this into a branch because it is on the wishlist for 2.4 I'm just curious about how you've implemented it. Did you create a separate file to handle it, did you hack the main EC files significantly, are you using the hooks in EC that Alex created? Did you check out Alex's coding practices and follow them? When you use those repeat functions does it add each item to the list (as if you manually entered it) or does it just work off the info you input for repeating? I think it would be nice to have it add individual items to the editor so that single days can be removed if there's an exception.
Looks good to me tho David! Thanks for letting us know about it.
Sam
From: David Moody
Sent: Monday, May 04, 2009 1:27 PM
To: eventcalendar at firetree.net
Subject: [EventCalendar] Repeating events in EventCalendar
If anyone is interested, I have made a simple implementation of repeating events in EventCalendar v3.2.beta2.
My solution was to add a drop-down list next to the [+] (add event) button which gives you a choice of repeating the previous entry by week, month date (e.g. the 15th of every month), or by month week/day (e.g. the 2nd Monday of every month), and a text field to indicate how many times to repeat. This involved making changes to admin.php and editform.js.
With this mod, you can repeat an event forward for as many weeks or months as you would like.
You can see a screenshot of how it looks at http://www.chippawapc.ca/wordpress/EventCalendarRepeater.jpg
If anyone is interested in the code, email me at moody.d at hotmail.com
Thanks for a great plug-in!
David
--------------------------------------------------------------------------------
_______________________________________________
Blog: http://wpcal.firetree.net/
EventCalendar at firetree.net mailing list
Unsubscribe: http://penguin.firetree.net/eventcalendar
--------------------------------------------------------------------------------
_______________________________________________
Blog: http://wpcal.firetree.net/
EventCalendar at firetree.net mailing list
Unsubscribe: http://penguin.firetree.net/eventcalendar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20090505/5be56aca/attachment.html
More information about the EventCalendar
mailing list