$query"; $result = db_query($query); $strmenu = ""; while ($array = mysql_fetch_row($result)) { $url = ''; if ($array[0] != $main_header) $url = $array[0]; // неразрывный пробел if (read_param('use_nbsp', 0)) $array[1] = preg_replace('/\s/Uis', ' ', trim($array[1])); else $array[1] = trim($array[1]); $cc = ""; if ($array[0] == $header) $cc = "class='curr'"; $strmenu .= "{$array[1]}$separator"; } // убираем последний разделитель if ($separator != "") $strmenu = substr($strmenu, 0, -(strlen($separator))); if ( read_param('use_cache', 0) == '1' ) file_put_contents($cache_menu, $strmenu); return $strmenu; } function get_roll($id) { $query = "SELECT id, content_small, title, header FROM ".prefix."page WHERE root=".$id." and invisible = 0 ORDER BY sort_order, title"; $result = mysql_query($query); $text = ''; if ($result && mysql_num_rows($result)) { if(mysql_num_rows($result)>2) $text.=''; $text .='
'; if(mysql_num_rows($result)>2) $text .=''; } return $text; } function get_menu_ul_tree_my($next_root, $my_page, $where){ // вывод дерева меню от корня $id global $root, $main_header, $header, $level, $id; $top = ""; if ($where) $top = " AND topmenu = 1"; $query = // первый уровень "SELECT p.header, p.menu, p.id, p.root FROM ".prefix."page p WHERE (p.root = $next_root) and (p.invisible = 0)".$top." ORDER BY p.sort_order, p.id"; $result = mysql_query($query); $strmenu = ""; $i=0; while ($array = mysql_fetch_row($result)) { $submenu = ''; $act = ''; $li_act = ''; //$display = " style='display: none'"; $display = ""; if ($array[0]==$header) { $act = 'class="active"'; $li_act = 'class="li_active"'; $display = ""; } if (!$i) { $i = 1; if ($next_root==-1) $strmenu .='