/*************************************************************************** * Copyright (C) 2007 by * (R)asian * inutcin@gmail.com * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ if(preg_match("/^\/images\/(.)(.*?)$/", $_SERVER['REQUEST_URI'], $tmp) && !file_exists($_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'])){ header("Location: /images/".$tmp[1]."/".$tmp[1].$tmp[2]); die; } // �������� ����� $t0=microtime(); $tmp=explode(" ",$t0); $t0=$tmp[1]+$tmp[0]; // ���������� ����� ��� ������� REQUEST_URI include_once "libs/http_request.class.php"; // ������ REQUEST_URI, � ���� ���, ���-�� �� ��������, ������ 404 $http_request=new Http_request(); $http_request->uri_parse(); // ���������� ������ ������, � �������� �� ���� ������ � ������� $content // ���� ������ ������ ��� - �������� �� 404 if(!file_exists("modules/".$http_request->module_name.".module.php")) $http_request->error_404(); // ���������� ������ � �������� �� ���� ������ include_once "modules/".$http_request->module_name.".module.php"; $module_class=str_replace("-","_",$http_request->module_name."_module"); $module=new $module_class(); // �������������� ������ if(isset($_POST['land_select'])){ $_SESSION['land_select'] = intval($_POST['land_select']); } ////////////////////////////������///////////////////////////////////////////// include_once "libs/masters.class.php"; if(!isset($_SESSION['alpha_sym']))$_SESSION['alpha_sym'] = '%'; $masters_obj = new masters; if(!isset($_SESSION['land_select']))$_SESSION['land_select'] = 0; $content['land_select'] = $_SESSION['land_select']; $content['land_list'] = $masters_obj->land_list(); if(isset($http_request->path[1]) && $http_request->path[1]!='brand') { $content['alpha_brand'] = $masters_obj->alpha_brand( (isset($_SESSION['alpha_sym'])?$_SESSION['alpha_sym']:'') ); $content['alpha_goods'] = $masters_obj->alpha_goods( (isset($_SESSION['alpha_sym'])?$_SESSION['alpha_sym']:'') ); } if( ( isset($http_request->path[1]) && $http_request->path[1]=='brand' && isset($http_request->path[2]) && intval($http_request->path[2]) ) || ( (isset($content['brand_goods']) && $content['brand_goods']) || isset($http_request->path[1]) && $http_request->path[1]=='brand' && isset($http_request->path[2]) && $http_request->path[2]=='cat' && isset($http_request->path[3]) && ( $http_request->path[3] == 689 || $http_request->path[3] == 693 || $http_request->path[3] == 694 || $http_request->path[3] == 695 || $http_request->path[3] == 696 ) ) ) { $content['brand_goods'] = $masters_obj->brand_goods( $http_request->path[2] ); } if( (isset($content['brand_goods']) && $content['brand_goods']) || isset($http_request->path[1]) && $http_request->path[1]=='brand' && isset($http_request->path[2]) && $http_request->path[2]=='cat' && isset($http_request->path[3]) && intval($http_request->path[3]) ) { $content['brand_land_list'] = $masters_obj->brand_land_list( ( isset($http_request->path[2])&& intval($http_request->path[2])? $http_request->path[2]: 0 ) ); } if( ( isset($http_request->path[1]) && $http_request->path[1]=='brand' && isset($http_request->path[2]) && ( $http_request->path[2] == 1592 || $http_request->path[2] == 1613 ) ) || ( isset($http_request->path[1]) && $http_request->path[1]=='brand' && isset($http_request->path[2]) && $http_request->path[2]=='cat' && isset($http_request->path[3]) && $http_request->path[3] == 690 ) ) { $content['cat_brand'] = $masters_obj->cat_brand( (isset($http_request->path[3])?$http_request->path[3]:690) ); } if( isset($http_request->path[1]) && $http_request->path[1]=='brand' && isset($http_request->path[2]) && intval($http_request->path[2]) ) { $content['brand_goods2'] = $masters_obj->brand_goods2( $http_request->path[2] ); } if(isset($http_request->path[2]) && intval($http_request->path[2]) && !isset($http_request->path[3])) { $content['land_id'] = $masters_obj->cat_line2($http_request->path[2]); } if(isset($http_request->path[3]) && intval($http_request->path[3]) && $http_request->path[2]!='cat') { $content['land_id'] = $masters_obj->cat_line($http_request->path[3]); } if(isset($http_request->path[3]) && intval($http_request->path[3]) && $http_request->path[2]=='cat') { $content['land_id'] = $http_request->path[3]; } ////////////////////////������������ ������/////////////////////////////////// $module->create_content($http_request->path); $tmp=$module->content; $content = array_merge($tmp, $content); if( isset($http_request->path[1]) && $http_request->path[1]=='brand' && isset($http_request->path[2]) && intval($http_request->path[2]) && $masters_obj->is_cosm($http_request->path[2]) ) { $content['is_cosm'] = 1; $content['alpha_brand'] = $masters_obj->alpha_brand( (isset($_SESSION['alpha_sym'])?$_SESSION['alpha_sym']:''), (isset($http_request->path[3])?$http_request->path[3]:''), 1 ); } else{ } unset($masters_obj); // ��������� ��� ������������� ������ $content['module_name'] = $http_request->module_name; $content['http_request'] = $http_request; // �������� ����� $t2=microtime(); $tmp=explode(" ",$t2); $t2=$tmp[1]+$tmp[0]; //���������� �����-������������ include_once "libs/template.class.php"; // ������� ������ ������������� $template=new Template(); // ������������� ����, �������� ������� ������ if ($http_request->module_name!='install') { $template->set_theme($module->auth->userinfo['theme']); }else { $template->set_theme('default'); } //��� ���� ����� �� ������������ ���� �������� � �� ����� ��� ������ �� ��� ����� if($content['module_name']!='install') { include_once "libs/access_to_modules.class.php"; $access_to_modules=new access_to_modules_class(); $modul_privilege = $access_to_modules -> get_privilege_element($content['module_name'], "privilege_access"); if($modul_privilege['value']>=$module->auth->userinfo['privilege_id']) { $http_request->error_404(); } } // //////////////////////////////�������///////////////////////////////////// // ���������� ������ ����������� include_once "libs/news.class.php"; //���������� ������� � ���� include_once "libs/news_setting.class.php"; $news_module=new news_class(); $news_setting_module=new news_setting_class(); $count_news=$news_setting_module -> get_setting_for_name('news', 'count_view_news_for_menu'); $array_menu_news = $news_module -> get_array_news('1',$count_news); $parsing_array_menu_news=array(); if($array_menu_news){ foreach($array_menu_news as $element) { $parsing_array_menu_news[]=array('id' => $element['id'], 'name' => $element['name'], 'text_m' => html_entity_decode($element['text_m'], ENT_QUOTES), 'text' => html_entity_decode($element['text'], ENT_QUOTES), 'date' => $element['date'] ); } $content['array_news_for_menu'] = $parsing_array_menu_news; } //////////////////////������� �� ����////////////////////////////////// include_once "libs/basket.class.php"; $basket_module = new basket_class(); //����� ����� ������� if($basket_module ->isset_basket()) { $basket_menu = $basket_module ->get_content_for_basket_menu(1); $content['count']=$basket_menu['count_all']; $content['summa']=$basket_menu['summa_all']; $content['currency']=$basket_menu['name_currency']; $content['basket']='true_tovar'; } else { $content['basket']='false_tovar'; } // ����� ������� ������������ if(!isset($_SESSION['history']))$_SESSION['history'] = ''; $history_array = explode("::", $_SESSION['history']); if(count($history_array)>10)unset($history_array[0]); if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=$history_array[count($history_array)-1]) $_SESSION['history'] = implode("::", $history_array)."::". $_SERVER['HTTP_REFERER']; // �������� ������������ // ��� ������� ������ � �������� ���� ����� ����������� ������ // ��� ������ ������������� ��������� ������ � ������� � ��� ������ $content['uri_path'] = $http_request->path; $html_code=$template->fetch($content,$http_request->module_name); // ������� ��������� ������������ � ������� echo $html_code; //echo "
";
//print_r($content);
// ������������� ����������

?>