diff --git a/application/admin/controller/Content.php b/application/admin/controller/Content.php index 08c35a4d..358754c7 100644 --- a/application/admin/controller/Content.php +++ b/application/admin/controller/Content.php @@ -262,10 +262,12 @@ class Content extends Admin{ } } } - + if (isset($map['page'])) { + unset($map['page']); + } if ($this->modelInfo['extend'] == 1) { $category = isset($data['category']) ? $data['category'] : ''; - $cate_list = parse_field_bind('category', $category, $this->modelInfo['id']); + $cate_list = parse_field_bind('category', $category, 0); $this->assign('cate_list', $cate_list); } $this->assign($data); diff --git a/application/common/behavior/InitHook.php b/application/common/behavior/InitHook.php index 2dd2ee0e..f6b57312 100644 --- a/application/common/behavior/InitHook.php +++ b/application/common/behavior/InitHook.php @@ -66,6 +66,11 @@ class InitHook { $route["user/".$value['name']."/del"] = "user/content/del?model_id=".$value['id']; $route["user/".$value['name']."/status"] = "user/content/status?model_id=".$value['id']; } + + $list = db('Rewrite')->select(); + foreach ($list as $key => $value) { + $route[$value['rule']] = $value['url']; + } \think\Route::rule($route); } } \ No newline at end of file diff --git a/application/common/controller/Upload.php b/application/common/controller/Upload.php index cf7802ee..83e755cf 100644 --- a/application/common/controller/Upload.php +++ b/application/common/controller/Upload.php @@ -121,7 +121,7 @@ class Upload { $data['m_time'] = $info->getMTime(); //获取最后修改时间 $data['owner'] = $info->getOwner(); //文件拥有者 $data['savepath'] = $info->getPath(); //不带文件名的文件路径 - $data['url'] = $data['path'] = substr($info->getPathname(), 1); //全路径 + $data['url'] = $data['path'] = str_replace("\\", '/', substr($info->getPathname(), 1)); //全路径 $data['size'] = $info->getSize(); //文件大小,单位字节 $data['is_file'] = $info->isFile(); //是否是文件 $data['is_execut'] = $info->isExecutable(); //是否可执行 diff --git a/application/common/view/default/ad/sider.html b/application/common/view/default/ad/sider.html index 40bef426..11082b82 100644 --- a/application/common/view/default/ad/sider.html +++ b/application/common/view/default/ad/sider.html @@ -1,11 +1,15 @@ diff --git a/data/sql.sql b/data/sql.sql index 6c9bac33..e4066f5d 100644 --- a/data/sql.sql +++ b/data/sql.sql @@ -1382,6 +1382,16 @@ CREATE TABLE `sent_picture` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `sent_rewrite`; +CREATE TABLE `sent_rewrite` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id自增', + `rule` varchar(255) NOT NULL DEFAULT '' COMMENT '规则', + `url` varchar(255) NOT NULL DEFAULT '' COMMENT 'url', + `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='伪静态表'; + -- ----------------------------- -- Table structure for `sent_seo_rule` -- -----------------------------