You are here

function event_get_event_load in Event 5.2

Same name in this branch
  1. 5.2 event_database.mysql.inc \event_get_event_load()
  2. 5.2 event_database.mysqli.inc \event_get_event_load()
  3. 5.2 event_database.pgsql.inc \event_get_event_load()

Parameters

$nid node ID:

Return value

event object

1 call to event_get_event_load()
event_nodeapi in ./event.module
hook_nodeapi implementation

File

./event_database.mysql.inc, line 8

Code

function event_get_event_load($nid) {
  global $user;
  $shift = variable_get('date_default_timezone', 0);
  return db_fetch_object(db_query('SELECT e.event_start, e.event_end, e.timezone, e.has_time, e.has_end_date, tz.offset AS offset, tz.offset_dst AS offset_dst, tz.dst_region, tz.is_dst, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND AS event_start_utc, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND AS event_end_utc, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL %d SECOND AS event_start_user, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL %d SECOND AS event_end_user, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL %d SECOND AS event_start_site, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL %d SECOND AS event_end_site, tz.name as timezone_name FROM {event} e INNER JOIN {event_timezones} tz ON tz.timezone = e.timezone WHERE nid = %d', isset($user->timezone) ? $user->timezone : 0, isset($user->timezone) ? $user->timezone : 0, $shift, $shift, $nid));
}