core/index.php

49 lines
2.4 KiB
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?php
namespace start;
2022-12-17 18:15:09 +05:00
ini_set('display_errors', 0 );
2022-12-11 13:55:49 +05:00
require_once('api/php/db.php');
require_once('api/php/json.php');
require_once('api/php/core.php');
require_once('api/php/clean.php');
2022-12-17 18:15:09 +05:00
require 'set/' . $_SERVER['SERVER_NAME'] . '.php';
if (file_exists('set/install/install_' . $db['type'] . '.php'))require_once 'set/install/install_' . $db['type'] . '.php';
2022-12-11 13:55:49 +05:00
/* ----------------------------------------------------------------------
09.12.2022
Выбираем модуль по умолчанию
---------------------------------------------------------------------- */
2022-12-17 18:15:09 +05:00
$authModule = \core::getSettings( 'default_mod_auth' );
$mod = ( $authModule ? $authModule : \core::getSettings( 'default_mod' ) );
2022-12-11 13:55:49 +05:00
define('MOD', ( @$_GET['mod'] ? $_GET['mod'] : $mod ) );
2022-12-11 15:29:37 +05:00
/* ----------------------------------------------------------------------
12.12.2022
Подключаем инсталлятор
---------------------------------------------------------------------- */
2022-12-17 18:15:09 +05:00
if ( file_exists ( 'api/modules/' . MOD .'/install_' . \DB::$type . '.php' ) ) require_once 'api/modules/' . MOD .'/install_' . \DB::$type . '.php';
2022-12-11 15:29:37 +05:00
/* ----------------------------------------------------------------------
09.12.2022
Определяем город
---------------------------------------------------------------------- */
if ( !@$_SESSION['city'] ) \core::geo();
2022-12-11 13:55:49 +05:00
require_once 'set/int.php';
/* ----------------------------------------------------------------------
09.12.2022
Авторизация по куки
---------------------------------------------------------------------- */
if ( !@$_SESSION['user_id'] ) \core::loginCookies();
2022-12-24 21:12:23 +05:00
/* ----------------------------------------------------------------------
17.12.2022
Берем данные корзины
---------------------------------------------------------------------- */
$cart=\core::getCart();
$smarty -> assign( 'cart', $cart );
2022-12-11 15:29:37 +05:00
/* ----------------------------------------------------------------------
09.12.2022
Выбираем шаблон модуля
---------------------------------------------------------------------- */
2022-12-17 18:15:09 +05:00
if ( file_exists ( 'skin/' . $_SERVER['SERVER_NAME'] . '/inc/mod/' . MOD . '/index.html' ) )
$smarty -> display( 'skin/' . $_SERVER['SERVER_NAME'] . '/inc/mod/' . MOD . '/index.html', @$_GET['id'] );
2022-12-11 13:55:49 +05:00
else
2022-12-17 18:15:09 +05:00
$smarty -> display( 'api/modules/' . MOD . '/index.html', @$_GET['id'] );
2022-12-11 13:55:49 +05:00
?>