Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter Thijsonline

    (@thijsonline)

    I should add that I’ve set the “Treat current events as past” to No, but this doesn’t seem to have the desired effect.

    caimin_nwl

    (@caimin_nwl)

    That’s the intended behavior. If you let me know what you’re trying to do there might be a workaround I can suggest.

    Thread Starter Thijsonline

    (@thijsonline)

    Thanks for the quick response. I was hoping to indicate to visitors when an event is ended. So, something like:

    “This event took place in the past, the information will be updated once new dates are available”

    However, this is now also showing for events that are still ongoing, which will confuse visitors.

    what happens if you set Are current events past events =Yes ?also, do you have a sample link for us to see?

    Thread Starter Thijsonline

    (@thijsonline)

    Sorry to say that I don’t have a live environment available to link to, below is what happens when changing the settings.

    Set to ‘Yes’

    • Shows multiple-day events that start today and shows the “Event is in the past” message.
    • Shows future events without the “Event is in the past” message.

    Set to ‘No’

    • In addition to above, also showing multiple-day events that started in the past and continue today/in the future with the “Event is in the past” message.

    So it seems that in my implementation, changing the setting works perfectly for the placeholder [events_list], but it doesn’t affect the {is_past} which seems to take the starting time of events to verify if an event is in the past and not the end time of events.

    hmm, seems to worked fine;

    e.g.

    [events_list scope="all"]
    <h2>#_EVENTLINK</h2>
    <p>
     {is_past}This event took place in the past...{/is_past}
     {is_future}
      #_EVENTNOTES
     {/is_future}
    </p>
    [/events_list]

    Thread Starter Thijsonline

    (@thijsonline)

    Well, more or less. The text should then say “This event started in the past”.

    I’m having the problem with the single event page (not the events_list) where I’m showing the message.

    I also tried this on my settings > formatting > events > default single event format but still working fine?

    <div style="float:right; margin:0px 0px 15px 15px;">#_LOCATIONMAP</div>
    <p>
    	<strong>Date/Time</strong><br/>
    	Date(s) - #_EVENTDATES<br /><i>#_EVENTTIMES</i>
            <br/>#_12HSTARTTIME - #_12HENDTIME
    </p>
    {has_location}
    <p>
    	<strong>Location</strong><br/>
    	#_LOCATIONLINK
    </p>
    {/has_location}
    <p>
    	<strong>Category(ies)</strong>
    	#_CATEGORIES
    </p>
    <br style="clear:both" />
    #_EVENTNOTES
    
    <br style="clear:both" />
    {is_past}<strong>This event took place in the past...</strong>{/is_past}
    
    {has_bookings}
    <h3>Bookings</h3>
    #_BOOKINGFORM
    {/has_bookings}
    Thread Starter Thijsonline

    (@thijsonline)

    That’s bizar. Mmmmh, any chance you could let me know where is_past is defined so that I can start checking what it is that I did to get myself into this situation?

    Thread Starter Thijsonline

    (@thijsonline)

    Is it possible that is_past is related to booking data?

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    in classes/em-event.php

    }elseif ($condition == 'is_past'){
    //if event is past
    $show_condition = $this->start <= current_time('timestamp');
    Thread Starter Thijsonline

    (@thijsonline)

    Hi Marcus, thanks for pointing that out. Maybe it’s just me, but this condition tells me that it considers any event beyond or equal to the start date & time to be a past event. Maybe I’m not reading it right?

    Instead of “start <= current_time” I’d expect “end <=current_time” to get it to do what I’m looking for (i.e. only post a comment once the complete event is over and the end date has past).

    Hopefully that makes sense.

    Thread Starter Thijsonline

    (@thijsonline)

    Just went ahead and tried changing the condition to end <=current_time and indeed now it properly shows the comment of “This is a past event” when an event is completely over.

    In no way ‘update proof’, but working for now.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    it’s a bug, because it’s not taking the option ‘are current events past events’ into consideration.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Conditional is_past also applies to current?’ is closed to new replies.