You are here

function event_get_events in Event 5.2

Get events between two specified dates

MySQL and Postgres handle time intervals incompatibly. The changes that need to happen from MySQL -> Postgres are: INTERVAL %d SECOND -> '%d seconds' INTERVAL foo SECOND -> foo INTERVAL foo HOUR_SECOND -> foo %d SECOND -> '%d seconds' INTERVAL foo -> foo offset -> "offset" See also the table definitions in event.install to understand the differences between the two.

Parameters

$first start date of interval as a date string:

$last end date of interval as a date string:

Whether to order the result set on the starting date.: Valid values: FALSE, 'DESC', 'ASC'

$rewrite_parameter optional array that will be passed on to queries: in event_database.*.inc files and merged into the fourth argument of db_rewrite_sql.

Return value

a database resource

Related topics

3 calls to event_get_events()
event_calendar_data in ./event.module
Returns an array of nodes that occur on a given date. Handles content type and taxonomy filters.
event_calendar_ical in ./event.module
Creates an ical feed of events.
event_calendar_rss in ./event.module
Creates an rss feed of events.

File

./event.module, line 1149

Code

function event_get_events($first, $last, $order = 'ASC', $rewrite_parameter = array()) {
  event_include_files();
  switch (variable_get('event_timezone_display', 'event')) {
    case 'user':
      $result = event_get_events_user($first, $last, $order, $rewrite_parameter);
      break;
    case 'site':
      $result = event_get_events_site($first, $last, $order, $rewrite_parameter);
      break;
    case 'event':
      $result = event_get_events_event($first, $last, $order, $rewrite_parameter);
  }
  return $result;
}