Query(" SELECT * FROM " . PREFIX . "_module_unicalendar WHERE id = '" . $id . "' "); $unicalendars = array(); while ($row = $sql->FetchAssocArray()) { array_push($unicalendars, $row); } foreach ( $unicalendars as $k=>$v ) { $uevents = $v['uca_events']; $urubric_id = $v['uca_rubric_id']; $udoc_id = $v['uca_doc_id']; } // Если выбрали вывести все документы из заданной рубрики - документы с Id=1 (Главная) и 404 страница - выводиться не будут! if ($uevents !='' && $uevents == '1'){ $sql = $AVE_DB->Query(" SELECT Id, document_alias, document_title, document_published, document_meta_description FROM " . PREFIX . "_documents WHERE rubric_id = '" . $urubric_id . "' AND Id !=1 && Id != '".PAGE_NOT_FOUND_ID."' "); $results = array(); while ($row = $sql->FetchAssocArray()) { array_push($results, $row); } } // Если выбрали вывести выбранные документы из заданной рубрики if ($uevents !='' && $uevents == '2'){ $sql = $AVE_DB->Query(" SELECT Id, document_alias, document_title, document_published, document_meta_description FROM " . PREFIX . "_documents WHERE rubric_id = '" . $urubric_id . "' AND Id !=1 && Id != '".PAGE_NOT_FOUND_ID."' AND $udoc_id "); $results = array(); while ($row = $sql->FetchAssocArray()) { array_push($results, $row); } } $AVE_Template->assign('unicalendars', $unicalendars); $AVE_Template->assign('results', $results); $AVE_Template->display($tpl_dir . 'unicalendar.tpl'); } /** * ФУНКЦИИ АДМИНИСТРАТИВНОЙ ЧАСТИ */ /** * Вывод списка календарей * * @param string $tpl_dir - путь к папке с шаблонами модуля */ function unicalendarList($tpl_dir) { global $AVE_DB, $AVE_Template; $unicalendars = array(); $limit = 20; $start = get_current_page() * $limit - $limit; $sql = $AVE_DB->Query(" SELECT SQL_CALC_FOUND_ROWS u.*, COUNT(u.id) AS uca_count FROM " . PREFIX . "_module_unicalendar AS u GROUP BY u.id ORDER BY u.id ASC LIMIT " . $start . "," . $limit . " "); $sql_num = $AVE_DB->Query("SELECT FOUND_ROWS()"); $num = $sql_num->GetCell(); while($row = $sql->FetchAssocArray()) { array_push($unicalendars, $row); } if ($num > $limit) { $page_nav = "