calendar_NEW_php

Calendar

[insert_php]

include (‘wp-content/plugins/bh-shlomtzi-update/calendar.php’);

/* определение текущей даты */
$date_now = date(“Y-m-d”);
$how_many_tours = count($calendar_event);

/* составление базы постоянных ивентов */
for ($tr=0; $tr <= $how_many_tours; $tr++){ if ($calendar_event [$tr][Date_iv] == '2017-05-28' or $date_now <= $calendar_event [$tr][Date_iv]) { $array_true [$tr][Date_iv] = $calendar_event [$tr][Date_iv]; $array_true [$tr][Date_desc_e] = $calendar_event [$tr][Date_desc_eng]; $array_true [$tr][Date_desc_r] = $calendar_event [$tr][Date_desc_ru]; $array_true [$tr][Event_desc_eng] = $calendar_event [$tr][Event_desc_eng]; $array_true [$tr][Event_desc_rus] = $calendar_event [$tr][Event_desc_rus]; $array_true [$tr][Event_photo] = $calendar_event [$tr][Event_photo]; $array_true [$tr][Link_iv] = $calendar_event [$tr][Link_iv]; } } /* проверка и добавление актуальных дат $numb_tours = count($array_true); for ($tr=0; $tr <= $how_many_tours; $tr++){ if ($date_now <= $calendar_event [$tr][Date_iv]) { $array_true [$numb_tours][Date_iv] = $calendar_event [$tr][Date_iv]; $array_true [$numb_tours][Date_desc_e] = $calendar_event [$tr][Date_desc_eng]; $array_true [$numb_tours][Date_desc_r] = $calendar_event [$tr][Date_desc_ru]; $array_true [$numb_tours][Event_desc_eng] = $calendar_event [$tr][Event_desc_eng]; $array_true [$numb_tours][Event_desc_rus] = $calendar_event [$tr][Event_desc_rus]; $array_true [$numb_tours][Event_photo] = $calendar_event [$tr][Event_photo]; $array_true [$numb_tours][Link_iv] = $calendar_event [$tr][Link_iv]; $numb_tours = $numb_tours+ 1; } } */ /* сортировка результатов в хронологическом порядке */ $calendar_event_copy = $array_true; // делаем копию массива $sort_cri=array(); // задаем массив критерий и заполняем его foreach($calendar_event_copy as $key=>$arr){
$sort_cri[$key]=$arr[‘Date_iv’];
}
array_multisort($calendar_event_copy, SORT_NUMERIC, $sort_cri); // сама сортировка

/* выведение полученных результатов в соответствии с шаблоном */
$lego_trip_desc = ”;

for ($calcul = 0; $calcul < count($calendar_event_copy); $calcul++){ $temp_Date = $calendar_event_copy [$calcul][Date_iv]; $temp_Date_desc_e = $calendar_event_copy [$calcul][Date_desc_e]; $temp_Date_desc_r = $calendar_event_copy [$calcul][Date_desc_r]; $temp_Event_desc_eng = $calendar_event_copy [$calcul][Event_desc_eng]; $temp_Event_desc_rus = $calendar_event_copy [$calcul][Event_desc_rus]; $temp_Event_photo = $calendar_event_copy [$calcul][Event_photo]; $temp_Link = $calendar_event_copy [$calcul][Link_iv]; $lego_trip_desc .= '


‘ . $temp_Date_desc_e . ‘
‘ . $temp_Event_desc_eng . ‘
Link to Event

‘;
}

echo $lego_trip_desc;

[/insert_php]