/** * если в сессии есть сообщения - выводим его */ static function center() { $_str = ''; // проверяем action if (isset($_GET['action']) and $_GET['action'] == "contact") { require HOST . "/ctrl/contact/contact.php"; } else { if (isset($_GET['action']) and file_exists(HOST . "/ctrl/" . $_GET['action'] . "/" . $_GET['action'] . ".php")) { // не пускаей в разделы которые - не активный в данной версии CMS /* $_id=___findpole('select id from menu where target="'.$_GET['action'].'"', 'id'); if (intval($_id)>0) { $__status=___findpole('select status from menu where id="'.$_id.'"', 'status'); if ($__status==0) { die (get_tpl('/tpl/frontend/mainpage/404.tpl.php')); //echo "<meta http-equiv='refresh' content='0;URL=$putt/index.php'>"; //die(); } } */ // универсальное правило для стандартных модулей require HOST . "/ctrl/" . $_GET['action'] . "/" . $_GET['action'] . ".php"; } else { if (@if_content($_GET['action'])) { // проверяем на Content разделы // т.е. выводим админразделы если таковые имеются // добавляем возможность распечатать if (_PRINT == 1) { $_str .= get_tpl("/tpl/mainpage/print.tpl.html"); } /* * вставляем проверку на доступ к разделам, которые заблокированы */ if (!get_access()) { $_str .= '<span class="red">Доступ запрещен!</span>'; } else { $_str .= get_content($_GET['action']); } } else { die(get_tpl('/tpl/frontend/mainpage/404.tpl.php')); } } } return $_str; }
<div class="right_coll"> <h1 class="size24"><?php // ищем в table ACTION сам action и если он есть то выхватываем имя раздела $_res = findpole_universal_full($_GET['title'], "content", "action", 1, "return"); if ($_res != "") { echo $_res; } else { echo "Ошибка!"; } ?> </h1> <div id="content" class="size12"> <?php if (@if_content($_GET['title'])) { // добавляем возможность распечатать //$_str.=get_tpl("/tpl/mainpage/print.tpl.html"); // проверяем на Content разделы // т.е. выводим админразделы если таковые имеются $_str = get_content($_GET['title']); } else { $_str = "<h1>Страница не найдена!</h1>"; } // парсим всю страницу на замену каких-то элементов, которые могу встречаться везде // елементы для замены $mass_element_for_parsing = array("%putt%"); $mass_result_for_parsing = array(MAIN_PATH); // парсим данные $_str = parsing_data($mass_element_for_parsing, $mass_result_for_parsing, $_str); // *******************************************************