Events Made Easy Forums How do I … Finished events dosn't dissapear.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #42689
    Anonymous
    Inactive

    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 ?

    site: http://sport.pressbite.pl

    #47442
    Franky
    Keymaster

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

    #47443
    Anonymous
    Inactive

    I did it but it dosn’t work 🙁

    #47444
    Franky
    Keymaster

    Use also “scope=future” to the [events_list] shortcode

    #47445
    Anonymous
    Inactive

    $this_time should be $this_hour in code. I think??

    $today = date(“Y-m-d”);

    $this_hour = date (“H:i:00”);

    #47446
    Franky
    Keymaster

    yes (it is unused code after all), but I changed ‘$this_hour’ into ‘$this_time’ (same result) at line 1181

    #47447
    Anonymous
    Inactive

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

    #47448
    Anonymous
    Inactive

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

    #47449
    Franky
    Keymaster

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top