Support

Home Forums Events Calendar Add-on Display recording from event after its date for select events (cont.)

Display recording from event after its date for select events (cont.)

Posted: December 3, 2013 at 9:27 pm


Mark Cockfield

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 show_expired=”false” on the calendar page shortcode and it is suppressing everything as a result of:

<code>if ($show_expired == &quot;false&quot;) {
$sql .= &quot; AND start_date &gt;= &#039;&quot; . date(&#039;Y-m-d&#039;) . &quot;&#039; &quot;;
$sql .= &quot; AND e.registration_start &lt;= &#039;&quot; . date(&#039;Y-m-d&#039;) . &quot;&#039; &quot;;
$sql .= &quot; AND e.registration_end &gt;= &#039;&quot; . date(&#039;Y-m-d&#039;) . &quot;&#039; &quot;;
}</code>

My first inclination is to add:

$sql .= " OR e.event_status == 'O' ";

but I first wanted clarification on the intended behavior of recurring events with a status of “ongoing” and whether this might cause other problems.


Dean

December 5, 2013 at 3:44 am

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.


Mark Cockfield

December 5, 2013 at 12:51 pm

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….


Sidney Harrell

December 5, 2013 at 3:55 pm

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.


Mark Cockfield

December 5, 2013 at 4:11 pm

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
FROM wp_events_detail e
LEFT JOIN wp_events_start_end ese ON ese.event_id= e.id
WHERE e.is_active != 'N'
AND e.event_status != 'D'
AND e.event_status != 'S'
AND e.event_status != 'P'
AND e.event_status != 'X'
AND e.event_status != 'R'
AND ((e.start_date >= '2013-12-05'
AND e.registration_start <= '2013-12-05'
AND e.registration_end >= '2013-12-05')
OR e.event_status = 'O')
GROUP BY e.id ORDER BY e.start_date = '0000-00-00' ASC


Dean

December 6, 2013 at 4:42 am

“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?


Mark Cockfield

December 6, 2013 at 12:01 pm

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:

“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.”

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).


Dean

December 9, 2013 at 3:09 am

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.


Mark Cockfield

December 9, 2013 at 12:49 pm

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….


Josh

  • Support Staff

December 10, 2013 at 8:26 am

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.


Mark Cockfield

December 10, 2013 at 1:27 pm

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.

Event Espresso