Exemplo n.º 1
0
$GLOBALS['smarty']->assign('prj_ref', $PRJ_REF);
$GLOBALS['smarty']->assign('lib_dir', $LIB_DIR);
$GLOBALS['smarty']->assign('lib_ref', $LIB_REF);
$GLOBALS['smarty']->assign('theme_dir', $THEME_DIR);
$GLOBALS['smarty']->assign('theme_ref', $THEME_REF);
inc_lib('AdminInterface/AdminProtect.php');
inc_lib('db/DBTable.php');
inc_lib('db/DBRTTI.php');
if ($_SERVER['SCRIPT_NAME'] != '/restore.php') {
    if (file_exists($PRJ_DIR . '/restore.php')) {
        CUtils::raiseError('Удалите файл restore.php в корне сайта', ERROR_DIE);
    }
    // Включаем парсер URL
    inc_lib('CParser.php');
    $parser = new CParser();
    $GLOBALS['urlprops'] = $parser->getURLProps();
    // Инициализация текущего языка
    if (!isset($_SESSION['lang'])) {
        $_SESSION['lang'] = CUtils::_postVar('lang', false, 'ru');
    }
    if (CUtils::_postVar('lang') && $_SESSION['lang'] != CUtils::_postVar('lang')) {
        $_SESSION['lang'] = CUtils::_postVar('lang');
        header('location: ' . $GLOBALS['urlprops']['uri'] . ($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : ''));
    }
    $GLOBALS['smarty']->assign('slang', $GLOBALS['urlprops']['lang']);
    $GLOBALS['smarty']->assign('urlprops', $GLOBALS['urlprops']);
    if (!stristr($_SERVER['REQUEST_URI'], '/admin')) {
        /*if ((isset($GLOBALS['urlprops']['node'])) && $GLOBALS['urlprops']['node']['id'] == 82 && $GLOBALS['urlprops']['method'] == 'index') {
        			$cat = $GLOBALS['db']->getItem('get_cat',"SELECT id,filters FROM catalog_categories WHERE id=".$GLOBALS['urlprops']['params'][0]);
        			$filters = $GLOBALS['db']->getItems('get_filters', "SELECT id FROM catalog_features WHERE id IN(".$cat['filters'].")");
        			$filters_values = array();