uboom
Посетитель
- Регистрация
- 10 Июн 2021
- Сообщения
- 32
- Реакции
- 35
Fatal error: Uncaught ArgumentCountError: Too few arguments to function langdate(), 1 passed in W:\domains\ani.uz\engine\modules\static.php on line 187 and at least 2 expected in W:\domains\ani.uz\engine\modules\functions.php:179 Stack trace: #0 W:\domains\ani.uz\engine\modules\static.php(187): langdate('d, D') #1 W:\domains\ani.uz\engine\engine.php(83): include('W:\\domains\\anil...') #2 W:\domains\ani.uz\engine\init.php(991): include_once('W:\\domains\\anil...') #3 W:\domains\ani.uz\index.php(28): require_once('W:\\domains\\anil...') #4 {main} thrown in W:\domains\ani.uz\engine\modules\functions.php on line 179
Код:
if ( $static_result['name'] == "schedule" ) {
$months_list = array( 'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря' );
if ( !$schedule = dle_cache('news_schedule') ) {
$db->query("SELECT id, xfields FROM " . PREFIX . "_post WHERE xfields LIKE '%nextepizod|%' AND approve = 1" . $where_date);
$schedule = array();
$week_start = strtotime('-1 day');
while ($row = $db->get_array()) {
$xfields = xfieldsdataload($row['xfields']);
if ( !isset($xfields['nextepizod']) ) continue;
$xfvalue = explode(" ", str_replace(' ', ' ', str_replace('.', '. ', $xfields['nextepizod'])));
if ( count($xfvalue) != 3 ) continue;
$date = false;
$day = intval(array_shift($xfvalue));
$month = trim(mb_strtolower(array_shift($xfvalue), $config['charset']), '.');
$time = trim(end($xfvalue));
foreach ($months_list as $key => $value) {
if ( stripos($value, $month) === 0 ) {
$date = strtotime(date('Y') . '-' . ($key + 1) . '-' . $day . ' ' . $time . ':00');
break;
}
}
if ( $date && $date >= $week_start ) $schedule[] = array(
'id' => $row['id'],
'date' => $date
);
}
usort($schedule, function($a, $b) {
return $a['date'] > $b['date'];
});
$temp_array = array();
foreach( $schedule as $i => $row ) {
$temp_array[date('Y-m-d', $row['date'])] = true;
if ( count($temp_array) >= 8 ) unset($schedule[$i]);
}
create_cache('news_calendar', json_encode($schedule));
} else $schedule = json_decode($schedule, true);
$id_list = array();
$tabs_list = array();
$this_day = langdate('d, D');
foreach ($schedule as $key => $value) {
$t = langdate('d, D', $value['date']);
$tabs_list[$t == $this_day ? "сегодня" : $t][] = $value['id'];
$id_list[] = $value['id'];
}
foreach ($tabs_list as $key => $value) {
$tabs_list[$key] = '<li' . ($key == "сегодня" ? ' class="active"' : '') . ' data-news="' . implode(",", $value) . '">' . $key . '</li>';
}
$tpl->set('{tabs}', implode("", $tabs_list));
$tpl->set('{items}', custom_print(array('', 'template="schedule_short" cache="yes" limit="99" id="' . implode(",", $id_list) . '" order="id_as_list"')));
}