Support » Plugin: Events Manager » Scope future not working in shortcode

  • Resolved ateicos

    (@ateicos)


    Hello everyone.

    I’ve some trouble with “event manager” in shortcode when I want to show future events.

    [events_list category=”17,18,19,20″ groupby=”event_name” orderby=”event_start_date” order=”ASC” groupby_orderby=”event_start_date, event_start_time” groupby_order=”ASC” scope=”future” limit=”4″ ]
    <div class=”list_event”><span class=”event”>#_EVENTLINK<br>
    <span class=”event_where_when”><span class=”event_day”>#_{d}</span> <span class=”event_month”>#_{M}</span> <span class=”event_year”>#_{Y}</span></span></span><br class=”clearboth”></div>[/events_list]

    This shortcode generates some conflicts.
    Here the SQL code generated in events-manager\classes\em-events.php [line:194]

    SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_em_events.post_id, event_start_date FROM wp_em_events WHERE (event_status=1) AND (recurrence!=1 ORrecurrenceIS NULL) AND (wp_em_events.post_id IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN (17,18,19,20) )) LIMIT 4 OFFSET 0

    This code need to have this WHERE statement
    event_start_date >= NOW()`

    • This topic was modified 6 months ago by ateicos.
    • This topic was modified 6 months ago by ateicos.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ateicos

    (@ateicos)

    In “public static function get_default_search(” there isn’t a “scope” check even if it’s passed by var $array_or_default

    For now i’ve fix this bug with this code on line 235
    $where = ( count($conditions) > 0 ) ? ” WHERE event_start_date >= now() AND ” . implode ( ” AND “, $conditions ):”;

    • This reply was modified 6 months ago by ateicos.
    Plugin Author Marcus

    (@netweblogic)

    I’ve tested this out and it works fine for me, but the reason yours doesn’t work if I copy/paste it is because your quotation marks are a different format. For example, try this

    [events_list category="17,18,19,20″ groupby="event_name" orderby="event_start_date" order="ASC" groupby_orderby="event_start_date, event_start_time" groupby_order="ASC" scope="future" limit="4″ ]
    <div class="list_event"><span class="event">#_EVENTLINK<br>
    <span class="event_where_when"><span class="event_day">#_{d}</span> <span class="event_month">#_{M}</span> <span class="event_year">#_{Y}</span></span></span><br class="clearboth"></div>[/events_list]
    Thread Starter ateicos

    (@ateicos)

    Hi, today it doesn’t work anymore.

    I will edit again with custom php code.

    [code]`if ( $_SERVER['REQUEST_URI'] != '/' ) {
    $where = ( count($conditions) &gt; 0 ) ? " WHERE " . implode ( " AND ", $conditions ):'';
    } else {
    $where = ( count($conditions) &gt; 0 ) ? " WHERE event_start_date &gt;= now() AND " . implode ( " AND ", $conditions ):'';
    }`[/code]

    • This reply was modified 2 months, 3 weeks ago by ateicos.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.