Events Made Easy › Forums › How do I … › Finished events dosn't dissapear.
- This topic has 8 replies, 3 voices, and was last updated 13 years, 7 months ago by Franky.
-
AuthorPosts
-
Tue 5 Apr 2011 at 18:54 #42689AnonymousInactive
I have list with upcoming tv transmisions and i’d like them to dissapear from list after transmision is finished. I’ve added “End Date and hour” but events are still visible till the end of day.
Is there anything i can do to achive that ?
Tue 5 Apr 2011 at 19:08 #47442FrankyKeymasterFor the moment it’s based on the date only. But if you want this, edit eme_events.php and change line 1244 and next from:
//$conditions [] = " ((event_start_date = '$today' AND event_start_time >= '$this_time') OR (event_start_date > '$today') OR (event_end_date > '$today' AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL) OR (event_end_date = '$today' AND event_end_time >= '$this_time'))";
// not taking the hour into account until we can enter timezone info as well
$conditions [] = " (event_start_date >= '$today' OR (event_end_date >= '$today' AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL))";to
$conditions [] = " ((event_start_date = '$today' AND event_start_time >= '$this_time') OR (event_start_date > '$today') OR (event_end_date > '$today' AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL) OR (event_end_date = '$today' AND event_end_time >= '$this_time'))";
// not taking the hour into account until we can enter timezone info as well
//$conditions [] = " (event_start_date >= '$today' OR (event_end_date >= '$today' AND event_end_date != '0000-00-00' AND event_end_date IS NOT NULL))";As you can see: the code is already there …
Tue 5 Apr 2011 at 19:46 #47443AnonymousInactiveI did it but it dosn’t work 🙁
Tue 5 Apr 2011 at 21:25 #47444FrankyKeymasterUse also “scope=future” to the [events_list] shortcode
Sat 9 Apr 2011 at 00:40 #47445AnonymousInactive$this_time should be $this_hour in code. I think??
$today = date(“Y-m-d”);
$this_hour = date (“H:i:00”);
Sat 9 Apr 2011 at 06:57 #47446FrankyKeymasteryes (it is unused code after all), but I changed ‘$this_hour’ into ‘$this_time’ (same result) at line 1181
Sat 9 Apr 2011 at 16:11 #47447AnonymousInactiveHey Franky,
Is there a way to get this to work on the events/?calendar_day=2011-04-09 page for example as well? Right now it shows events that run past midnight from the previous day.
Sat 9 Apr 2011 at 16:31 #47448AnonymousInactiveI changed
if (preg_match ( “/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/”, $scope )) {
// $conditions [] = ” event_start_date like ‘$scope'”;
$conditions [] = ” ((event_start_date like ‘$scope’) OR (event_start_date <= ‘$scope’ AND event_end_date >= ‘$scope’))”;
to
if (preg_match ( “/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/”, $scope )) {
$conditions [] = ” event_start_date like ‘$scope'”;
// $conditions [] = ” ((event_start_date like ‘$scope’) OR (event_start_date <= ‘$scope’ AND event_end_date >= ‘$scope’))”;
and it seems to work. Looks like you had the code in there already, maybe ??
Sat 9 Apr 2011 at 17:03 #47449FrankyKeymaster@linkshark: can you create a feature request for this? Seems like the “long_events” option for the calendar shortcode should be present also for the events_list shortcode.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.