get_row($sql, OBJECT); $contact = ($data->alt_email == '') ? $org_options['contact_email'] : $data->alt_email . ',' . $org_options['contact_email']; if (empty($data->event_time)) $data->event_time = '09:00'; if (empty($data->end_time)) $data->end_time = '17:00'; $start_date = strtotime($data->start_date . ' ' . $data->event_time); $end_date = strtotime($data->end_date . ' ' . $data->end_time); $sql = "SELECT ec.category_name FROM " . EVENTS_CATEGORY_TABLE . " ec "; $sql .= "JOIN " . EVENTS_CATEGORY_REL_TABLE . " ecr ON ec.id = ecr.cat_id "; $sql .= "WHERE ecr.event_id = '" . $data->event_id . "'"; $cats = $wpdb->get_col($sql); $categories = ''; foreach ($cats as $cat) { $categories .= $cat . ','; } $categories = rtrim($categories, ','); $action = strpbrk($_SERVER['REQUEST_URI'], '?') ? $_SERVER['REQUEST_URI'] . "&iCal=true" : $_SERVER['REQUEST_URI'] . "?iCal=true"; $output = "
"; // commenting out this line to close cb #653 for 3.1.16.P ~c //return $output; } add_filter('filter_hook_espresso_display_add_to_calendar_by_attendee_id', 'espresso_ical_prepare_by_attendee_id'); function espresso_ical_prepare_by_event_id($event_id) { global $org_options, $wpdb; do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, ''); $sql = "SELECT ed.alt_email, ed.start_date, ed.end_date, ed.event_name, ed.event_desc FROM " . EVENTS_DETAIL_TABLE . " ed"; $sql .= " WHERE ed.id = '" . $event_id . "'"; $data = $wpdb->get_row($sql, OBJECT); $contact = ($data->alt_email == '') ? $org_options['contact_email'] : $data->alt_email . ',' . $org_options['contact_email']; $start_date = strtotime($data->start_date . ' 09:00'); $end_date = strtotime($data->end_date . ' 17:00'); $sql = "SELECT ec.category_name FROM " . EVENTS_CATEGORY_TABLE . " ec "; $sql .= "JOIN " . EVENTS_CATEGORY_REL_TABLE . " ecr ON ec.id = ecr.cat_id "; $sql .= "WHERE ecr.event_id = '" . $event_id . "'"; $cats = $wpdb->get_col($sql); $categories = ''; foreach ($cats as $cat) { $categories .= $cat . ','; } $categories = rtrim($categories, ','); $action = strpbrk($_SERVER['REQUEST_URI'], '?') ? $_SERVER['REQUEST_URI'] . "&iCal=true" : $_SERVER['REQUEST_URI'] . "?iCal=true"; $output = ""; // commenting out this line to close cb #653 for 3.1.16.P ~c //return $output; } add_filter('filter_hook_espresso_display_add_to_calendar_by_event_id', 'espresso_ical_prepare_by_event_id');