• Resolved groloff

    (@groloff)


    Hi there. I′m trying to create a new scope (Now) to show the event taking place at the moment and the next event. The site is an online tv channel and I′m using this plugin to show the programs schedule (it′s like a “Now Playing” list) but it show no events on the list (this is the link to the site https://canalisb.dnet.cl/. The code I′m using is this:

    function my_em_scope_conditions($conditions, $args){
    if( !empty($args[‘scope’]) && $args[‘scope’]==’today-tomorrow’ ){
    $start_date = date(‘Y-m-d’,current_time(‘timestamp’));
    $start_time = date(‘H:i:s’,strtotime < (current_time(‘timestamp’)));
    $end_date = date(‘Y-m-d’,current_time(‘timestamp’));
    $end_time = date(‘H:i:s’,strtotime > (current_time(‘timestamp’)));
    $conditions[‘scope’] = ” (event_start_date BETWEEN CAST(‘$start_date’ AS DATE) AND CAST(‘$end_date’ AS DATE)) AND (event_start_time BETWEEN CAST(‘$start_time’ AS TIME) AND CAST(‘$end_time’ AS TIME))”;
    }
    return $conditions;
    }

    What it′s wrong with the code?
    Thanks a lot

    https://www.ads-software.com/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Trying a Now Scope’ is closed to new replies.