page_id = ( isSet($_GET['structure_id']) ) ? intVal($_GET['structure_id']) : 0; $site->section = ( isSet($_GET['module_name']) ) ? $_GET['module_name'] : false; if( $site->page_id && $site->section ) $site->page_id = 0; if( !$site->page_id && !$site->section ) $site->section = 'homepage'; if( !$site->page_id && $site->section && isSet($_CONFIG['section'][$site->section]) ) $site->page_id = $_CONFIG['section'][$site->section]; if( !$site->section && $site->page_id ) $site->section = $site->page_id; $module = false; $module_name = ($site->page_id) ? $site->page_id : ( ($site->section) ? $site->section : false ); if( $module_name ) { $cache->setPath('module'); $cache->read( 'module_'.$module_name.'.php' ); $module = $cache->restore(); if( $cache->expired() || !$module ) { $module = $config->getModule($module_name,$site->lang()); if( $module && (!$module['is_multiple'] || $module['node_type']=='page') ) { $cache->save( $module, 30*24 ); } } } if( empty($module) ) { if( ONLINE ) { header("HTTP/1.0 404 Not Found"); $module = $config->getModule(1992); } } elseif( $module && $site->hasLang($module['lang']) ) { $config->initModule($module['node_type']); $site->setLang($module['lang']); if( isset($_CONFIG['sections'][$site->lang()]) ) { $_CONFIG['section'] = $_CONFIG['sections'][$site->lang()]; } $cache->setBaseDir( ROOT_DIR.CACHE_DIR ); } $GLOBALS['vars']['structure_id'] = $module['stc_id']; $GLOBALS['vars']['stc_left'] = $module['stc_left']; $GLOBALS['vars']['stc_right'] = $module['stc_right']; $GLOBALS['vars']['stc_level'] = $module['stc_level']; $GLOBALS['vars']['access_id'] = $module['access_id']; $xsl_template = $module['templates_dir'].$module['node_type'].'.xsl'; $xsl_module = $module['node_type']; $site->attributes( $site->root('site'), array( 'xsl_module'=>$xsl_module, 'xsl_template'=>$xsl_template ) ); $host = ONLINE ? 'crew.kz' : strTr($_SERVER['HTTP_HOST'],array('www.'=>'')); $lang_manager = new LangManager(); $lang_manager->prepareSiteLang( false ); require_once MODULES_DIR.'_crew/locations/locations.php'; require_once MODULES_DIR.'access/login.php'; require_once MODULES_DIR.'content/content.php'; #require_once MODULES_DIR."extcont/extcont.php'; require_once MODULES_DIR.'_crew/time/time.php'; require_once MODULES_DIR.'usermenu/usermenu.php'; require_once MODULES_DIR.'banner/banner.rotation.php'; if( !$access->isAdmin() && in_array($module['node_type'],array('companyvacancies')) ) { #exit('Server Error'); } if( $module && !empty($module['file_name']) ) { $config->getOptions($module['node_type'], $_CONFIG); $config->define($_CONFIG['const']); require_once MODULES_DIR . $module['file_name']; } require_once MODULES_DIR.'rss/rss.php'; require_once MODULES_DIR.'path/path.php'; require_once MODULES_DIR.'_crew/topmenu_bar/topmenu_bar.php'; #require_once MODULES_DIR.'weather/weather.php'; #require_once MODULES_DIR.'currency/currency.php'; #require_once MODULES_DIR.'language/lang_vars.php'; #require_once MODULES_DIR.'link_exchange/link_exchange.php'; #require_once MODULES_DIR.'region/region.php'; #require_once 'inc/editor/editor.php'; if( $chat = $social->getChat() ) { $site->child( 'Chat', false, $chat ); } $client = new Client( array( 'save_start' => true ) ); $db->close(); $site->child('Host',false,$host); $site->child('SiteUrl',false,SITE_URL); $site->child('RequestUrl',false,'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); if( ONLINE ) { #$site->child('Online',false,1); $yandex_direct = false; $yandex_search = false; $support_banner = false; switch( $_SERVER['HTTP_HOST'] ) { /*case 'www.akmola.kz': { $yandex_direct = 116621; $yandex_search = 1770247; break; } case 'www.valmont.kz': { $yandex_direct = 116625; $yandex_search = 1770247; break; } case 'www.valley.kz': { $yandex_direct = 116624; $yandex_search = 1770247; break; } case 'aibolit.region.kz': { $yandex_direct = 116237; $yandex_search = 1770247; break; } case 'ala.crewative.ru': { $yandex_direct = 116238; $yandex_search = 1770247; break; } case 'www.crewative.net': { $yandex_direct = 116222; $yandex_search = 1770247; break; } case 'www.crewative.com': { $yandex_direct = 116228; $yandex_search = 1770247; break; } case 'ns1.dg.kz': { $yandex_direct = 116824; $yandex_search = 1770247; break; } case 'www.kalamkas.kz': { $yandex_direct = 117030; $yandex_search = 1770247; break; } case 'www.sorabotniki.com': { $yandex_direct = 118932; $yandex_search = 1770247; break; } case 'www.sorabotniki.kz': { $yandex_direct = 118937; $yandex_search = 1770247; break; } case 'www.okey.kz': { $yandex_direct = 118938; $yandex_search = 1770247; break; } case 'www.kazakhtar.kz': case 'kazakhtar.kz': { $yandex_direct = 117137; $yandex_search = 1770247; break; } case 'xn--j1am6b.xn--p1ai': case 'www.xn--j1am6b.xn--p1ai': { $yandex_direct = 93439; $yandex_search = 1770247; break; } case 'social.el.kz': { $site->child('Iframe',false,1); break; }*/ default: { $yandex_direct = 83734; $yandex_search = 1770247; break; } } if( $yandex_direct && ($xsl_module != 'search') ) { $site->child('YandexDirect',false,$yandex_direct); } if( $yandex_search ) { $site->child('YandexSearch',false,$yandex_search); } if( $support_banner ) { $site->child('SupportBanner',false,$support_banner); } } $site->child('SuggestRegionType',false,@$_SESSION['suggest']['region_type']); kSort($GLOBALS['modules']); foreach( $GLOBALS['modules'] as $name => $node ) { $tmp = $node->getElementsByTagName($name); foreach($tmp as $row) { $site->root()->appendChild( $site->xml()->importNode($row->cloneNode(true),true) ); } } $lang_manager->setSiteXML(); # сохраняем lang_vars в XML-древо сайта if( $user->isAdmin() ) { $site->attributes($site->root('site'),array('XML_Generated_Time'=>$main_timer->end_and_display(false,false,5,false))); $main_timer->start(); } if( ( !ONLINE || $user->isAdmin() || debug() ) && isset( $_GET['xml']) ) { exit( $site->getHTML( 'xv', 'admin' ) ); } if( $print = isSet($_GET['print']) ) { $site->mainTemplate( TEMPLATES_DIR.'basic/print.xsl' ); $file = TEMPLATES_DIR.( $xsl_template = 'print/'.baseName($xsl_template) ); if( !file_exists($file) ) { exit('NO_PRINT_VERSION'); } $site->addTemplate( '../'.$xsl_template ); } else { $site->mainTemplate( TEMPLATES_DIR.'basic/index_main.xsl' ); $file = TEMPLATES_DIR.( !empty($module['templates_dir']) ? str_replace( '../', '', $xsl_template ) : 'basic/'.$xsl_template ); if( file_exists($file) ) { $site->addTemplate( $xsl_template ); } } /* if( $rtb_display ) { $site->child('RTB_Display',false,1); } if( $append_style = @file_get_contents('http://css.'.$host.'/'.( ONLINE ? '' : 'css/' ).'append_style.php') ) { $site->child('CSS_Append',false,$append_style); } */ $site->printHTML(); if( !$print && $user->isAdmin() ) { echo ''; } ?>