示例#1
0
文件: core.php 项目: SjayLiFe/CTRev
    die('Remote access denied!');
}
require_once ROOT . 'include/system/allowed.php';
require_once ROOT . 'include/system/globals.php';
require_once ROOT . 'include/system/autoload.php';
require_once ROOT . 'include/functions.php';
globals::s('start', timer());
// Start time
require_once ROOT . 'include/smarty/Smarty.class.php';
require_once ROOT . 'include/functions_smarty.php';
@set_error_handler("myerror_report");
// Присваиваем функцию myerror_report, вместо стандартной, помогает избежать раскрытия путей.
db::o()->connect();
init_baseurl();
lang::o()->change_folder(config::o()->v('default_lang'));
init_spaths();
tpl::o()->register_modifier('lang', array(lang::o(), 'v'));
// языковая переменная
tpl::o()->register_modifier('getlang', array(lang::o(), 'get'));
// подключение языка прямо в шаблоне
tpl::o()->register_modifier('islang', array(lang::o(), 'visset'));
// языковая переменная
tpl::o()->register_modifier('config', array(config::o(), 'v'));
// конфиг. переменная
tpl::o()->register_modifier('mstate', array(config::o(), 'mstate'));
// разрешён ли модуль
tpl::o()->register_modifier('perm', array(users::o(), "perm"));
// проверка на права
tpl::o()->register_modifier('user', array(users::o(), "v"));
// поле юзера
/**
示例#2
0
 /**
  * Начало инициализации пользователя
  * @return null
  */
 protected function init_begin()
 {
     display::o()->site_autoon();
     $this->lang = validfolder($_COOKIE["lang"], LANGUAGES_PATH) ? $_COOKIE["lang"] : config::o()->v('default_lang');
     $this->theme = validfolder($_COOKIE["theme"]) ? $_COOKIE["theme"] : config::o()->v('default_style');
     init_spaths();
     $this->theme_color = tpl::o()->set_color($_COOKIE["theme_color"]);
     lang::o()->change_folder($this->lang);
     $this->init_ipbans();
     $this->get_groups();
     try {
         plugins::o()->run_hook('user_init_begin');
     } catch (PReturn $e) {
         return $e->r();
     }
 }