function event_get_event_load in Event 5.2
Same name in this branch
- 5.2 event_database.mysql.inc \event_get_event_load()
- 5.2 event_database.mysqli.inc \event_get_event_load()
- 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.pgsql.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, tz.offset_dst, tz.dst_region, tz.is_dst, e.event_start - CASE WHEN tz.is_dst = 1 THEN tz.offset_dst ELSE tz.offset END AS event_start_utc, e.event_end - CASE WHEN tz.is_dst = 1 THEN tz.offset_dst ELSE tz.offset END AS event_end_utc, e.event_start - CASE WHEN tz.is_dst = 1 THEN tz.offset_dst ELSE tz.offset END + INTERVAL '%d seconds' AS event_start_user, e.event_end - CASE WHEN tz.is_dst = 1 THEN tz.offset_dst ELSE tz.offset END + INTERVAL '%d seconds' AS event_end_user, e.event_start - CASE WHEN tz.is_dst = 1 THEN tz.offset_dst ELSE tz.offset END + INTERVAL '%d seconds' AS event_start_site, e.event_end - CASE WHEN tz.is_dst = 1 THEN tz.offset_dst ELSE tz.offset END + INTERVAL '%d seconds' 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, $node->nid));
}