AND post_status = 'publish'";
//$sql .= " AND ID IN ( SELECT post_id FROM " . $this->wpdb->prefix . "ai1ec_events
//WHERE end >= " . time() . " )";
+ //$sql .= " AND ID IN ( 2469, 1640 )";
$sql .= " LIMIT $limit OFFSET $start";
$results = $this->wpdb->get_results( $sql, ARRAY_A );
if ( !empty( $results ) ) {
foreach ( $results as $post ) {
+ // Initialize some variables
+ $serialized_custom_times = null;
if ( $debug ) {
echo '<div style="border:1px solid green;">';
}
}
// Insert the event data
$event_import_data = array(
- 'status' => $this->config['status_numb']['Active'],
- 'created' => $post['post_date'],
- 'updated' => $post['post_modified'],
- 'approved' => $post['post_modified'],
- 'name' => $post['post_title'],
- 'name_slug' => $post['post_name'],
- 'intro' => mb_substr( strip_tags( $post['post_content'] ), 0, 80 ),
- 'descr' => $post['post_content'],
- 'image' => $image,
- 'file1' => null,
- 'file1_descr' => null,
- 'cost' => $cost,
- 'free' => $is_free,
- 'url' => $event_data['contact_url'],
- 'old_event_id' => $post['ID'],
-// 'ref_type' => null,
- 'ref_type' => 10,
- 'ref_dest' => null,
- 'admin_name' => $event_data['contact_name'],
- 'admin_org' => null,
- 'admin_email' => $event_data['contact_email'],
- 'admin_phone' => $event_data['contact_phone'],
- 'contact_email' => $event_data['contact_email'],
- 'contact_name' => $event_data['contact_name'],
- 'contact_phone' => $event_data['contact_phone'],
- 'notes' => null,
- 'hide_address' => null,
- 'use_member_location' => 0,
+ 'status' => $this->config['status_numb']['Active'],
+ 'created' => $post['post_date'],
+ 'updated' => $post['post_modified'],
+ 'approved' => $post['post_modified'],
+ 'name' => $post['post_title'],
+ 'name_slug' => $post['post_name'],
+ 'intro' => mb_substr( strip_tags( $post['post_content'] ), 0, 80 ),
+ 'descr' => $post['post_content'],
+ 'image' => $image,
+ 'file1' => null,
+ 'file1_descr' => null,
+ 'cost' => $cost,
+ 'free' => $is_free,
+ 'url' => $event_data['contact_url'],
+ 'old_event_id' => $post['ID'],
+// 'ref_type' => null,
+ 'ref_type' => 10,
+ 'ref_dest' => null,
+ 'admin_name' => $event_data['contact_name'],
+ 'admin_org' => null,
+ 'admin_email' => $event_data['contact_email'],
+ 'admin_phone' => $event_data['contact_phone'],
+ 'contact_email' => $event_data['contact_email'],
+ 'contact_name' => $event_data['contact_name'],
+ 'contact_phone' => $event_data['contact_phone'],
+ 'notes' => null,
+ 'hide_address' => null,
+ 'use_member_location' => 0,
);
$event_data_format = array(
'%d',
break;
case "YEARLY":
+ $month_ints = $ints = $month_num = null;
if ( $recurrence_rules[1] ) {
+ $ints = 0;
+ $day_of_month = 0;
$yearly_events++;
$selected_from_date = substr($from_date, -2);
$selected_from_date--;
$by_day_of_month = 1;
}
}
+ $ending_datetime = new DateTime( $to_date );
+ $ending_date = $ending_datetime->modify('2 years');
+ $to_date = $ending_date->format( 'Y-m-d' );
break;
case "MONTHLY":
$monthly_events++;