Posted: December 3, 2013 at 9:27 pm
|
This is a follow-up to this. My question is: what exactly is the behavior of events with a status of “ongoing” and specifically recurring events with a status set to “ongoing?” Here is my solution to the original post thus far: Each class has all occurrences but the first set to not display a registration page and the alternate registration URL is set to the first occurrence. Then, after each class occurs, it is updated to display the registration (details) page, the alternate URL is cleared, and the link to the video is added to the description. All good so far. The issue du jour is that I am specifying <code>if ($show_expired == "false") { $sql .= " AND start_date >= '" . date('Y-m-d') . "' "; $sql .= " AND e.registration_start <= '" . date('Y-m-d') . "' "; $sql .= " AND e.registration_end >= '" . date('Y-m-d') . "' "; }</code> My first inclination is to add:
but I first wanted clarification on the intended behavior of recurring events with a status of “ongoing” and whether this might cause other problems.
|
|
Hi Mark, what exactly is the behavior of events with a status of “ongoing” and specifically recurring events with a status set to “ongoing?” An ongoing event is basically one that doesn’t expire even when the end dates are past. This should be the same for normal and recurring events. Can I ask what you are using to display the events? Is it the ESPRESSO_TABLE or the EVENT_LIST? Ongoing events are not expired as such, however the SQL query may well ignore them due to the dates, so adding in $sql .= ” OR e.event_status == ‘O’ “; may work but only if the dates SQL section is modified. The EVENT_LIST shortcode should display ongoing events without modification and with show_expired omitted or set to false. |
|
Hi Dean, “Can I ask what you are using to display the events? Is it the ESPRESSO_TABLE or the EVENT_LIST?” I am hoping to use the calendar as the UI to all event data as I feel it is the most intuitive way for people to interact with date related information. So a month display will have all of the upcoming classes (linked to registration pages), our regular weekly Sunday events (no registration), and the recorded classes should be the only events remaining after “today” and have the video embedded in the individual event’s “details” page. Sorry I did not mean to imply that that was the exact syntax for the sql modification I had in mind, just wanted to show the direction I was thinking of heading in if you blessed it as a sane thing to do…. |
|
Just a quick note, in sql the test for equality is done using a single equal sign: $sql .= " OR e.event_status = 'O' "; The double equal sign is used in php for a loose equality and a triple equal sign for exact equality. |
|
Yep, that is exactly what phpMyAdmin said as well; you’re about 15 min. too late…but I really appreciate the support you all provide! I play with SQL just often enough to be dangerous. This version seems to be yielding the desired results: <pre class=”brush: text; gutter: true; first-line: 1; highlight: []; html-script: false”>SELECT e.*, ese.start_time, ese.end_time |
|
“I play with SQL just often enough to be dangerous.” I am the same! So you have this working for your needs now or is there still an outstanding issue? |
|
Yes, it does appear to be working, the ongoing events do remain on the calendar after the date they occur. Now, as I see that the espresso_calendar_do_stuff function in espresso-calendar.php is not “pluggable” and I see no other way to implement this “enhancement” without modifying the core plugin and given that you stated the intended behavior of ongoing events as:
I am willing to suggest that possibly this is a bug, that my code fixes, and therefore should become part of core…?…had to try…. But seriously, would it be worth submitting a bug? Otherwise I need to weigh the effort of retrofitting future upgrades against having the calendar function as desired (and apparently as intended). |
|
Hi Mark, I will certainly raise it with the developers but I can’t say if it is something that will be included or not. |
|
Hi Dean, I would like to leave this open until a desicion is made. Although this is the way I would prefer to implement (and again, the way I believe it is intended to function), I can not in good conscience impose retofitting a core patch on those who are to follow me; however, the thought of leaving all of that “noise” in the calendar just to allow the few classes that get recorded remain is certainly not ideal and I suspect is not going to benefit performance either. Anxiously awaiting developer’s decision…. |
We can probably add a filter there where it checks if show_expired = false in a future release so it can be overridden. From what I’ve seen some folks do not want ongoing events to appear on the calendar, because they don’t really want them associated with a specific date. As an aside, the next version of the calendar we are working on loads up the events month by month, so when it loads up expired events, it’s only this month’s expired events that initially get loaded up. You can test out a copy of the beta of the new calendar by downloading it from your account page after you opt in to the pre-release channel. |
|
|
Hey Josh, thanks for the feedback! That is why I first asked about the intended functionality of “ongoing” events to determine if ours was a unique use case…but it seems at this juncture, regardless of what may transpire in the future, I need to work with what is. I have already joined the pre-release channel so I will take a look at that. One of my primary requirements is to keep event management as simple as possible for the folks tending to it…so having classes that have occurred vanish from the calander…. That being said and based upon what I have to work with, here is my plan: During the current semester all events will have a status of active and then those that are not recorded will be set to inactive, and have all of the recurring dates deleted, at the end of the semester. (I am assuming I can then reuse the same event for the same class next year by updating dates and setting the status back to active…? Still need to test that.) Then, for the classes that get recorded, I will create a catagory with a unique background color and assign it to the event when the video is posted so at least they visually standout on the UI. (I am seeing the need for a “legend” in the sidebar.) This does increase the event management effort and complexity between semesters…here’s hoping we’re up to the task! |
The support post ‘Display recording from event after its date for select events (cont.)’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.