From 411bdce7b7bd0426e4e7a77ea53dbb13b8ac93e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E8=AF=9A=E8=AF=9A?= Date: Tue, 5 Jun 2018 14:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=99=E7=82=B9=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E8=8A=82=E7=82=B9=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config/config.php | 1 + application/controllers/home.php | 42 ++++++++++++++++++++++++++++++++ application/views/welcome.php | 4 ++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 application/controllers/home.php diff --git a/application/config/config.php b/application/config/config.php index 339d9712..2e23c280 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -615,6 +615,7 @@ $config['area_type'] = array( '大使馆' => 'y', '公民游' => 'z', '交换链接' => 'k', + '首页' => 'h', 'FAQ' => 'q' ); diff --git a/application/controllers/home.php b/application/controllers/home.php new file mode 100644 index 00000000..c351dfc8 --- /dev/null +++ b/application/controllers/home.php @@ -0,0 +1,42 @@ +permission->is_admin(); + //$this->output->enable_profiler(TRUE); + $this->load->model('Area_model'); + $this->load->model('Information_model'); + $this->load->model('InfoContents_model'); + $this->load->model('InfoStructures_model'); + } + + //站点首页 + public function index() + { + $home_id=1; + //查询结构根节点,当为空则建立 + $rootStructure = $this->Information_model->GetRoot('h', $home_id); + if ($rootStructure == FALSE) + { + $this->InfoContents_model->Add('', 'HomePage', 'root', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', $home_id, 'h', 0, + '',''); + $this->InfoStructures_model->Add(0, $this->InfoContents_model->insert_id); + $is_id = $this->InfoStructures_model->insert_id; + } + else + { + $is_id = $rootStructure->is_id; + } + redirect(site_url('information/edit/' . $is_id)); + } + + +} + diff --git a/application/views/welcome.php b/application/views/welcome.php index e123e34e..7757fce0 100644 --- a/application/views/welcome.php +++ b/application/views/welcome.php @@ -5,7 +5,9 @@
系统模块
- +
+ 站点首页 +
专题管理