WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] filter events returned on EM_Events::output

[Resolved] filter events returned on EM_Events::output

  • Hi,

    I’m trying to modify the template calendar-full.php so it only shows the events that can be booked (that is future events, and also that have tickets left).

    I am using this function

    echo EM_Events::output($cell_events,array('scope'=>'future', 'format'=>"
    <li><a>ID}\">#_24HSTARTTIME</a></li>
    "));

    But scope => future isn’t working. What am I doing wrong? And also, how do I filter only events that have tickets left?

    Also ignore the ‘format’ key if it is irrelevant, I am using it to modify the url, I put the line exactly as it is on the source.

    Thanks.

    http://wordpress.org/plugins/events-manager/

Viewing 10 replies - 1 through 10 (of 10 total)
  • I’ll put again the code, because it got broken on my first post:

    echo EM_Events::output($cell_events,array('scope'=>'future', 'format'=>"<li><a href=\"#_EVENTURL?cid={$post->ID}\">#_24HSTARTTIME</a></li>"));

    Hiya,

    That code should show all future events, but I don’t see anything in there to change whether to show those with bookings available.

    How have you tried to exclude events without tickets available?

    Thanks,
    Phil

    Fixed.

    Please use the CODE button to wrap your code when you post it, otherwise it gets mangled, as you saw 🙂

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    thx Mika! damn you’re fast….

    Hi, with that code, the calendar shows future, present and past events. I don’t know how to filter events that are booked. It is a bit wierd that by default the calendar shows fully booked events. If there isn’t an option to filter that on the output function or on the calendar shortcode, maybe should I filter that events on the full-calendar.php template not inserting them on $cell_events array?

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    there isn’t a filter for this, you’d need to loop through results and check if something is fully booked or not, it can’t be done in a db query.

    Ok, thanks, but what about showing only events in the future? It is not that important because the calendar shows the current day in other color, but should the above code work?, because it doesn’t for me.

    angelo_nwl

    @angelo_nwl

    NetWebLogic Support

    hi,

    try to use conditional placeholder at Events > Formatting > Calendar > Event format

    e.g.

    {is_future}<li>#_EVENTLINK</li>{/is_future} {is_past}<li><a href="#_EVENTURL">#_EVENTNAME</a> </>{/is_past}

    I think I can’t use the wp-admin options to change the event format, because I need to modify the event link as shown in:

    <a href=\"#_EVENTURL?cid={$post->ID}\">

    I am passing a GET parameter cid (where did the user come from), because I am using this info on the booking page. And I don’t have that parameter on the wordpress admin page.

    As Marcus said, you’re probably going to have to get these results for use with PHP and loop through them rather than trying to use the normal formats settings.

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] filter events returned on EM_Events::output’ is closed to new replies.
Skip to toolbar