Listing featured events that occur today and in future

Serena
Serena
@serena
8 years ago
3 posts
Hi I have a section on my home page where I list only featured upcoming events.

Right now the event disappears as soon as event time passes (Please NOTE the event doesn't leave site as I have events set to never disappear). The events disappear from this widget because of this string:

search1="event_featured = on"
search2="event_date >= `$smarty.now`"

All I need to do is change the search2="event_date >= `$smarty.now` to be something like midnight today instead of 'right now'. Can anyone please help this non-coder with the code that will save my events from disappearing before the event has even gotten underway please?

Thanks,
Serena
updated by @serena: 03/20/17 06:17:32AM
michael
@michael
8 years ago
7,697 posts
search2="event_date >= `$smarty.now`" 
is going to evaluate into a timestamp, so become
search2="event_date >= 1481870742"
so you need to add the number of seconds between 'now' and 'midnight'. Thats a little harder than just adding a day to now. A day is 86400 seconds.

If that is acceptable, then
{$end = $smarty.now+86400}
{jrCore_list ......... search2="event_date >= $end" ........}

updated by @michael: 12/15/16 10:51:51PM
Serena
Serena
@serena
8 years ago
3 posts
Thanks Michael. It worked with $smarty.now-86400 (so events from up to 24 hours ago remain visible).
Cheers
updated by @serena: 12/15/16 11:40:11PM
michael
@michael
8 years ago
7,697 posts
you are a programmer ;) ( I'm going to claim that I left that code mistake in there on purpose :) )

Glad you figured it out.
joanna
@joanna
8 years ago
88 posts
@serena - now in event settings you can choose how many hours you want the event should stay visible for others after the start time.
It was released a few days ago.
It resolved many of our challenges with disappearing events.

Tags