Events Made Easy Forums Generic Checking category events

Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43518
    Anonymous
    Inactive

    Hi,

    I want to check a category to see if there are any future events and then show different blocks of HTML depending on the result. I can get my page template listing live events as I want but how do I show something instead of “No events”?

    Thanks

    #48689
    Franky
    Keymaster

    I think you’re better off using the eme functions directly then, in your case eme_get_events will give you the results needed.

    I’ll add an API function to give the count of number of events for a category:

    eme_count_future_events($category_id)

    eme_count_past_events($category_id)

    #48690
    Anonymous
    Inactive

    Thanks but I don’t want it to say “No events” if there aren’t any, I want the template to show something different without editing the core functions + the theme breaking when any updates to the plugin are released.

    What do I need to check against in an IF ELSE statement to see if events are being returned or not and then echo my message?

    #48691
    Franky
    Keymaster

    eme_get_events returns an array of events matching the criteria (given in arguments to the function), you can check the number of entries returned. That’s why I said what I said in my post above.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top