-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.php
51 lines (42 loc) · 1.34 KB
/
init.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* 全局项加载
* @copyright (c) Emlog All Rights Reserved
*/
error_reporting(7);
ob_start();
header('Content-Type: text/html; charset=UTF-8');
define('EMLOG_ROOT', dirname(__FILE__));
require_once EMLOG_ROOT.'/config.php';
require_once EMLOG_ROOT.'/include/lib/function.base.php';
doStripslashes();
$CACHE = Cache::getInstance();
$userData = array();
define('ISLOGIN', LoginAuth::isLogin());
//用户组:admin管理员, writer联合撰写人, visitor访客
define('ROLE_ADMIN', 'admin');
define('ROLE_WRITER', 'writer');
define('ROLE_VISITOR', 'visitor');
//用户角色
define('ROLE', ISLOGIN === true ? $userData['role'] : ROLE_VISITOR);
//用户ID
define('UID', ISLOGIN === true ? $userData['uid'] : '');
//站点固定地址
define('BLOG_URL', Option::get('blogurl'));
//模板库地址
define('TPLS_URL', BLOG_URL.'content/templates/');
//模板库路径
define('TPLS_PATH', EMLOG_ROOT.'/content/templates/');
//解决前台多域名ajax跨域
define('DYNAMIC_BLOGURL', getBlogUrl());
//前台模板URL
define('TEMPLATE_URL', TPLS_URL.Option::get('nonce_templet').'/');
$active_plugins = Option::get('active_plugins');
$emHooks = array();
if ($active_plugins && is_array($active_plugins)) {
foreach($active_plugins as $plugin) {
if(true === checkPlugin($plugin)) {
include_once(EMLOG_ROOT . '/content/plugins/' . $plugin);
}
}
}