示例#1
0
 function __construct()
 {
     parent::__construct();
     if (!is_login()) {
         redirect_to_login();
     }
     $this->theme = theme();
     $this->theme->setBreadcrumb("消息中心", "Message");
     l_h("html_tag.php");
 }
示例#2
0
 /**
  * 构造函数,加载管理员函数,初始化用户
  */
 function __construct()
 {
     l_h("admin.php");
     $this->user = new \ULib\User(true);
     if (!user()->login_status()) {
         redirect(user()->login_go());
     }
     lib()->load('menu')->add('menu', new \ULib\Menu());
     theme()->header_add("<script>var SITE_URL = '" . URL_WEB . "';</script>", 0);
     set_title(null, '控制中心');
 }
示例#3
0
 /**
  * 添加钩子,并初始化部分信息
  */
 public function add()
 {
     if (!db()->status()) {
         hook()->add('UriInfo_process', array($this, 'sql_error'));
     } else {
         c_lib()->load('cookie')->add('cookie', new \CLib\Cookie(cfg()->get('cookie', 'encode')));
         lib()->load('setting', 'user', 'plugin', 'version_hook')->add('setting', new Setting());
         lib()->add('user', new User(true));
         lib()->add("version_hook", new Version_Hook());
         l_h('theme.php');
         hook()->add('UriInfo_process', array($this, 'router'));
         lib()->add('plugin', new Plugin(_BasePath_ . "/ex/plugin"));
     }
 }
示例#4
0
文件: Photo.php 项目: ttym7993/Linger
 function __construct()
 {
     parent::__construct();
     if (!is_login()) {
         redirect_to_login();
     } else {
         if (!login_user()->is_active()) {
             redirect(['User', 'activation']);
         }
     }
     $this->theme = theme();
     $this->theme->setBreadcrumb("图片中心", "Photo");
     l_h("html_tag.php");
 }
示例#5
0
文件: Posts.php 项目: ttym7993/Linger
 public function edit()
 {
     l_h('html_tag.php');
     $this->theme->setBreadcrumb("编辑文章");
     $this->theme->setTitle("编辑文章");
     $id = intval(req()->get('id'));
     $this->__lib('Post');
     $post = new Post($id);
     $info = $post->getInfo(login_user()->getId());
     $this->theme->header_add($this->theme->css(get_bootstrap_plugin_url("markdown/markdown.min.css")));
     $this->theme->header_add($this->theme->js(['src' => get_bootstrap_plugin_url("markdown/markdown.js")]));
     if (!isset($info['post_id']) || $info['post_id'] != $id) {
         $this->__view("User/header.php");
         $this->__view("Posts/not_found.php");
     } else {
         $this->__view("User/header.php");
         $this->__view("Posts/edit.php", ['info' => $info, 'post' => $post]);
     }
     $this->__view("User/footer.php");
 }
示例#6
0
 public function cdn()
 {
     l_h('html_tag.php');
     $this->__view("Control/cdn.php");
 }
示例#7
0
 public function add()
 {
     l_h("system.php", "theme.php");
     lib()->load('Page');
 }
示例#8
0
<?php

set_time_limit(0);
if (is_file("../config/install.lock")) {
    die("Please try again to delete the file /config/install.lock.");
}
require_once "../sys/config.php";
cfg()->load('../config/all.php');
//加载其他配置文件
l_h("system.php", "theme.php");
c_lib()->load('session');
$session = new \CLib\Session();
$info = ['number' => 1, 'list' => []];
$s = $session->get('install');
if (isset($s['number'])) {
    $info = $s;
}
$setup = isset($_GET['setup']) ? $_GET['setup'] : "1";
if ($setup == "import_sql" && $info['number'] == '2') {
    include "../install/import_sql.php";
    exit;
} else {
    if ($setup == "setting" && $info['number'] == '3') {
        include "../install/setting.php";
        exit;
    } else {
        if ($setup == "system" && $info['number'] == '4') {
            include "../install/system.php";
            exit;
        } else {
        }
示例#9
0
文件: Hook.php 项目: ttym7993/Linger
 /**
  * 构造函数
  */
 function __construct()
 {
     set_language();
     c_lib()->load('sql', 'ip')->add('sql', new Sql(cfg()->get('sql', 'write'), cfg()->get('sql', 'read')));
     l_h("system.php", 'theme.php');
 }