All-in-One Event Calendar
Get filtered upcoming events through PHP (1 post)

  1. mawmawmaw
    Posted 3 years ago #

    Hi all,

    I would like to display the next event out of two categories. I browsed several forums and had a look into the helper functions, but somehow not everything seems to work.

    Here is my approach.

    global $ai1ec_calendar_helper, $ai1ec_events_helper;
       // gets localized time
        $bits = $ai1ec_events_helper->gmgetdate( $ai1ec_events_helper->gmt_to_local( time() ) );
        //sets start time to today
        $start = gmmktime(0,0,0,$bits['mon'],$bits['mday'],$bits['year']);
        // here: filtering of categorie / categories; seems not to work
        $filter["cat_ids"] = "4";
        // Get the next (here two) posts out of the DB
        $get_events = $ai1ec_calendar_helper->get_events_relative_to($start, 1, 0, $filter);

    This is my approach so far; the events are getting outputted but not filtered; all events are outputted. Regardless what I try to filter, it doesn't work. Can somebody help me with this? Thanks a lot.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • All-in-One Event Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic