function siw_update_community_day_options() { //haal cd-datums op for ($x = 1; $x <= 9; $x++) { $community_days[] = get_option("siw_community_day_{$x}"); } asort($community_days); $hide_form_days_before_cd = siw_get_hide_form_days_before_cd(); $limit_date = date("Y-m-d", strtotime(date("Y-m-d") . "+" . $hide_form_days_before_cd . " days")); foreach ($community_days as $community_day => $community_day_date) { if ($community_day_date >= $limit_date) { $future_community_days[]['label'] = siw_get_date_in_text($community_day_date, false); } } //zoek cd-formuliervraag $field_id = siw_get_vfb_field_id('community_day_datums'); global $wpdb; if (!isset($wpdb->vfbp_fields)) { $wpdb->vfbp_fields = $wpdb->prefix . 'vfbp_fields'; } $query = "SELECT {$wpdb->vfbp_fields}.data\n\t\t\t\tFROM {$wpdb->vfbp_fields}\n\t\t\t\tWHERE {$wpdb->vfbp_fields}.id = %d"; $data = $wpdb->get_var($wpdb->prepare($query, $field_id)); $data = maybe_unserialize($data); //update formuliervraag $data['options'] = $future_community_days; $query = "update {$wpdb->vfbp_fields} set {$wpdb->vfbp_fields}.data = %s where {$wpdb->vfbp_fields}.id = %d;"; $wpdb->query($wpdb->prepare($query, maybe_serialize($data), $field_id)); }
$date_range = siw_get_date_range_in_text(date("Y-m-d", $start_ts), date("Y-m-d", $end_ts), false); $start_time = date("H:i", $start_ts); $end_time = date("H:i", $end_ts); $program = get_post_meta($id, 'siw_agenda_programma', true); $description = get_post_meta($id, 'siw_agenda_beschrijving', true); $location = get_post_meta($id, 'siw_agenda_locatie', true); $address = get_post_meta($id, 'siw_agenda_adres', true); $postal_code = get_post_meta($id, 'siw_agenda_postcode', true); $city = get_post_meta($id, 'siw_agenda_plaats', true); $vfb_form_id = siw_get_vfb_form_id('community_day'); $application = get_post_meta($id, 'siw_agenda_aanmelden', true); $application_explanation = get_post_meta($id, 'siw_agenda_aanmelden_toelichting', true); $application_link_url = get_post_meta($id, 'siw_agenda_aanmelden_link_url', true); $application_link_text = get_post_meta($id, 'siw_agenda_aanmelden_link_tekst', true); $location_map = '[gmap address="' . $address . ', ' . $postal_code . ' ' . $city . '" title="' . $location . '" zoom="15" maptype="ROADMAP"]'; $hide_form_days_before_cd = siw_get_hide_form_days_before_cd(); $limit_date = date("Y-m-d", strtotime(date("Y-m-d") . "+" . $hide_form_days_before_cd . " days")); $text_after_hide_cd_form = siw_get_text_after_hide_cd_form(); $agenda_page_url = get_permalink(siw_get_parent_page('agenda')); ?> <div id="content" class="container"> <div class="row single-article"> <div class="main col-md-12 kt-nosidebar" role="main"> <?php while (have_posts()) { the_post(); ?> <article <?php post_class(); ?>