Events - February 2018
".date("F", mktime(0, 0, 0, $month_num_prev, 10))."
"; ?>
".date("F", mktime(0, 0, 0, $month_num_next, 10))."
"; ?>

get_results("SELECT * FROM wp_my_calendar WHERE (event_begin > '".$begin."' AND event_begin < '".$end."') OR (event_end > '".$begin."' AND event_end < '".$end."') OR ((event_recur = 'M1' or event_recur = 'Y1' or event_recur = 'U1') AND event_begin < '".$end."') ORDER BY DAY(event_begin)"); $event_check = 0; for ($e = 0; $e < count($mycal); $e++) { if ($mycal[$e]->event_recur == "U1" && $mycal[$e]->event_repeats != 0) { $event_begin_u1 = $mycal[$e]->event_begin; $event_end_u1 = date("Y-m-d", strtotime($mycal[$e]->event_begin.' + '.$mycal[$e]->event_repeats.' months')); $page_date = $year."-".$month_num."-00"; //echo $page_date." - ".$event_end_u1; if ($page_date < $event_end_u1) { $proceed = "yes"; } else { $proceed = "no"; } } else { $proceed = "yes"; } if(((($mycal[$e]->event_recur == "Y1" && date("m", strtotime($mycal[$e]->event_begin)) == $month_num) || $mycal[$e]->event_recur != "Y1")) && $proceed == "yes") { echo "
"; if (!empty($mycal[$e]->event_image)) { echo "event_image."\">
"; } echo "".$mycal[$e]->event_title.""; echo "
"; if ($mycal[$e]->event_time != "00:00:00") { echo date("g:iA ", strtotime($mycal[$e]->event_time)); if ($mycal[$e]->event_endtime != "00:00:00") { echo " - ".date("g:iA ", strtotime($mycal[$e]->event_endtime)); } echo "
"; } //if ($mycal[$e]->event_begin == $mycal[$e]->event_end) //{ if ($mycal[$e]->event_recur == "U1") { $d = date_parse_from_format("Y-m-d", $mycal[$e]->event_begin); $week_num = floor(($d["day"] + date("w",mktime(0,0,0,$d["month"],1,$d["year"])))/7); //echo $week_num; $patterns = array(); $patterns[0] = '/1/'; $patterns[1] = '/2/'; $patterns[2] = '/3/'; $patterns[3] = '/4/'; $patterns[4] = '/5/'; $replacements = array(); $replacements[0] = 'first'; $replacements[1] = 'second'; $replacements[2] = 'third'; $replacements[3] = 'fourth'; $replacements[4] = 'fifth'; $week_word = preg_replace($patterns, $replacements, $week_num); //echo $week_word; $day_of_week = date("l", strToTime($mycal[$e]->event_begin)); //echo ''.$week_word.' '.$day_of_week.' of '.$month.''; $start_date = date('Y-m-d', strToTime(''.$week_word.' '.$day_of_week.' of '.$month.''.$year.'')); } else { if ($mycal[$e]->event_recur == "S1" || $mycal[$e]->event_recur == "S") { $start_date = $mycal[$e]->event_begin; } else { $d = date_parse_from_format("Y-m-d", $mycal[$e]->event_begin); $start_date = $year."-".$month_num."-".$d["day"]; } } echo "".date("D, F jS, Y", strtotime($start_date)); if ($mycal[$e]->event_begin != $mycal[$e]->event_end) { $datetime1 = date_create($mycal[$e]->event_begin); $datetime2 = date_create($mycal[$e]->event_end); $interval = date_diff($datetime1, $datetime2); $date_diff = $interval->format('%a'); $end_date = date('Y-m-d', strToTime($start_date.' + '.$date_diff.' days')); echo " - ".date("D, F jS, Y", strtotime($end_date)); } if ($mycal[$e]->event_recur == "D1") { $end_date = $year."-".$month_num."-".($d["day"] + $mycal[$e]->event_repeats); echo " - ".date("D, F jS, Y", strtotime($end_date)); } if ($mycal[$e]->event_recur == "E1") { $day_add = 1; for($ere1 = 1; $ere1 < $mycal[$e]->event_repeats; $ere1++) { $cont_date = $year."-".$month_num."-".($d["day"] + $day_add); if (date("w", strtotime($cont_date)) != 0 && date("w", strtotime($cont_date)) != 6) { echo "
".date("D, F jS, Y", strtotime($cont_date)); $day_add++; } else { --$ere1; $day_add++; } } } if ($mycal[$e]->event_recur == "W1") { $week_add = 7; for($erw1 = 1; $erw1 < $mycal[$e]->event_repeats; $erw1++) { $cont_date = $year."-".$month_num."-".($d["day"] + $week_add); echo "
".date("D, F jS, Y", strtotime($cont_date)); $week_add += 7; } } //} //else //{ // echo "".date("D, F jS ", strtotime($mycal[$e]->event_begin))." - ".date("D, F jS, Y", strtotime($mycal[$e]->event_end)); //} if (!empty($mycal[$e]->event_label)) { echo "
".$mycal[$e]->event_label; } if (!empty($mycal[$e]->event_street)) { echo "
".$mycal[$e]->event_street.", ".$mycal[$e]->event_city.", ".$mycal[$e]->event_state; } if (!empty($mycal[$e]->event_desc)) { echo "
".$mycal[$e]->event_desc; } if (!empty($mycal[$e]->event_link)) { echo "
event_link."\" target=\"new\">".$mycal[$e]->event_link.""; } echo "
"; echo "
"; $event_check++; } } if ($event_check == 0) { echo "
No events scheduled.
"; } ?>