0) {
$timesx = $wpdb->get_results("SELECT * FROM " . EVENTS_DETAIL_TABLE . " WHERE id = '" . $event_id . "'");
foreach ($timesx as $timex) {
echo '
';
}
} else {
?>
get_results("SELECT * FROM " . EVENTS_START_END_TABLE . " WHERE event_id = '" . $event_id . "' ORDER BY id");
if ($wpdb->num_rows > 0) {
foreach ($times as $time) {
echo '
' . ($org_options['time_reg_limit'] == 'Y' ? '
' : '') . '
';
}
} else {
?>
' : '') ?>
' . __('Manage Categories', 'event_espresso') . '';
$sql = "SELECT * FROM " . EVENTS_CATEGORY_TABLE;
if (function_exists('espresso_member_data')) {
global $espresso_manager;
if (isset($espresso_manager['event_manager_share_cats']) && $espresso_manager['event_manager_share_cats'] == 'N') {
$results = $wpdb->get_results("SELECT wp_user FROM " . EVENTS_DETAIL_TABLE . " WHERE id = '" . $event_id . "'");
$wp_user = ( $results && $wpdb->last_result[0]->wp_user != '' ) ? $wpdb->last_result[0]->wp_user : espresso_member_data('id');
$sql .= " WHERE ";
if ($wp_user == 0 || $wp_user == 1) {
$sql .= " (wp_user = '0' OR wp_user = '1') ";
} else {
$sql .= " wp_user = '" . $wp_user . "' ";
}
}
}
$sql .= " ORDER BY category_name ";
$event_categories = $wpdb->get_results($sql);
$num_rows = $wpdb->num_rows;
if ($num_rows > 0) {
$html = '';
foreach ($event_categories as $category) {
$category_id = $category->id;
$category_name = $category->category_name;
$in_event_categories = $wpdb->get_results("SELECT * FROM " . EVENTS_CATEGORY_REL_TABLE . " WHERE event_id='" . $event_id . "' AND cat_id='" . $category_id . "'");
foreach ($in_event_categories as $in_category) {
$in_event_category = $in_category->cat_id;
}
if(empty($in_event_category)) $in_event_category = '';
$html .= '";
}
$top_div = '';
$bottom_div = '';
if ($num_rows > 10) {
$top_div = '
';
$bottom_div = '
';
}
$html = $top_div . $html . $bottom_div . $manage;
return $html;
} else {
_e('No Categories', 'event_espresso');
echo $manage;
}
}
//This function grabs the event categories and outputs a dropdown.
//@param optional $event_id = pass the event id to get the categories assigned to the event.
//@param optional $is_fes = Used for the front-end event submission tool. It hides the "Manage Categories" if true.
function event_espresso_categories_dd($event_id = 0, $is_fes = false) {
global $wpdb;
//Don't show manage link if using front-end event submission
if ( $is_fes == false )
$manage = '