function get_navigator() { // если каталог!!! if ($_GET['action'] == 'catalog') { return get_navigator_catalog(); } global $zag_radel; global $dbname; $_res = ''; if (isset($_GET['action']) and $_GET['action'] != 'index') { $_res = '<a href="/">Главная</a> '; } if (isset($_GET['action']) and $_GET['action'] == 'news' and isset($_GET['url'])) { if (TYPE_NEWS) { $curr_type = isset($_GET['type']) ? (int) $_GET['type'] : 0; $_res .= ' <a href="/news/type/' . $curr_type . '">' . $_type_news[$curr_type] . '</a> '; } else { $_res .= ' <a href="/news">Новости</a> '; } } if (isset($_GET['action']) and $_GET['action'] == 'gallery') { if (isset($_GET['url'])) { $_res .= ' <a href="/gallery">Галерея</a> '; $_id_gallery_grupa = dbh::get_gallery_grupa_id_parent($_GET['url']); // строим запрос $_sql = 'SELECT * FROM gallery_grupa where id=' . $_id_gallery_grupa . ' and status=1 order by sort'; $result = mysql::query($_sql, 0); if ($result) { // выводим группы товаров $_res .= system::show_tpl(array('result' => $result), 'frontend/gallery/bread.php'); } } } if ($_GET['action'] == 'voting') { if (isset($_GET['arhiv'])) { $_res .= ' <a href="/voting">Голосование</a> '; } } /* * проверяем на разделы * если они есть, то выводим родительский раздел */ // проверяем на наличие подразделов данного раздела $_sql = "select id_parent, name\n\t\t\t\t from content\n\t\t\t\t where action='" . $_GET['action'] . "' and id_parent!=0"; //echo $_sql."<br>"; $result = mysql_db_query($dbname, $_sql); $_res_n = array(); if (mysql_numrows($result) > 0) { // это дочерний раздел, т.е. у него есть родитель, ищем его имя и ссылку $find = mysql_fetch_array($result); //findpole_universal_full($poisk,$table,$name_field,$nomerpole,$whatdoing) $_id_parent_name = findpole_universal_full($find['id_parent'], "content", "id", 1, "return"); $_id_parent_action = findpole_universal_full($find['id_parent'], "content", "id", 2, "return"); //$_res='<a href="'.MAIN_PATH.'/'.$_id_parent_action.'.php">'.$_id_parent_name.'</a> / '.$_res; $_res_n[0] = '<a href="' . MAIN_PATH . '/' . $_id_parent_action . '">' . $_id_parent_name . '</a> '; for ($i = 1; $i < 20; $i++) { // ищем следующий уровень $_sql = "select id_parent, name\n\t\t\t\t\t from content\n\t\t\t\t\t where action='" . $_id_parent_action . "' and id_parent!=0"; //echo $_sql."<br>"; $result = mysql_db_query($dbname, $_sql); if (mysql_numrows($result) > 0) { // это дочерний раздел, т.е. у него есть родитель, ищем его имя и ссылку $find = mysql_fetch_array($result); //findpole_universal_full($poisk,$table,$name_field,$nomerpole,$whatdoing) $_id_parent_name = findpole_universal_full($find['id_parent'], "content", "id", 1, "return"); $_id_parent_action = findpole_universal_full($find['id_parent'], "content", "id", 2, "return"); //$_res='<a href="'.MAIN_PATH.'/'.$_id_parent_action.'.php">'.$_id_parent_name.'</a> / '.$_res; $_res_n[$i] = '<a href="' . MAIN_PATH . '/' . $_id_parent_action . '">' . $_id_parent_name . '</a> '; } else { break; } } } // строим в нужном порядке и выводим $_res_n = array_reverse($_res_n); for ($i = 0; $i < count($_res_n); $i++) { $_res .= $_res_n[$i]; } if (isset($_GET['action']) and $_GET['action'] != 'index') { return $_res . ' ' . get_h1(); } }
<?php die('<p style="font-size:36px;color:black;font-weight:bold;">404!</p>'); if (isset($_GET['title'])) { ?> <center> <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>"; }