Beispiel #1
0
$firewall = new Firewall();
// 定义DOU_SHELL
define('DOU_SHELL', $dou->get_one("SELECT value FROM " . $dou->table('config') . " WHERE name = 'hash_code'"));
define('DOU_ID', 'mobile_' . substr(md5(DOU_SHELL . 'mobile'), 0, 5));
// 读取站点信息
$_CFG = $dou->get_config();
if (!defined('EXIT_INIT')) {
    // 设置页面缓存和编码
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . DOU_CHARSET);
    // 判断是否关闭手机版
    if ($_CFG['mobile_closed']) {
        $dou->dou_header(ROOT_URL);
    }
    // 豆壳防火墙
    $firewall->dou_firewall();
    // SMARTY配置
    $smarty = new smarty();
    $smarty->config_dir = ROOT_PATH . 'include/smarty/Config_File.class.php';
    // 目录变量
    $smarty->template_dir = ROOT_PATH . M_PATH . '/theme/' . $_CFG['mobile_theme'];
    // 模板存放目录
    $smarty->compile_dir = ROOT_PATH . 'cache/' . M_PATH;
    // 编译目录
    $smarty->left_delimiter = '{';
    // 左定界符
    $smarty->right_delimiter = '}';
    // 右定界符
    // 如果编译和缓存目录不存在则建立
    if (!file_exists($smarty->compile_dir)) {
        mkdir($smarty->compile_dir, 0777);