<?php
session_start();
include $_SERVER['DOCUMENT_ROOT'] . '/class/mysql.class.php';
include $_SERVER['DOCUMENT_ROOT'] . '/class/template.class.php';
include $_SERVER['DOCUMENT_ROOT'] . '/includes/function.php';
include $_SERVER['DOCUMENT_ROOT'] . '/includes/photo.php';
include $_SERVER['DOCUMENT_ROOT'] . '/includes/config.php';
###создаем уникальный идентифекатор юзверя
$r_pad_class = 'right_pad'; //нужно для скрытия правой колонки
$userkey = md5( rand( 1111111111, 9999999999999999999 ) . get_ip() . rand( 11111111111111111, 9999999999999999999999999999999999 ) );
if ( $_SESSION['ukey'] == '' OR ! $_SESSION['ukey'] ) {
$_SESSION['ukey'] = $userkey;
session_commit();
}
$Timer = new microTimer ();
$Timer->start();
$tpl = new template ();
define( 'ROOT_DIR', dirname( __FILE__ ) );
$tpl->dir = ROOT_DIR . '/templates/default/';
define( 'TEMPLATE_DIR', $tpl->dir );
//echo ROOT_DIR;
#инклудим управляющий файлик
include 'engine/engine.php';
include 'modules/currency_mod.php';
include 'modules/mo_history_view.php';
include 'modules/mod_seo_save.php';
include 'modules/mod_compare.php';
include 'modules/mod_sborka.php';
include 'modules/menu_top.php';
include 'modules/menu.php';
include 'modules/menuleft.php';
include 'modules/spo_list.php';
include 'modules/auth.php';
include 'modules/mod_orders.php';
include 'modules/banner_mod.php';
include 'modules/mod_goodprice.php';
######################смотрим данные сео
$adres = $_SERVER[ REQUEST_URI ];
$seo = $db->super_query( "SELECT * FROM seotext WHERE url LIKE '%" . $adres . "' LIMIT 1" );
if ( $seo[ title ] != '' ) {
$title = $seo[ title ];
}
if ( $seo[ keyword ] != '' ) {
$key = $seo[ keyword ];
}
if ( $seo[ descr ] != '' ) {
$descr = $seo[ descr ];
} else {
$descr = $meta_descr;
}
if ( $seo[ text ] != '' ) {
$seotext = $seo[ text ];
}
//проверяем снег
$sneg = $db->super_query( "SELECT * FROM etc WHERE id = 1" );
//46.35.236.154
//был 46.35.236.154
$tpl->load_template( 'main.tpl' );
//echo $main; exit();
$tpl->set( '{sevcat}', $sevcat );
$tpl->set( '{main}', $main );
$tpl->set( '{menu_top}', $menu_top );
$tpl->set( '{banners}', $banners );
$tpl->set( '{sborka_list}', $sborka_list );
if ( $page_title ) {
$tpl->set( '{page_title}', '<div class="page-title"><h1>' . $page_title . '</h1></div>' );
} else {
$tpl->set( '{page_title}', '' );
}
$tpl->set( '{korzina}', $korzina );
$tpl->set( '{menuleft}', $menuleft ); //левое меню
$tpl->set( '{footer_profile}', $footer_profile ); //ссылки в ногах
$tpl->set( '{menu_left}', $menu_l ); //левое меню
$tpl->set( '{r_good}', $r_good );
$tpl->set( '{mod_compare}', $compare );
if ( $auth_links ) {
$tpl->set( '{auth_links}', $auth_links );
} else {
$tpl->set( '{auth_links}', '' );
}
if ( $_SESSION[ b2b ] == 1 ) {
$tpl->set( '{b2b_link}', '<a href="/btb/" style="margin-left: 100px; font-weight: bold; color: #fea801;">Оптовый портал B2B</a>' );
} else {
$tpl->set( '{b2b_link}', '' );
}
if ( $type_serch == 2 ) {
$tpl->set( '{ts2}', "checked=\"checked\"" );
} else {
$tpl->set( '{ts1}', "checked=\"checked\"" );
}
$tpl->set( '{auth}', $auth );
$tpl->set( '{history_mod}', $list_history );
if ( $related_list ) {
$tpl->set( '{related_list}', $related_list );
} else {
$tpl->set( '{related_list}', $related_list );
}
if ( $spo_list ) {
$tpl->set( '{spo_list}', $spo_list );
} else {
$tpl->set( '{spo_list}', $spo_list );
}
$tpl->set( '{blok_page}', $blok_page );
$tpl->set( '{menuauth}', $menuauth );
if ( $speedbar ) {
$tpl->set( '{speedbar}', '<div class="breadcrumbs"><ul>' . $speedbar . '</ul></div>' );
} else {
$tpl->set( '{speedbar}', '' );
}
$tpl->set( '{redhelp}', $redhelp );
$tpl->set( '{header}', $header );
$tpl->set( '{seotext}', '<div style=" border: 0 none;float: left;margin-top: 20px;width: 870px;text-align:left;">' . $seotext . '</div>' );
$tpl->set( '{title}', $title );
$tpl->set( '{keys}', $key );
$tpl->set( '{descr}', $descr );
$tpl->set( '{r_pad_class}', $r_pad_class );
$tpl->set( '{popular}', $popular );
$tpl->set( '{now_date}', date( "d.m.Y" ) );
$tpl->set( '{geo_block}', $geo_block );
$db->close();
$tpl->set( '{speed}', $test );
$tpl->compile( 'main' );
$tpl->result['main'] = str_replace( '{THEME}', $config['http_home_url'] . 'templates/' . $config['skin'], $tpl->result['main'] );
$db->free();
echo $tpl->result['main'];