示例#1
0
文件: core.php 项目: SjayLiFe/CTRev
 */
if (!defined('INSITE')) {
    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
文件: main.php 项目: SjayLiFe/CTRev
 /**
  * Отображение конфигурации сайта
  * @return null 
  */
 protected function show_config()
 {
     init_baseurl();
     $prebaseurl = globals::g('prebaseurl');
     $prebaseurl = $prebaseurl == "/" ? "/" : rtrim($prebaseurl, '/');
     tpl::o()->assign('baseurl', $prebaseurl);
     globals::s('prebaseurl', $prebaseurl);
     tpl::o()->display('config');
 }