Home › Forums › Welcome! › Pre-Sales Questions › How are recurring events managed in the database?
- This topic has 3 replies, 1 voice, and was last updated 10 years, 11 months ago by
Brian.
-
AuthorPosts
-
June 3, 2015 at 2:36 pm #967037
Steve Taylor
GuestI’m weighing up options for a client site, between Events Manager, Events Calendar (and possibly a custom plugin).
On our events listing we need to be able to list filtered by date (in which case each instance of recurring events would be listed separately) or other criteria such as category (in which case the listing would be a mixture of one-off events, and single items representing all instances of a recurring event).
Events Manager seems to have two separate CPTs for events and recurring events, with instances of a recurring event related to their “parent” recurring event. This works well for our requirements.
With Events Calendar, we’ve tried the demo of the Pro version with recurring events, and it’s hard to see from that how it works underneath the hood. Are the “parent” instances of recurring events the same post type with some metadata, and the “child” instances linked to the parent via metadata? Or are there two post types.
It’d be really good to know how this works as part of our assessment.
Thanks!
June 4, 2015 at 6:28 am #967143Brian
MemberHi,
Thanks for the interest in our plugins.
Our recurring events are the same custom post type as regular events. ( tribe_events )
Each event in a recurring series is created as separate events and then information in a custom field links them all together.
In the admin there is options to edit the series of events or you can modify a single event in the series. However, if you modify a single event it breaks it out of the series.
Let me know if you have any follow up questions.
Thanks
June 5, 2015 at 3:11 am #967373Steve Taylor
GuestThanks for the feedback (though, a note for your web admins, I didn’t seem to get an email notification when you repsonded?).
Anyway, I guess my remaining question is, is there a “parent” event for a series? Or, when you create a recurring series, do you fill in fields which are simply used to create each instance, which are all grouped together with a custom field?
I’m trying to envision (without being able to test) how to query to select at once:
* All one-off events
* All event series as single records representing the whole seriesIf there’s a “parent” event for each series, this will probably be fine, but I’m concerned about how the SQL will work if I have to group by a custom field. If there’s no “parent”, is there any way I can get hold of a test copy of the Pro plugin?
June 5, 2015 at 7:21 am #967406Brian
MemberHi,
After the first instance in the series all the recurring events have a post_parent value set to the first event’s id.
All the recurring events including the first event have serialized information for the recurrence in this custom field:
_EventRecurrence
This is an example of data store in there:
a:15:{s:4:"type";s:10:"Every Week";s:8:"end-type";s:2:"On";s:3:"end";s:10:"2015-06-19";s:9:"end-count";s:1:"1";s:11:"custom-type";s:5:"Daily";s:15:"custom-interval";s:0:"";s:16:"custom-type-text";s:0:"";s:21:"occurrence-count-text";s:4:"week";s:19:"custom-month-number";s:5:"First";s:16:"custom-month-day";s:1:"1";s:24:"custom-year-month-number";s:1:"1";s:21:"custom-year-month-day";s:1:"1";s:22:"recurrence-description";s:0:"";s:14:"EventStartDate";s:19:"2015-06-05 08:00:00";s:12:"EventEndDate";s:19:"2015-06-05 17:00:00";}Each event in the series has it’s own copy of the fields for the date, title, description, etc..
So to query recurring events you could follow what Barry suggests here:
As for one off events you could look for those events with both no post_parent and no _EventRecurrence.
Cheers
PS: I will let our developers know about the email notification.
-
AuthorPosts
- The topic ‘How are recurring events managed in the database?’ is closed to new replies.
